AI Sparks

Google’s New Colab CLI Allows Developers and AI Agents to Run Python on Remote Colab GPUs and TPUs from a Terminal

This week, the Google AI team released a Exchange CLI shares. The tool connects your local terminal to the remote Colab runtime. It allows developers and AI agents to run code on cloud GPUs and TPUs. You stay in your terminal all the 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 in the terminal.

Any agent with terminal access can call the tool. That includes Claude Code, Codex, and Google’s Antigravity. Google sends a precompiled skill file named COLAB_SKILL.md. It provides agents with a built-in context for how to use the CLI.

Installation uses one uv tool install command from the GitHub repository.

uv tool install git+

A mini 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, executions, files, and automation. colab new provides session, and CPU as default. Add --gpu T4, --gpu L4, --gpu A100or --gpu H100 of the GPU. TPU options are v5e1 again v6e1.

colab exec uses Python from stdin, a .py file, or notebook. I exec reads files locally and sends their contents. Local editing therefore does not require a separate loading step. colab stop terminates the session and exits the VM.

Other commands cover files and authentication. colab upload again colab download move files between local and remote. colab drivemount it installs Google Drive, by default /content/drive. colab auth authenticates the VM for Google Cloud services.

colab exec and Artifact Recovery: The Core Loop

The core loop is short. You provide a runtime, run the script, and return the results. colab download finds models, datasets, and other files. colab log sends the session history as .ipynb, .md, .txtor .jsonl.

So the remote run becomes a notebook that is replayed on your disk. colab repl again colab console grant interactive access to the VM. colab install you add packages with uvgoing back pip. Time metadata is stored in ~/.config/colab-cli/sessions.json.

Example: Gemma for fine tuning 3 1B

Google’s official release shows an agent-driven fine-tuning function. The task is simple google/gemma-3-1b-it using QLoRA. It is trained on Text-to-SQL datasets to improve SQL productivity. The Antigravity agent uses a pipeline full of 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 upload and render a fine-tuned model locally. There is no manual cloud provisioning command by the user.

Use Cases

  • Upload training bound to a laptop to a remote GPU or TPU without leaving the terminal.
  • Let agents like Claude Code, Codex, or Antigravity run end-to-end ML pipelines.
  • Fine tune smaller models, such as the Gemma 3 1B, with QLoRA remote.
  • Using script notebook and export playable as well .ipynb timber for regeneration.
  • Debug by interacting with the VM by using colab repl or colab console.

Colab CLI vs Browser-Based Colab

The CLI does not replace the notebook UI. It directs scripted, automated, and agent-driven work instead. Here’s how the two workflows compare across common tasks.

Size Browser Based Colab Exchange CLI shares
Interface Web notebook UI Local terminal
Choosing an accelerator A runtime menu in a browser --gpu / --tpu the flags are open colab new
Use of agent Manual, UI driven Any terminal agent with commands
Run local scripts Paste or load into cells colab exec -f script.py
Finding the artifact Manual download or Drive colab download, colab log
Package installation !pip inside the cell colab install (uv, then pipe)
Time management Runtime managed by the browser colab new, colab stop, colab status
Agent skill file Nothing Combined COLAB_SKILL.md

Powers and Considerations

Power:

  • Native terminal workflows are compatible with scripts, CI, and agent loops.
  • Single command rendering for T4, L4, A100, or H100 GPUs.
  • exec it sends the contents of local files, so no upload step is required.
  • Export logs to playable notebook formats for playback.
  • Open source under Apache 2.0, with an integrated agent capability file.
  • It works with multiple agents, not a single broker tool.

Assumptions:

  • Access requires authentication; the default strategy is oauth2.
  • repl again console need a TTY if you run collaboratively.
  • Pipe stdin to run those two commands inside scripts.
  • Compute still works 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.
  • One command provides accelerators: colab new --gpu T4 by using A100 again H100and TPUs.
  • colab exec local ships .py again .ipynb files at runtime without the upload step.
  • Any killer agent – Claude Code, Codex, Antigravity – can drive it in bulk COLAB_SKILL.md.
  • It’s open source under Apache 2.0, too colab log exports replayable logs.

Marktechpost Visual Explainer

Google Colab CLI – Terminal guide
1/8

Overview

Run Colab GPUs and TPUs from your terminal

Google Colab CLI connects your local terminal to remote Colab runtimes. Developers and AI agents run code on cloud accelerators without leaving the shell.

Announced June 5, 2026 • Open source under Apache 2.0

Step 1

What is it

  • Command line link for Google Colab.
  • Connects your local terminal to remote Colab workstations.
  • You create sessions, run code, and manage files from the terminal.
  • Any endpoint-based AI agent can call it as well.

Step 2

Install and start immediately

Install with one command, and run the first session.

uv tool install git+

colab new                            # provision a CPU session
echo "print('hello')" | colab exec   # run code
colab stop                           # release the VM

Step 3

Offer GPUs and TPUs

Request an accelerator when you create a session. CPU is the default.

colab new --gpu T4
colab new --gpu A100
colab new --tpu v6e1

Accelerator availability depends on your running Colab system.

Step 4

Run local scripts remotely

The exec command reads your file locally and sends its contents. No separate loading step is required.

colab exec -f train.py

exec executes Python from stdin, a .py file, or a notebook.

Step 5

Restore models and logs

Drag the results back to your device after the run.

colab download -s NAME checkpoints/model.bin ./model.bin
colab log -o report.ipynb

Export of logs as .ipynb, .md, .txt, or .jsonl.

Step 6

Example: fine tune Gemma 3 1B

Google’s blog shows an agent running the QLoRA pipeline on a Text-to-SQL dataset.

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

Step 7

Designed for AI agents

  • Any agent with terminal access can call the CLI.
  • Works with Claude Code, Codex, and Antigravity.
  • The integrated COLAB_SKILL.md provides agents with a built-in context.
  • The result: a scripted, agent-friendly Colab computer.

Marktechpost – AI and ML expert, no hype.
Source: Marktechpost.com


Check it out Technical details again GitHub Repo here. Also, feel free to follow us Twitter and don’t forget to join our 150k+ ML SubReddit and Subscribe to Our newspaper. Wait! are you on telegram? now you can join us on telegram too.

Need to work with us on developing your GitHub Repo OR Hug Face Page OR Product Release OR Webinar etc.? contact us


Related Articles

Leave a Reply

Your email address will not be published. Required fields are marked *

Back to top button