googlecolab/google-colab-cli
Developer ToolsRun and manage Google Colab CPU, GPU, and TPU runtimes from the terminal.
Colab CLI
Overview
A command-line client for Google Colab that provisions CPU, GPU (T4, L4, G4, H100, A100), or TPU (v5e1, v6e1) runtimes and executes Python code on them from a local terminal. It targets developers who want headless or scripted access to Colab hardware instead of an interactive notebook: run local scripts, notebooks, or piped stdin, move files between local and remote, mount Drive, install packages with uv, and export session history. A colab run command bundles provisioning, execution, and teardown for one-off accelerator jobs.
Quick start
The README recommends installing with uv, with pip as an alternative Installation:
uv tool install google-colab-cli
Then provision a CPU session, execute code over stdin, and release the VM Quick Start:
colab new
echo 'print("Hello from Google Colab!")' | colab exec
colab stop
When only one session is active, -s/--session can be omitted. For GPU work, colab new -s trainer --gpu A100 followed by colab install, colab exec -f train.py, and colab download is the documented flow; see the demo walkthroughs for additional scenarios.
Constraints
The CLI supports Linux and macOS only; Windows is not supported. Authentication to the Colab API defaults to Application Default Credentials (--auth adc), with an OAuth2 option and a client config path. Interactive commands (repl, console) require a local TTY and should be fed piped stdin in scripts. --high-mem machine shapes require a Colab Pro or Pro+ entitlement and are ignored by L4 and TPU runtimes. Session metadata and tokens live under ~/.config/colab-cli/ and can be relocated with --config. Usage is subject to Colab's terms of service and Google's privacy policy Legal & Privacy. The code is Apache-2.0.
HotRepo's take
The project recorded 2,055 stars and 294 forks, with a Python daily list position of 5 and 139 stars gained on 2026-11-08. That is a single snapshot, so it supports noting the project's presence on the Python daily list that day but not a broader trend. The repository only offers one observed list record, and no all-language daily rank is recorded.
Written by AI from the project's README, updated . The project's own docs are the source of truth.