Metadata-Version: 2.4
Name: colab-dev
Version: 0.1.1
Summary: Turn Google Colab runtimes into seamless, local-feeling dev environments for humans and coding agents.
Keywords: colab,google-colab,gpu,tpu,ssh,dev,ai-agents
Author: Boffee
License-Expression: Apache-2.0
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development
Requires-Dist: google-colab-cli>=0.8.0
Requires-Python: >=3.12
Project-URL: Homepage, https://github.com/Boffee/colab-dev
Project-URL: Repository, https://github.com/Boffee/colab-dev.git
Project-URL: Issues, https://github.com/Boffee/colab-dev/issues
Description-Content-Type: text/markdown

# colab-dev

[![PyPI](https://img.shields.io/pypi/v/colab-dev)](https://pypi.org/project/colab-dev/)
[![Python 3.12+](https://img.shields.io/pypi/pyversions/colab-dev)](https://pypi.org/project/colab-dev/)
[![CI](https://github.com/Boffee/colab-dev/actions/workflows/ci.yml/badge.svg)](https://github.com/Boffee/colab-dev/actions/workflows/ci.yml)
[![License: Apache-2.0](https://img.shields.io/badge/license-Apache--2.0-blue.svg)](LICENSE)

**Run any command from your laptop on a Google Colab GPU, TPU, or CPU.**

Edit code locally in your own editor. Prefix any command with `colab-dev <target>` and it automatically syncs your project, installs dependencies, runs the command on Colab, and streams output straight back.

## Get Started (30 seconds)

Requires macOS or Linux, Python 3.12+, and a Google Colab account.

```bash
uv tool install colab-dev        # or: pip install colab-dev
colab-dev setup                  # one-time Google Colab sign-in & SSH key
colab-dev t4 python train.py     # syncs your repo, installs deps, runs on a T4 GPU
```

## Everyday Commands

```bash
# Run anything on a GPU, TPU, or CPU
colab-dev t4 pytest
colab-dev a100 python train.py --epochs 10
colab-dev t4 nvidia-smi

# Run multiple GPUs at once by adding a :name
colab-dev t4:1 python eval.py --split val
colab-dev t4:2 python eval.py --split test

# Open an interactive terminal on Colab
colab-dev shell t4

# Download files created on Colab back to your laptop
colab-dev pull t4 outputs/metrics.json

# See running runtimes & compute balance, or stop them
colab-dev ls
colab-dev stop t4
colab-dev stop --all
```

**Available targets:** `cpu`, `t4`, `l4`, `g4`, `a100`, `h100`, `v5e1`, `v6e1` (high-RAM by default; pass `--std-mem` for standard RAM).

## Handy Flags

Put `colab-dev` flags **before** your command:

```bash
# Auto-stop the GPU if idle for 30 minutes (never kills running jobs)
colab-dev a100 --idle 30m python train.py

# Kill a single command if it hangs for more than 10 minutes
colab-dev t4 --timeout 10m python script.py

# Pass env vars, extra folders, or pull a file when done
colab-dev t4 --env HF_TOKEN=hf_xxx --add ../shared-lib --pull out/result.json python eval.py
```

### Save settings on a runtime

Don't want to repeat flags every time? Save them on the runtime (they stay until `colab-dev stop`):

```bash
colab-dev config t4 --idle 30m --add ../shared-lib --env HF_TOKEN=hf_xxx
colab-dev config t4              # view saved settings (secret values are hidden)
```

Or save defaults for a project in `pyproject.toml` (team defaults) or `.colab-dev.local.toml` (personal/secret overrides, gitignored):

```toml
# .colab-dev.local.toml
idle = "30m"
add = ["../shared-lib"]

[env]
HF_TOKEN = "hf_xxx"
```

## Using with AI Coding Agents

Give Antigravity, Claude Code, or Codex instructions for `colab-dev` in one command:

```bash
colab-dev skill install
```

## Good to Know

- **Fast (~150ms):** Reuses one connection and only uploads changed files (respecting `.gitignore`).
- **One-way sync:** Your laptop is always the source of truth (`local -> /content/work/<repo>`). Use `colab-dev pull` to copy remote outputs back.
- **Auto Python env:** Installs `pyproject.toml` / `requirements.txt` once and only re-runs when dependencies change (`--no-env` to skip, `--reinstall` to force).
- **Safe concurrency:** You can run multiple `colab-dev t4 ...` commands at the same time on the same GPU.
- **Clean & reversible:** Never edits `~/.ssh/config` unless you opt in (`colab-dev ssh-config install`).

## Uninstall

```bash
colab-dev clean --all
uv tool uninstall colab-dev      # or: pip uninstall colab-dev
```

## License

[Apache-2.0](LICENSE)
