colab-operator
Skill by googlecolab
Operates Google Colab environments through the colab CLI. It creates GPU and TPU sessions, runs Python and shell on remote VMs, syncs files, and exports session history for developers and AI agents.
Install colab-operator
Built from the published package, never by AI.
git clone --depth 1 https://github.com/googlecolab/google-colab-cli /tmp/google-colab-cli && mkdir -p ~/.claude/skills && cp -r /tmp/google-colab-cli/skills/colab-operator ~/.claude/skills/colab-operatorRun in your terminal. Claude Code loads skills from ~/.claude/skills automatically.
git clone --depth 1 https://github.com/googlecolab/google-colab-cli /tmp/google-colab-cli && mkdir -p ~/.gemini/antigravity-cli/skills && cp -r /tmp/google-colab-cli/skills/colab-operator ~/.gemini/antigravity-cli/skills/colab-operatorAntigravity CLI loads skills from ~/.gemini/antigravity-cli/skills, or .agents/skills for one project.
Skills can run scripts on your machine. Some need an API key: check the README.
About
The colab-operator skill lets an AI assistant work with Google Colab environments through the colab CLI. It can create CPU, GPU or TPU sessions, run Python and shell commands on the remote VM, sync files, and stop sessions when finished. Kernel state persists across separate exec calls in the same session, so variables and imports carry over until the session is stopped or the kernel is restarted.
The skill also covers environment setup such as installing packages, configuring authentication, and mounting Drive. It supports one-shot jobs through colab run and exporting session history as a notebook. It is aimed at agents and developers who need on-demand Colab compute from a terminal. The source includes guidance on authentication scopes, error recovery, and stopping sessions to avoid idle compute charges.
Written from the project's SKILL.md and checked against it.
What it can do
- Create sessionsProvisions CPU sessions, or GPU and TPU sessions with the --gpu and --tpu flags.
- Run PythonRuns a local script on the remote Colab VM with colab exec, or pipes code into it.
- Run shellRuns batch shell commands on the VM through colab console.
- Run notebooksExecutes each code cell of a notebook and writes results to an output notebook.
- One-shot jobsUses colab run to provision a VM, run a script, and tear the VM down.
- Install packagesInstalls Python packages on the VM with colab install, including from requirements files.
- Sync filesUploads and downloads files between local and remote paths with colab upload and download.
- Check status and logsShows session hardware, IDLE or BUSY state, and recent structured events from colab log.
- Export historyExports a session as a notebook, Markdown, text, or JSONL file.
- Stop sessionsReleases the VM with colab stop when work is finished to avoid idle compute use.
What you need
- Python with uv or pip to install google-colab-cli
- gcloud CLI for Application Default Credentials setup
- Google account with Colab access
- Quota or entitlement for GPU or TPU accelerators
Try asking
- Start a T4 GPU Colab session named train and run my script on it
- Install pandas and scikit-learn on my Colab session called analysis
- Export my Colab session history as a notebook named summary.ipynb
Good to know
- Accelerator availability is tier-gated, so most accounts can only get CPU.
- Interactive commands like repl, console, auth and drivemount cannot be run by an agent.
- OAuth2 login requires a browser consent step, so ADC is preferred for agents.
- Idle VMs keep consuming compute units until stopped.
Security check
ANo download-and-run commands, hidden instructions or signs of sending keys out were found.
Checked automatically: skills/colab-operator/SKILL.md. This looks for known risky patterns and is not a full audit. How grades work
Inside the skill
-
SKILL.md9 KB
Alternatives to colab-operator
All alternatives →Runs a 7-stage workflow for auditing, cleaning up and reviewing GitHub repositories, plus competitor analysis. Written for developers who want a repo checked for secrets, junk files and documentation gaps.
Teaches an AI assistant to build, debug and explain Gradio web UIs and ML demos in Python. It covers the core API, components, event listeners, layouts and the MCP server option. Aimed at Python developers who work with Gradio.
Recommends menus, buttons, toolbars and disclosure controls for Apple platforms using Human Interface Guidelines conventions. Built for developers and designers making iOS, iPadOS, macOS or visionOS interfaces. Checks existing project design context before asking questions.
Creates production-ready FastAPI project structures with async patterns, dependency injection, and error handling. It is for developers starting new FastAPI applications or backend API projects.
Analyzes Android apps to find user workflows to expose as AppFunctions, so AI agents and system shortcuts can run them without opening the app UI. Generates Kotlin code and refines KDoc for Android developers.
Creates, edits, validates and runs Agent QA tests, suites and hooks through MCP or CLI. It keeps canonical IDs and schema contracts intact, for developers and QA teams using Agent QA.
Compare with openclaw-github-repo-commander, gradio or hig-components-menus
colab-operator: common questions
Does kernel state persist between Colab commands?
Yes. Each colab exec or repl call reattaches to the same kernel, so imports, variables and functions survive until colab stop or colab restart-kernel is run.
Why do I get a 401 or 403 error from the colab CLI?
The source says this is usually missing credentials or scopes. It advises running colab whoami to check them and re-minting ADC with the required scopes, not running colab auth.
What does colab run do differently from colab exec?
colab run combines new, exec and stop in one command, provisions a fresh VM, and tears it down afterward unless --keep is passed. Exit codes from the script propagate.
How do I install colab-operator?
Run the command above to copy the skill into ~/.claude/skills/. Claude Code picks it up automatically.
Is colab-operator free?
The code is published under the Apache-2.0 licence. The service it connects to may have its own pricing.
Is colab-operator safe to use?
It scores 85 of 100. Grades: maintenance A, licence A, quality A. Security check: grade A, no risky patterns found in the files checked. Review the code before you install. How grades work.
What are alternatives to colab-operator?
Similar skills: openclaw-github-repo-commander, gradio, hig-components-menus, fastapi-templates.
