# Colab CLI

> A command-line interface for Google Colab that provisions CPU, GPU, and TPU runtimes, executes local code, manages remote files, and orchestrates automated cloud pipelines from the terminal.

Colab CLI is an open-source command-line tool published by the `googlecolab` GitHub organization under the Apache License 2.0. It brings Google Colab's cloud compute capabilities — including GPU and TPU runtimes — directly into terminal workflows, enabling headless automation and AI agent integrations without requiring an open browser tab. The project is written in Python and supports Linux and macOS only; Windows is explicitly not supported at this time.

## What It Is

Colab CLI is a terminal-first interface for Google Colab that lets developers provision, control, and automate cloud VM runtimes from the command line. Rather than interacting with Colab through a browser notebook, users can spin up accelerator-backed VMs, run local Python scripts or Jupyter notebooks against those VMs, transfer files, and tear down resources — all through a structured set of `colab` subcommands. The project also ships a companion [Colab MCP Server](https://github.com/googlecolab/colab-mcp) for in-notebook, interactive agent-assisted coding workflows.

## Core Capabilities

The CLI is organized into four functional areas:

- **Session management:** `colab new`, `colab sessions`, `colab status`, `colab stop`, and `colab url` handle the full lifecycle of VM runtimes, including CPU, GPU (T4, L4, G4, H100, A100), and TPU (v5e1, v6e1) variants.
- **Code execution:** `colab exec` runs local `.py` files, `.ipynb` notebooks, or piped stdin against the remote kernel. `colab repl` opens an interactive Python REPL; `colab console` connects a raw TTY shell via tmux.
- **File operations:** `colab upload`, `colab download`, `colab ls`, `colab rm`, and `colab edit` manage the remote VM filesystem using the Jupyter Contents API.
- **Automation utilities:** `colab auth` handles GCP credential forwarding, `colab drivemount` mounts Google Drive, and `colab install` uses `uv` (with pip fallback) for fast dependency management.

## Ephemeral Job Runner and Keep-Alive

Two design choices stand out for automation use cases. The `colab run` command provisions a fresh VM, executes a local script with forwarded arguments, retrieves output files, and automatically tears down the runtime in a single command — making it suitable for CI/CD pipelines and scheduled ML training jobs. A built-in background daemon provides automatic keep-alive, preventing idle VM termination without requiring an open browser session. Scripts can also use a shebang line (`#!/usr/bin/env -S colab run --gpu L4`) to run directly on remote accelerators as executable files.

## Setup Path

Installation is straightforward via `uv tool install google-colab-cli` (recommended) or `pip install google-colab-cli`. Session tokens and metadata are stored at `~/.config/colab-cli/sessions.json`; authentication supports both OAuth2 and Application Default Credentials (ADC). The repository includes deep-dive documentation covering session management architecture, execution design, file management, authentication providers, and the ephemeral job runner design, as well as eleven demo walkthroughs.

## Current Status

The repository was created in April 2026 and last pushed in June 2026, indicating active early development. It is hosted under the official `googlecolab` GitHub organization and licensed Apache-2.0. The README notes that platform support is currently limited to Linux and macOS, and links to a sibling project (Colab MCP Server) for users who prefer interactive, agent-assisted notebook workflows.

## Features
- Provision CPU, GPU (T4, L4, G4, H100, A100), and TPU (v5e1, v6e1) runtimes
- Run local Python scripts, Jupyter Notebooks, or piped stdin on remote VMs
- Ephemeral job runner: provision, execute, retrieve outputs, and teardown in one command
- Automatic keep-alive daemon prevents idle VM termination
- Interactive Python REPL and raw TTY console shell
- File upload, download, list, delete, and in-place edit on remote VM filesystem
- Google Drive mounting
- GCP credential authentication for BigQuery, GCS, etc.
- High-performance package installation via uv with pip fallback
- Session history export to .ipynb, .md, .txt, or .jsonl
- Shebang execution support for running scripts directly on remote accelerators
- Multi-session management with named sessions

## Integrations
Google Colab, Google Drive, Google Cloud Platform (GCP), BigQuery, Google Cloud Storage (GCS), Jupyter Notebooks, uv package manager, pip, tmux

## Platforms
WINDOWS, MACOS, LINUX, API, CLI

## Pricing
Open Source

## Links
- Website: https://github.com/googlecolab/google-colab-cli
- Documentation: https://github.com/googlecolab/google-colab-cli/tree/main/docs
- Repository: https://github.com/googlecolab/google-colab-cli
- EveryDev.ai: https://www.everydev.ai/tools/colab-cli
