rust-code
rust-code is a terminal coding agent written in Rust.
It combines a Ratatui-based TUI, typed tool execution, fuzzy navigation, session history, and a BAML-driven agent loop so you can work on a codebase without leaving the terminal.
Install
From crates.io:
Linux release binary:
|
macOS:
If you prefer local builds on macOS:
Run it:
Headless mode:
Features
- Interactive terminal chat UI built with
ratatuiandcrossterm - Typed agent loop powered by BAML
- File read/write/edit tools
- Shell command execution
- Git status, diff, add, and commit tools
- Fuzzy file search with
nucleo - Session persistence in
.rust-code/session_*.jsonl - Session search and restore
- Git diff and git history side channels
- Project symbol search
- Background task /
tmuxsession viewer - Open-in-editor actions through
$EDITOR
Provider Setup
The current build is configured for these LLM backends:
- Google AI via
GEMINI_API_KEY - Vertex AI via
GOOGLE_CLOUD_PROJECT - OpenRouter via
OPENROUTER_API_KEY
At least one of them must be configured in your environment before launching rust-code.
Examples:
Notes:
rust-codecurrently initializes BAML clients that are defined incrates/rc-baml/baml_src/clients.baml.- The checked-in config currently includes Gemini, Vertex AI, and OpenRouter.
BAML_LOGis suppressed automatically by the app so the TUI stays clean.
Quick Start
cdinto the repository you want to work on.- Create an
AGENTS.mdfile in that repo. - Export one provider credential.
- Launch
rust-code. - Start with a direct task like
review this repo,fix the failing test, oradd a new command.
AGENTS.md
rust-code works best when the target repository contains an AGENTS.md file with project-specific instructions.
Recommended contents:
- stack and framework versions
- architecture constraints
- code style rules
- test/build commands
- migration or release rules
- prompt or tool-schema rules
- file locations that must be edited first
Example:
- --
- ---
- --
The more concrete this file is, the better the agent performs.
Sessions and Local State
rust-code stores local state in .rust-code/:
.rust-code/context/for persistent agent guidance files.rust-code/session_*.jsonlfor chat/session history
Use --resume to reopen the latest saved session:
TUI Shortcuts
Main shortcuts currently exposed by the UI:
Enter: send messageCtrl+P: file searchCtrl+H: session historyCtrl+G: refresh git sidebarTab: focus sidebarCtrl+C: quitF1: diff channelF2: git historyF3: filesF4: sessionsF5: refreshF6: symbolsF7: background tasksF10: channelsF12: quit
Inside side panels:
Esc: close panelCtrl+I: insert selected item into the promptCtrl+O: open or attach, where supported
Background tasks are backed by tmux, so having tmux installed is useful if you want long-running task inspection from the UI.
CLI
Usage: rust-code [OPTIONS]
Options:
-p, --prompt <PROMPT>
-r, --resume
-h, --help
-V, --version
Development
This repository now publishes a single crate, rust-code, but it still keeps a logical split in the source tree for the agent loop, tools, and generated BAML client code.
If you change BAML source files, edit them in:
crates/rc-baml/baml_src/
Then regenerate:
Useful commands:
Status
The crate is published on crates.io:
Linux release artifacts are published by GitHub Actions when you push a tag matching v*, for example v0.1.1.