harness
Install
curl -fsSL /install.sh | sh
Linux (x86_64) and macOS 15.4 or later (Apple Silicon or Intel). Installs one binary to
~/.local/bin, no sudo. Read the script before you run it.
On Linux the sandbox needs bubblewrap: sudo apt install bubblewrap or your
distribution's package.
To update, run the install command again. To uninstall, delete ~/.local/bin/harness.
No key is needed to start: run harness run, then type /login.
Two ways to start
Free models
Run harness run and type /login (or harness login in the shell). Open
the link it prints, check the code matches, and sign in with Google.
You get mega:flash (fast and cheap) and mega:full (smartest, slower), free up to a
daily allowance that resets at 00:00 UTC. mega:full uses it about 2.7× as fast.
harness logout signs out. Privacy.
Your own keys
Add these to your shell's startup file (~/.zshrc or ~/.bashrc), then open a new
terminal.
1. TypeSafe
export TYPESAFE_API_KEY=your-key
Needed for auto mode with your own keys. Signed in, the judge runs through the free service. TypeSafe judges each command before auto mode runs it. Get a key at typesafe.ai.
2. Your model provider
export ANTHROPIC_API_KEY=your-key # or any variable below
| Provider | Variable |
|---|---|
| Anthropic | ANTHROPIC_API_KEY |
| OpenAI | OPENAI_API_KEY |
| Gemini | GEMINI_API_KEY |
| OpenRouter | OPENROUTER_API_KEY |
| Together | TOGETHER_API_KEY |
| DeepSeek | DEEPSEEK_API_KEY |
| Z.AI | ZAI_API_KEY |
| xAI | XAI_API_KEY |
| Ollama, LM Studio (local) | no key |
Start
harness run # signed in: mega:full; else your first provider with a key harness run --model gemini:gemini-3.8-flash # any provider: --model provider:model
To start on another model every time, put it in ~/.config/harness/config.toml:
model = "gemini:gemini-3.8-flash"
Rust SDK
Run harness sessions from your own program and give the model tools you wrote.
cargo add megacode-agent-sdk
Guide · crates.io · API reference
Docs
The docs cover modes, the sandbox, /undo, shortcuts and every setting.