quincode is a Rust terminal coding agent with:
- Interactive TUI mode (
quincode) - One-shot mode (
quincode run "<prompt>") - Config doctor (
quincode config doctor) - OpenAI-compatible and Anthropic-compatible API support
- Shell tool execution with policy + approval controls
Implemented in this repo today:
- Local/project config layering from
~/.quincode/config.tomland<repo>/.quincode/config.toml - Interactive terminal UI with slash commands, command history, multiline input
shell_commandtool loop with timeout, allow/block rules, and approval modes- Provider adapters for OpenAI-style and Anthropic-style APIs
Not yet implemented from the original plan:
- Session persistence and transcript export commands
- Extra tools (
read_file,write_file,list_files,search_text)
Prerequisites:
- Rust toolchain (stable)
Commands:
# Build
cargo build
# Run interactive mode
cargo run
# Run one-shot mode
cargo run -- run "inspect this repository"
# Validate config + endpoint/model visibility
cargo run -- config doctor
# Run tests
cargo testquincode
quincode run "<prompt>"
quincode config doctorInput and navigation:
Enter: submitShift+Enter: newlineLeft/Right: move cursorUp/Down: command history (or slash suggestion selection when input starts with/)PageUp/PageDown: transcript scrollEsc: quitCtrl+Ctwice: quit confirmationCtrl+O: expand last truncated tool output
Slash commands:
/help/expand/model/model <id>/quit
Config file precedence:
~/.quincode/config.toml<repo>/.quincode/config.toml(overrides global)
Current schema:
[api]
compatibility_mode = "openai" # openai | anthropic
base_url = "http://localhost:1234/v1"
model = "qwen2.5-coder-32b-instruct"
api_key = ""
[agent]
max_steps = 4
approval_mode = "never" # never | on-request | always
[tools]
shell_enabled = true
shell_timeout_secs = 120
allowed_commands = []
blocked_commands = ["rm -rf /", "mkfs", "shutdown"]Notes:
.quincode/config.tomlis gitignored for local secrets and endpoint settings.allowed_commands = []means no allowlist restriction (only blocklist applies).- In
on-requestmode, risky commands require confirmation.
Provider setup guides:
60dd977: hardened terminal resize and wrapping behavior794ef39: cleaner inline prompt collapse on quit808c878: clear inline viewport on quita98848d: up/down command history in input1930090: inject cwd + localAGENTS.mdinto runtime system prompt
src/
main.rs # CLI entrypoint + command dispatch
cli.rs # clap command definitions
config.rs # config schema + layering
agent.rs # agent loop + tool orchestration
prompt.rs # system prompt + local AGENTS.md injection
llm/mod.rs # provider adapters (openai/anthropic)
tools/shell.rs # shell tool runner
ui/ # ratatui app/input/formatting/terminal loop