Skip to content
/ code Public

AI coding agent for the terminal, built in Rust

License

Notifications You must be signed in to change notification settings

nyzhi-com/code

nyzhi

Docs  ·  Install  ·  Quick Start  ·  Releases  ·  Contributing


Give it a task — it reads your code, writes changes, runs your tests, and verifies the result.
All inside a rich terminal UI or a single non-interactive command.
Built in Rust. Wired to every major LLM.


Install

curl -fsSL https://get.nyzhi.com | sh

Cargo

cargo install nyzhi

npm

npm install -g nyzhi

Source

git clone https://github.com/nyzhi-com/code
cd code && cargo build --release
Self-update & rollback
nyz update                   # check and apply
nyz update --rollback latest # revert to previous
nyz uninstall                # remove everything

Updates run automatically every 4h. Every update backs up the current binary, verifies the new one with SHA256, and auto-rolls back on failure.


Quick Start

nyz                                # launch the TUI
nyz login openai                   # connect a provider (OAuth)
nyz run "explain this codebase"    # one-shot, no TUI
nyz --continue                     # pick up where you left off

What makes nyzhi different

Every model, one binary

OpenAI, Anthropic, Gemini, OpenRouter, DeepSeek, Groq — and any OpenAI-compatible endpoint. Switch mid-session. Route prompts to the right cost tier automatically.

Autonomous execution

Autopilot — five-phase autonomous pipeline: expand, plan, execute, QA, validate. Teams — spawn coordinated sub-agents with mailbox messaging and task boards. Planning — planner/critic loops with persistent, replayable plans.

MCP native

Drop a .mcp.json in your project root. Same format as Claude Code and Codex. stdio and HTTP transports.

50+ tools, zero runtime deps

File ops, git, grep, glob, bash, sub-agents, LSP, AST search, browser automation, PR workflows, semantic search, debug instrumentation — all with a permission model you control.

A TUI worth living in

8 themes. 14 accent colors. Syntax highlighting. Tab completion. Persistent history with reverse search. Multi-line editing. Session export. Desktop notifications.

Your code stays yours

Every file change is tracked. /undo reverts anything. Trust modes gate what runs without approval. The agent learns your patterns via /learn.


Providers

Provider Auth Models
OpenAI API key / OAuth GPT-5.3 Codex, GPT-5.2, o3, o4-mini
Anthropic API key / OAuth Claude Opus 4.6, Sonnet 4.6, Haiku 4.5
Gemini API key / OAuth Gemini 3.1 Pro, 3 Flash, 2.5 Flash
OpenRouter API key Any model on the platform
DeepSeek API key DeepSeek Chat
Groq API key Groq-hosted models
Custom API key Any OpenAI-compatible endpoint

Multi-account per provider. Automatic token refresh. Rate-limit rotation across accounts.


Agent Capabilities

Autopilot /autopilot <idea> — expand → plan → execute → QA → validate
Teams /team 3 <task> — coordinated sub-agents with mailbox + task board
Planning plan: prefix — planner/critic loop, persistent plans
Routing Auto-select model tier by prompt complexity
Verification Auto-detect build/test/lint for Rust, Node, Go, Python
Skills /learn — extract reusable patterns from sessions
Memory Persistent notepad across sessions with topic-based recall
Hooks Run formatters/linters/tests after edits or agent turns

Tools

Files
read write edit multi_edit apply_patch glob grep list_dir directory_tree file_info delete_file move_file copy_file create_dir

Shell
bash — live streaming output

Git
git_status git_diff git_log git_show git_branch git_commit git_checkout

Agent
task todo_write todo_read notepad_write notepad_read update_plan think load_skill tool_search

Analysis
verify lsp_diagnostics ast_search lsp_goto_definition lsp_find_references lsp_hover

Web & Browser
web_fetch web_search browser_open browser_screenshot browser_evaluate

Teams
team_create team_delete send_message task_create task_update task_list team_list read_inbox

PR & Search & Debug
create_pr review_pr semantic_search fuzzy_find instrument remove_instrumentation tail_file batch_apply


CLI

nyz                              interactive TUI
nyz run "<prompt>"               one-shot (non-interactive)
nyz run -i img.png "<prompt>"    with image
nyz -c / --continue              resume last session
nyz -s / --session "<query>"     resume by title or ID
nyz -p openai -m gpt-5.2        provider and model flags
All commands
Command
nyz login <provider> OAuth login
nyz logout <provider> Remove stored token
nyz whoami Auth status for all providers
nyz config Show merged config
nyz init Create .nyzhi/ in current project
nyz mcp add|list|remove Manage MCP servers
nyz sessions [query] List / search sessions
nyz export <id> [-o path] Export session to markdown
nyz stats Session statistics
nyz cost [daily|weekly|monthly] Cost report
nyz replay <id> Replay session events
nyz deepinit Generate AGENTS.md from project analysis
nyz skills List learned skills
nyz teams list|show|delete Team management
nyz ci-fix Auto-fix CI failures
nyz update [--rollback] Self-update or rollback
nyz uninstall Uninstall nyzhi

Configuration

Three layers, merged in order: global ~/.config/nyzhi/config.tomlproject .nyzhi/config.tomllocal .nyzhi/config.local.toml

[provider]
default = "anthropic"

[provider.anthropic]
model = "claude-sonnet-4-20250514"

[tui]
theme = "nyzhi-dark"
accent = "copper"

[agent]
max_steps = 100
auto_compact_threshold = 0.8

[agent.trust]
mode = "limited"
allow_tools = ["edit", "write"]
allow_paths = ["src/"]

[[agent.hooks]]
event = "after_edit"
command = "cargo fmt -- {file}"
pattern = "*.rs"
File Purpose
AGENTS.md or .nyzhi/rules.md Project rules the agent follows
.nyzhi/commands/ Custom slash commands
.mcp.json MCP server definitions

Architecture

Six crates, zero cycles, one binary.

                      nyzhi (cli)
                     ╱     │     ╲
              nyzhi-tui  nyzhi-core  nyzhi-provider
                    │    ╱         ╲      │
                nyzhi-auth      nyzhi-config
Crate
nyzhi Binary entry point. CLI parsing, command dispatch, tool and MCP assembly.
nyzhi-core Agent loop, 50+ tools, sessions, workspace, MCP, planning, teams, hooks, skills, verification, analytics.
nyzhi-provider LLM abstraction. OpenAI, Anthropic, Gemini with streaming and thinking support.
nyzhi-tui Terminal UI. ratatui, themes, syntax highlighting, completion, history, export.
nyzhi-auth OAuth2 PKCE + device code, API keys, token store, multi-account rotation.
nyzhi-config Config loading and merging across global, project, and local layers.

Data

What Where Touched by updates?
Binary ~/.nyzhi/bin/nyz Yes (backed up first)
Config ~/.config/nyzhi/ Never
Sessions ~/.local/share/nyzhi/sessions/ Never
Tokens ~/.local/share/nyzhi/auth.json Never
Analytics ~/.local/share/nyzhi/analytics.jsonl Never
Memory ~/.local/share/nyzhi/MEMORY.md Never
Backups ~/.nyzhi/backups/ Pruned to 3

Docs

Full documentation at code.nyzhi.com/docs — or browse the docs/ directory:

CoreArchitecture · Configuration · Authentication

FeaturesProviders · Tools · TUI · MCP · Sessions · Teams · Autopilot

WorkflowHooks · Commands · Skills · Verification · Routing · Notifications · Memory

SystemSelf-Update · Building · Releasing



Contributing · Code of Conduct · Support · Security · Issues

GPL-3.0-or-later

About

AI coding agent for the terminal, built in Rust

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Sponsor this project

Packages

No packages published

Languages