Skip to content

DEVtheOPS/quincode

quincode

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

Current Status

Implemented in this repo today:

  • Local/project config layering from ~/.quincode/config.toml and <repo>/.quincode/config.toml
  • Interactive terminal UI with slash commands, command history, multiline input
  • shell_command tool 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)

Build and Run

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 test

CLI Commands

quincode
quincode run "<prompt>"
quincode config doctor

Interactive Controls

Input and navigation:

  • Enter: submit
  • Shift+Enter: newline
  • Left/Right: move cursor
  • Up/Down: command history (or slash suggestion selection when input starts with /)
  • PageUp/PageDown: transcript scroll
  • Esc: quit
  • Ctrl+C twice: quit confirmation
  • Ctrl+O: expand last truncated tool output

Slash commands:

  • /help
  • /expand
  • /model
  • /model <id>
  • /quit

Configuration

Config file precedence:

  1. ~/.quincode/config.toml
  2. <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.toml is gitignored for local secrets and endpoint settings.
  • allowed_commands = [] means no allowlist restriction (only blocklist applies).
  • In on-request mode, risky commands require confirmation.

Provider setup guides:

Recent Changes (from git log)

  • 60dd977: hardened terminal resize and wrapping behavior
  • 794ef39: cleaner inline prompt collapse on quit
  • 808c878: clear inline viewport on quit
  • a98848d: up/down command history in input
  • 1930090: inject cwd + local AGENTS.md into runtime system prompt

Project Layout

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

About

shh

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages