Introducing the Google Colab CLI

JUNE 5, 2026
Spencer Shumway Product Manager
Tyler Pirtle Software Engineer
Seth Troisi Software Engineer

Today we are announcing the Google Colab Command-Line Interface (CLI), which bridges the gap between your local terminal and remote Colab runtimes, providing a zero-friction execution platform for both developers and AI agents. The Colab CLI offers:

  • Zero-Friction Accelerator Provisioning: Request high-powered GPUs or TPUs instantly (e.g., colab --gpu A100 or colab --gpu T4).
  • Simple Remote Execution: Run your local Python scripts and complex ML pipelines directly on Colab runtimes using colab exec.
  • Seamless Artifact Recovery: Easily retrieve models, datasets, and replayable .ipynb logs via colab download and colab log.
  • Interactive Access: Drop into an interactive environment on your remote Colab runtime with colab repl or colab console.

Agent-driven workflows in action

Because the Colab CLI integrates seamlessly into standard terminal environments, it can be used by any agent with terminal access. To ensure your AI assistants can hit the ground running, the CLI includes a prepackaged Colab skill file that provides agents with instant, built-in context on exactly how to leverage the CLI. Let's look at a real life example of something a user or agent might try with the Colab CLI.

*Note that while the example below highlights Antigravity agent using Colab CLI as a tool, Colab CLI can easily be used by Claude Code, Codex, and other agents.

Here is how an Agent can use the Colab CLI for a real-world ML workflow:

Fine-tuning Gemma 3-1B

The CLI can be used to run a real QLoRA pipeline that runs end-to-end with just a handful of commands. Offload heavy computational lifting to a GPU without typing a single cloud provisioning command by Instructing Antigravity (or your agent of choice) to build a remote fine-tuning job. In this scenario, we ask our agent to use the Colab CLI to fine-tune google/gemma-3-1b-it on a Text-to-SQL dataset to make the model better at writing SQL queries.

The Antigravity prompt:
Use the Colab CLI (https://github.com/googlecolab/google-colab-cli) to fine-tune Gemma 3 1B using QLoRA. Provision a Colab T4 GPU instance, install the necessary ML packages (transformers, datasets, peft, trl, etc.), run my local ~finetune_run.py script remotely, download the resulting safetensors adapter, save the notebook log, and cleanup.

Antigravity executes:

$ colab new --gpu T4
$ colab install transformers datasets peft trl bitsandbytes accelerate
$ colab exec -f finetune_run.py
$ colab log --output gemma_finetune_log.ipynb
$ colab stop
Shell

Antigravity also uses the "colab download" command to download the adapter model, adapter config, tokenizer config, and tokenizer, which can be used to load and run your fine-tuned model locally. Now you have a remotely fine-tuned model ready to serve from your local device!

Try it out now

The Colab CLI makes powerful Colab compute accessible, programmable, and agent-ready. It is lightweight and easily accessible to any terminal-based AI agent. To start using the Colab CLI yourself, head over to the Google Colab CLI GitHub repository for setup instructions.

We are excited to see how this accelerates your development process and look forward to seeing what you and your agents build!