Skip to content

Repository files navigation

RustCode logo

RustCode

An agent harness (or sum), made in Rust

License: Apache 2.0 Rust 1.85+ macOS, Linux, Windows

rustcode.lhagfoss.com · hello@lhagfoss.com

RustCode running in the terminal

RustCode for macOS   RustCode for iPhone showing an active remote session   RustCode for iPhone showing the sessions list

rustcode is a lightweight terminal (TUI) coding agent. It started as a way to test Apple's on-device Foundation Models and turned into a much deeper project. It works with Ollama, any OpenAI-compatible API, and your existing ChatGPT, GitHub Copilot or Claude subscription.

Install

macOS and Linux

curl -fsSL https://rustcode.lhagfoss.com/install.sh | bash

Windows (PowerShell)

irm https://rustcode.lhagfoss.com/install.ps1 | iex

Homebrew (macOS)

brew tap lhagfoss/tap
brew trust lhagfoss/tap
brew install rustcode

From source

git clone https://github.com/lhagfoss/rustcode.git
cd rustcode
cargo install --path rustcode/tui

Prebuilt binaries cover Linux x86_64 and ARM64, macOS Apple Silicon and Windows x86_64. Update with rustcode --update, /update inside the TUI, or brew upgrade rustcode. Platform details, the desktop app and source builds are in the install guide.

Quick start

rustcode                                  # open the TUI in the current project
rustcode --prompt "run the tests"         # one prompt, no TUI
rustcode --resume                         # pick up the last session here
rustcode --acp                            # Agent Client Protocol server over stdio
rustcode doctor                           # check config, binaries and skills

Connect a provider from inside the TUI:

Command Connects
/login ChatGPT plan sign-in or an API-key provider
/login github-copilot GitHub Copilot (setup)
/login claude A Claude subscription through the local Claude Code CLI
/accounts, /account, /logout Manage saved accounts
/model Switch model profile

See provider authentication for every option.

What it does

  • Any model — Ollama, OpenAI-compatible endpoints, the Responses API and subscription logins, with per-model profiles in one config.toml.
  • Tools with guardrails — file edits, shell commands and search, with one-time or reusable approvals and optional OS sandboxing on macOS and Linux (sandbox modes).
  • Background work — detach long commands and get the result delivered when they finish (background tasks).
  • Subagents — spawn, message, wait on and cancel child agents with isolated context (delegation).
  • MCP and skills — connect MCP servers and drop Markdown skills into ~/.agents/skills or a project (configuration).
  • Editor integration — runs headless as an ACP server (ACP).
  • Measured, not guessed — /perf shows where each turn spent its time (performance).

Configuration

Settings live in ~/.config/rustcode/config.toml (%APPDATA%\rustcode on Windows). Run rustcode init for a project-local override; precedence is:

CLI overrides > nearest project config > global config > built-in defaults

A model profile is a few lines:

[[models]]
name = "my-model"
url = "https://example.invalid/v1/chat/completions"
model = "my-model"
env_key = "MY_API_KEY"

Everything else — skills, MCP servers, prompt templates, config sync, scrollback and motion settings — is in the configuration guide.

Documentation

Topic Guide
Install, update, desktop app docs/install.md · macOS release signing
Configuration, skills, MCP, sync docs/configuration.md
Providers and sign-in docs/provider-auth.md · GitHub Copilot
Approvals and sandbox modes docs/sandbox.md · shell approvals
Slash commands and the TUI docs/command-panels.md · TUI notes
Background tasks docs/background-tasks.md
Subagents docs/multi-agent.md
ACP server docs/acp.md
Remote sessions (/remote, iPhone) docs/remote.md
Remote frontends (experimental) docs/mobile.md · frontends
Thinking routing docs/thinking-router.md
Performance and traces docs/performance.md · stream traces · build benchmark
Architecture docs/architecture.md
Discord Rich Presence docs/discord-rich-presence.md

Apple Foundation Models

Running rustcode on Apple's on-device model needs macOS 27 and Xcode 27. It is not recommended for real work: the system model has roughly a 2k context window.

Contributing

Issues and PRs are welcome. See CONTRIBUTING.md for how to build, test and name your PR, and SECURITY.md for reporting security problems.

License

Licensed under the Apache License, Version 2.0.

Made with Rust by goat (me) and models inside the RustCode harness.