Google Colab Now Runs From the Terminal, No Browser Needed

Version 0.8.1 lets coding agents rent cloud GPUs, run local Python scripts, and stop runtimes from the shell.

Google shipped version 0.8.1 of the Google Colab CLI on December 5, giving Linux and macOS terminals direct control over remote Colab CPU, GPU, and TPU runtimes without opening a browser tab. Originally introduced on the Google Developers Blog for both human developers and terminal agents like Antigravity, Claude Code, and Codex, the Apache-licensed CLI provisions T4, L4, G4, A100, and H100 GPUs in seconds, runs local Python scripts or notebooks, pulls artifacts back to disk, and tears the machine down.

Theo Lindqvist is the AI host, speaking with an ElevenLabs voice.

Listen to this story
2:32

The timing matters because Google folded premium Colab benefits into paid Google AI plans, giving Google AI Ultra subscribers uninterrupted background execution and a monthly pool of Colab compute units alongside their model quotas. Until an agent can reach those units from a shell script, they sit unused behind notebook tabs while builders pay per call elsewhere. Jon's fleet runs a strict local-first order: its local NVIDIA DGX Spark handles everyday image and video renders first, and the Colab CLI turns Ultra's included compute units into an overflow GPU queue when the local GPU lock is busy.

Fleet test: a 1376x768 Google Flow illustration upscaled 4x on a Colab Tesla T4 GPU in 9.6 seconds

To test version 0.8.1 on real production assets, Jon's agents ran a headless job from a Mac Mini against a Colab Tesla T4 runtime, which colab usage billed at 1.32 compute units an hour (compared with 2.73 units an hour measured on an L4). Upscaling the 1,376 by 768 Google Flow illustration above four times with Real-ESRGAN took 9.6 seconds on the T4. Streaming a 190-frame, 720p Google Flow video clip through realesr-general-x4v3 to crisp 1080p ran at 2.5 frames per second, finishing the whole session in 99 seconds for under four hundredths of a compute unit.

Three catches surfaced immediately in unattended agent runs. On a headless Mac, the default macOS Keychain backend hangs waiting for GUI access, so agents need keyrings.alt with PYTHON_KEYRING_BACKEND=keyrings.alt.file.PlaintextKeyring, which stores the OAuth token in a user-only file on disk. Second, colab exec aborts if a kernel stays quiet for 30 seconds; pass --timeout 300 on long GPU steps, or use one-shot colab run --gpu T4 so a failed script still releases the VM. Third, Colab's FAQ notes that Pro+ runtimes can run up to 24 hours while compute units last, bans SSH shells on free zero-balance accounts, and prohibits file hosting, media serving, crypto mining, and deepfakes on all managed runtimes. Keep confidential client files on local hardware and send public or internal non-sensitive batch jobs to Colab.

Run a headless T4 job that always cleans up

Terminal
uv tool install google-colab-cli --with keyrings.alt
export PYTHON_KEYRING_BACKEND=keyrings.alt.file.PlaintextKeyring
# One-shot ephemeral run (provisions T4, runs job.py, and tears down):
colab run --gpu T4 job.py
# Or a named session with file upload/download and guaranteed stop:
trap 'colab stop -s batch1' EXIT
colab new -s batch1 --gpu T4
colab upload -s batch1 ./input.mp4 /content/input.mp4
colab exec -s batch1 --timeout 300 -f upscale.py
colab download -s batch1 /content/output.mp4 ./output.mp4

Run colab sessions after the job finishes to confirm nothing is left burning units, and keep one CLI session running per machine at a time so parallel agents do not collide on local session state.

Sources

Comments

No comments yet.

Sign in to comment. You'll come back to this story.