{"slug": "googles-new-colab-cli-lets-developers-and-ai-agents-run-python-on-remote-colab", "title": "Google’s New Colab CLI Lets Developers and AI Agents Run Python on Remote Colab GPUs and TPUs From the Terminal", "summary": "Google released the Colab CLI, an open-source command-line tool that lets developers and AI agents run Python code on remote Colab GPUs and TPUs directly from a local terminal. The tool supports session management, file transfers, and interactive debugging, enabling scripted and agent-driven machine learning workflows without leaving the command line.", "body_md": "This week, Google AI team released the ** Colab CLI**. The tool connects your local terminal to remote Colab runtimes. It lets developers and AI agents run code on cloud GPUs and TPUs. You stay in your terminal the entire time. The CLI is open source under the Apache 2.0 license.\n\n**What is Google Colab CLI**\n\nThe Colab CLI is a command-line interface for Google Colab. You can create sessions, run code, and manage files from the terminal.\n\nAny agent with terminal access can call the tool. That includes Claude Code, Codex, and Google’s Antigravity. Google ships a prepackaged skill file named `COLAB_SKILL.md`\n\n. It gives agents built-in context on how to use the CLI.\n\nInstallation uses a single `uv tool install`\n\ncommand from the GitHub repository.\n\n```\nuv tool install git+https://github.com/googlecolab/google-colab-cli\n```\n\n**A minimal session looks like this:**\n\n```\ncolab new                              # provision a CPU session\necho \"print('hello')\" | colab exec     # run code\ncolab stop                             # release the VM\n```\n\n**How the Commands Work**\n\nThe CLI groups commands into sessions, execution, files, and automation. `colab new`\n\nprovisions a session, with CPU as the default. Add `--gpu T4`\n\n, `--gpu L4`\n\n, `--gpu A100`\n\n, or `--gpu H100`\n\nfor a GPU. TPU options are `v5e1`\n\nand `v6e1`\n\n.\n\n`colab exec`\n\nruns Python from stdin, a `.py`\n\nfile, or a notebook. The `exec`\n\nreads files locally and ships their contents. Local edits therefore need no separate upload step. `colab stop`\n\nterminates the session and releases the VM.\n\nOther commands cover files and authentication. `colab upload`\n\nand `colab download`\n\nmove files between local and remote. `colab drivemount`\n\nmounts Google Drive, defaulting to `/content/drive`\n\n. `colab auth`\n\nauthenticates the VM for Google Cloud services.\n\n`colab exec`\n\nand Artifact Recovery: The Core Loop\n\n`colab exec`\n\nand Artifact Recovery: The Core LoopThe core loop is short. You provision a runtime, run a script, then pull results back. `colab download`\n\nretrieves models, datasets, and other files. `colab log`\n\nexports session history as `.ipynb`\n\n, `.md`\n\n, `.txt`\n\n, or `.jsonl`\n\n.\n\nSo a remote run becomes a replayable notebook on your disk. `colab repl`\n\nand `colab console`\n\ngive interactive access to the VM. `colab install`\n\nadds packages with `uv`\n\n, falling back to `pip`\n\n. Session metadata is stored at `~/.config/colab-cli/sessions.json`\n\n.\n\n**Example: Fine-Tuning Gemma 3 1B**\n\nGoogle’s official release demonstrates an agent-driven fine-tuning job. The task fine-tunes `google/gemma-3-1b-it`\n\nusing QLoRA. It trains on a Text-to-SQL dataset to improve SQL generation. The Antigravity agent runs the full pipeline with five commands.\n\n```\ncolab new --gpu T4\ncolab install transformers datasets peft trl bitsandbytes accelerate\ncolab exec -f finetune_run.py\ncolab log --output gemma_finetune_log.ipynb\ncolab stop\n```\n\nThe agent then downloads the adapter model, adapter config, tokenizer config, and tokenizer. You can load and serve the fine-tuned model locally. No manual cloud provisioning command was typed by the user.\n\n**Use Cases**\n\n- Offload laptop-bound training to a remote GPU or TPU without leaving the terminal.\n- Let agents like Claude Code, Codex, or Antigravity run end-to-end ML pipelines.\n- Fine-tune small models, such as Gemma 3 1B, with QLoRA remotely.\n- Script notebook execution and export replayable\n`.ipynb`\n\nlogs for reproducibility. - Debug interactively on the VM through\n`colab repl`\n\nor`colab console`\n\n.\n\n**Colab CLI vs Browser-Based Colab**\n\nThe CLI does not replace the notebook UI. It targets scripted, automated, and agent-driven work instead. Here is how the two workflows compare across common tasks.\n\n| Dimension | Browser-Based Colab | Colab CLI |\n|---|---|---|\n| Interface | Web notebook UI | Local terminal |\n| Accelerator selection | Runtime menu in the browser | `--gpu` / `--tpu` flags on `colab new` |\n| Agent use | Manual, UI-driven | Any terminal agent via commands |\n| Run local scripts | Paste or upload into cells | `colab exec -f script.py` |\n| Artifact retrieval | Manual download or Drive | `colab download` , `colab log` |\n| Package install | `!pip` inside a cell | `colab install` (uv, then pip) |\n| Session control | Browser-managed runtime | `colab new` , `colab stop` , `colab status` |\n| Agent skill file | None | Bundled `COLAB_SKILL.md` |\n\n**Strengths and Considerations**\n\n**Strengths:**\n\n- Terminal-native workflow fits scripts, CI, and agent loops.\n- One command provisions T4, L4, A100, or H100 GPUs.\n`exec`\n\nships local file contents, so no upload step is needed.- Logs export to replayable notebook formats for reproducibility.\n- Open source under Apache 2.0, with a bundled agent skill file.\n- Works with multiple agents, not a single vendor’s tool.\n\n**Considerations:**\n\n- Access requires authentication; the default strategy is\n`oauth2`\n\n. `repl`\n\nand`console`\n\nneed a TTY when run interactively.- Pipe stdin to use those two commands inside scripts.\n- Compute still runs on Colab’s backend and its runtime model.\n\n**Key Takeaways**\n\n- Google’s Colab CLI runs code on remote Colab GPUs and TPUs from your local terminal.\n- One command provisions accelerators:\n`colab new --gpu T4`\n\nthrough`A100`\n\nand`H100`\n\n, plus TPUs. `colab exec`\n\nships local`.py`\n\nand`.ipynb`\n\nfiles to the runtime without an upload step.- Any terminal agent — Claude Code, Codex, Antigravity — can drive it via a bundled\n`COLAB_SKILL.md`\n\n. - It is open source under Apache 2.0, and\n`colab log`\n\nexports replayable notebook logs.\n\n**Marktechpost Visual Explainer**\n\n**Marktechpost — practitioner AI & ML coverage, no hype.** Source: Marktechpost.com\n\nCheck out the ** Technical details** and\n\n**Also, feel free to follow us on**\n\n[GitHub Repo here](https://github.com/googlecolab/google-colab-cli).**and don’t forget to join our**[Twitter](https://x.com/intent/follow?screen_name=marktechpost)\n\n**and Subscribe to**\n\n[150k+ ML SubReddit](https://www.reddit.com/r/machinelearningnews/)**. Wait! are you on telegram?**\n\n[our Newsletter](https://www.aidevsignals.com/)\n\n[now you can join us on telegram as well.](https://t.me/machinelearningresearchnews)Need to partner with us for promoting your GitHub Repo OR Hugging Face Page OR Product Release OR Webinar etc.? [Connect with us](https://forms.gle/wbash1wF6efRj8G58)", "url": "https://wpnews.pro/news/googles-new-colab-cli-lets-developers-and-ai-agents-run-python-on-remote-colab", "canonical_source": "https://www.marktechpost.com/2026/06/06/googles-new-colab-cli-lets-developers-and-ai-agents-run-python-on-remote-colab-gpus-and-tpus-from-the-terminal/", "published_at": "2026-06-06 22:07:34+00:00", "updated_at": "2026-06-06 22:27:14.558201+00:00", "lang": "en", "topics": ["ai-tools", "ai-infrastructure", "ai-products", "ai-research", "artificial-intelligence"], "entities": ["Google", "Colab CLI", "Apache 2.0", "Claude Code", "Codex", "Antigravity", "GitHub", "Google Colab"], "alternates": {"html": "https://wpnews.pro/news/googles-new-colab-cli-lets-developers-and-ai-agents-run-python-on-remote-colab", "markdown": "https://wpnews.pro/news/googles-new-colab-cli-lets-developers-and-ai-agents-run-python-on-remote-colab.md", "text": "https://wpnews.pro/news/googles-new-colab-cli-lets-developers-and-ai-agents-run-python-on-remote-colab.txt", "jsonld": "https://wpnews.pro/news/googles-new-colab-cli-lets-developers-and-ai-agents-run-python-on-remote-colab.jsonld"}}