Source-led article

Google Colab CLI Launched: Run Python on Remote GPUs/TPUs from Your Terminal for AI Development

AI Agents//4 min read
Screenshot of a terminal running Google Colab CLI commands, showing Python code execution on a remote GPU
Screenshot of a terminal running Google Colab CLI commands, showing Python code execution on a remote GPU
future systems, copenhagen harbour, 2004-2008 | by seier+seier | openverse | by

Google has introduced the Colab CLI, a command-line interface designed to connect local terminals with remote Colab runtimes. This new tool empowers developers and AI agents to execute Python code on cloud-based GPUs and TPUs without ever leaving their terminal environment. Released as open-source under the Apache 2.0 license, the Colab CLI aims to simplify and automate various AI development tasks, from session management and code execution to file transfers and authentication.

For Indian developers, data scientists, and AI product teams, this development offers a significant workflow enhancement. It provides a robust solution for running computationally intensive machine learning and deep learning tasks on Google’s powerful hardware, bypassing the traditional browser-based Colab notebook interface. This is particularly beneficial for scripting, automation, and integrating AI tasks into existing CI/CD pipelines or agent-driven systems.

Key facts

Feature Description
Product Google Colab CLI
Function Run Python on remote Colab GPUs/TPUs from terminal
License Apache 2.0 (Open Source)
Target Users Developers, AI Agents, Data Scientists

Streamlining AI Development Workflows

The Colab CLI allows users to provision new Colab sessions, specify GPU (T4, L4, A100, H100) or TPU (v5e1, v6e1) accelerators, execute Python scripts or notebooks, and manage files—all from the command line. This capability is critical for automating repetitive tasks, such as model training, data preprocessing, or generating reports, which often require significant computational resources.

For instance, a common workflow might involve provisioning a GPU-enabled session, installing necessary libraries, running a training script, and then downloading the trained model or logs back to the local machine. The CLI simplifies this multi-step process into a series of terminal commands, making it highly scriptable. This drastically reduces manual intervention and allows for more efficient resource utilization, especially for teams managing multiple experiments or models.

Agent-Driven AI Operations

A notable feature of the Colab CLI is its design for interoperability with AI agents. Google has included a prepackaged `COLAB_SKILL.md` file, which provides built-in context for agents like Claude Code, Codex, and Google’s Antigravity, enabling them to understand and utilize the CLI commands effectively. This means that AI agents can orchestrate complex machine learning pipelines autonomously, from setting up the environment to executing fine-tuning jobs and retrieving results.

Google demonstrated this with an Antigravity agent fine-tuning `google/gemma-3-1b-it` using QLoRA on a Text-to-SQL dataset. The agent managed the entire process through five simple Colab CLI commands: provisioning a T4 GPU, installing dependencies, executing the fine-tuning script, logging the output, and stopping the session. This capability opens new avenues for fully automated research, development, and deployment of AI models, which can be a game-changer for Indian startups and larger enterprises looking to accelerate their AI initiatives.

Installation and Core Commands

Installation of the Colab CLI is straightforward, requiring a single `uv tool install` command from its GitHub repository:

`uv tool install git+https://github.com/googlecolab/google-colab-cli`

Once installed, users can quickly start a session, execute code, and manage resources. Key commands include:

  • `colab new`: Provisions a new session, with options to specify CPU, GPU (e.g., `–gpu T4`), or TPU (e.g., `–tpu v6e1`).
  • `colab exec`: Runs Python code from stdin, a `.py` file, or a notebook. It intelligently reads local files and ships their contents, eliminating the need for separate upload steps for local edits.
  • `colab stop`: Terminates the session and releases the allocated VM.
  • `colab upload` and `colab download`: Facilitate file transfers between local and remote environments.
  • `colab drivemount`: Mounts Google Drive, defaulting to `/content/drive`.
  • `colab auth`: Authenticates the VM for Google Cloud services.
  • `colab log`: Exports session history in various formats, including `.ipynb`, `.md`, `.txt`, or `.jsonl`, enabling easy replay and documentation of remote runs.
  • `colab install`: Adds packages using `uv`, with a fallback to `pip`.

Impact for Indian AI Ecosystem

The Colab CLI empowers Indian developers and organizations to leverage Google Colab’s computational resources more efficiently. For startups, it means faster iteration cycles and reduced operational overhead in managing AI experiments. For larger enterprises, it enables better integration of AI model development into existing DevOps practices and facilitates scalable automation. The ability to directly interact with Colab’s powerful GPUs and TPUs without a browser interface can significantly boost productivity, especially for teams working with large datasets or complex models. This tool is a step towards making advanced AI infrastructure more accessible and manageable for the growing Indian AI community.

Source: MarkTechPost – 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/