This week, the Google AI team released colab cli. The tool connects your local terminal to the remote Colab runtime. It lets developers and AI agents run code on cloud GPUs and TPUs. You are in your terminal the whole time. The CLI is open source under the Apache 2.0 license.
What is Google Colab CLI?
Colab CLI is a command-line interface for Google Colab. You can create sessions, run code, and manage files from the terminal.
Any agent with terminal access can call the tool. This includes Cloud Code, Codex, and Google’s AntiGravity. Google ships a prepackaged skills file named COLAB_SKILL.md. This gives agents built-in context on how to use the CLI.
installation uses single uv tool install Command from GitHub repository.
uv tool install git+https://github.com/googlecolab/google-colab-cli
A minimal session looks like this:
colab new # provision a CPU session
echo "print('hello')" | colab exec # run code
colab stop # release the VM
How commands work
The CLI groups commands into sessions, execution, files, and automation. colab new Provisions a session with the CPU as default. Add --gpu T4, --gpu L4, --gpu A100Or --gpu H100 For a GPU. there are tpu options v5e1 And v6e1.
colab exec Runs Python from stdin, a .py file, or a notebook. exec Reads files locally and sends their contents. So local edits do not require a separate upload step. colab stop Terminates the session and releases the VM.
Other commands cover files and authentication. colab upload And colab download Move files between local and remote. colab drivemount By default, mounts Google Drive /content/drive. colab auth Certifies the VM for Google Cloud services.
colab exec and Artifact Recovery: The Core Loop
The core loop is small. You provision a runtime, run a script, then pull back the results. colab download Retrieves models, datasets, and other files. colab log Exports session history as .ipynb, .md, .txtOr .jsonl.
So a remote run becomes a rerunable notebook on your disk. colab repl And colab console Grant interactive access to the VM. colab install adds package with uvfall back pip. Session metadata is stored here ~/.config/colab-cli/sessions.json.
Example: Fine-Tuning Gemma 3 1B
Google’s official release showcases the fine-tuning work conducted by the agent. work is organized google/gemma-3-1b-it Using QLoRA. It trains on text-to-SQL datasets to improve SQL generation. The AntiGravity Agent runs the entire pipeline with five commands.
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
The agent then downloads the adapter model, adapter configuration, tokenizer configuration, and tokenizer. You can load and serve fine-tuned models locally. No manual cloud provisioning commands were typed by the user.
use cases
- Offload laptop-bound training to a remote GPU or TPU without leaving the terminal.
- Let agents like Cloud Code, Codex, or AntiGravity run end-to-end ML pipelines.
- Remotely fine-tune small models like the Gemma 3 1B with QLORA.
- Script Notebook Execution and Export Rerunable
.ipynbLog for reproducibility. - Debug interactively on VM
colab replOrcolab console.
Colab CLI vs browser-based Colab
The CLI does not replace the Notebook UI. Instead it targets scripted, automated and agent-driven work. Here’s how both workflows compare in general terms.
| Dimensions | Browser-Based Collab | colab cli |
|---|---|---|
| interface | web notebook ui | local terminal |
| accelerator selection | runtime menu in browser | --gpu / --tpu flags are up colab new |
| use of agent | Manual, UI-driven | Orders through any terminal agent |
| run local script | Paste or upload into cells | colab exec -f script.py |
| artifact recovery | manual download or drive | colab download, colab log |
| install package | !pip inside a cell |
colab install (uv, then pip) |
| session control | Browser-Managed Runtime | colab new, colab stop, colab status |
| Agent Skills File | nobody | bundle COLAB_SKILL.md |
strength and thoughts
Strength:
- Fits into terminal-native workflow scripts, CI, and agent loops.
- One command provisions a T4, L4, A100, or H100 GPU.
execSends local file content, so no upload step is required.- Export logs in playable notebook formats for reproduction.
- Open source under Apache 2.0, with a bundled agent skills file.
- Works with multiple agents, not any single vendor’s tools.
Idea:
- Access requires authentication; the default strategy is
oauth2. replAndconsoleRequires TTY when running interactively.- Pipe stdin to use those two commands inside the script.
- Compute still runs on Colab’s backend and its runtime model.
key takeaways
- Google’s Colab CLI runs code on remote Colab GPUs and TPUs from your local terminal.
- An order provisioning accelerator:
colab new --gpu T4ThroughA100AndH100Plus TPU. colab execlocal ship.pyAnd.ipynbFiles at runtime without upload step.- Any terminal agent – ​​Cloud Code, Codex, AntiGravity – can run it through the bundle
COLAB_SKILL.md. - It is open source under Apache 2.0, and
colab logExports playable notebook logs.
MarketTechPost Visual Explainer
Google Colab CLI – Terminal Guide
1 / 8
MarkTechPost – Practitioner AI and ML coverage, no promotions.
Source: marktechpost.com
check it out technical details And GitHub repo here. Also, feel free to follow us Twitter And don’t forget to join us 150k+ ml subreddit and subscribe our newsletter. wait! Are you on Telegram? Now you can also connect with us on Telegram.
Do you need to partner with us to promote your GitHub repo or Hugging Face page or product release or webinar, etc? join us