百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
N

native-cli-ai

> AI 编程
开源

一个原生的 Rust CLI,用于跨项目编排 AI 代理,具有持久会话、工作树和本地优先控制。

182 stars0 点赞0 次浏览
访问官网GitHub

工具介绍

一个原生的 Rust CLI,用于跨项目编排 AI 代理,具有持久会话、工作树和本地优先控制。

nca

Rust-native coding agent. Single binary. Terminal-first.

v0.4 — dedicated TUI crate, unified product home, live busy activity

Install · What's New · Quick Start · Commands · Interactive UX · Providers · Funding


nca is a Rust-native coding CLI that ships as a single binary. It is built for local-first, terminal-first workflows: interactive TUI, line REPL, one-shot runs, detached sessions, attach/status/logs, JSON and NDJSON output, Unix-socket IPC, worktree-isolated subagents, and autonomous research helpers.

It is meant for people who like their AI tooling close to the terminal: fast to start, easy to script, and capable of running real session workflows without dragging in a browser shell.

The product surface is the CLI. No desktop wrapper, no Electron, no browser in the default path.

What's New in 0.4

  • Dedicated nca-tui crate — full-screen transcript, overlays, sidebar, and REPL live in their own crate; nca-cli stays the thin entrypoint.
  • Unified product home — sessions, memory, and CLI index land under $NCA_HOME / $XDG_DATA_HOME/ncacli / ~/.local/share/ncacli (legacy ~/.nca still migrates).
  • Live busy activity — status bar and transcript footer show thinking / streaming / tool path with elapsed time so long model waits never look stuck.
  • Soft provider retries — empty-response retries stay in thinking state instead of flipping to a red error mid-turn.
  • Tool path previews — in-flight write_file / edit_file / bash calls show the path or command one-liner.
  • Multi-OS releases — GitHub Releases build Linux, macOS, and Windows (x86_64 + ARM where available).

What It Does

  • Runs coding tasks in an interactive TUI or a line-oriented REPL.
  • Keeps slash commands, the command palette, and /help in sync via one registry (palette Enter runs the command).
  • Supports one-shot runs and detached background sessions.
  • Persists session state and event logs under the current workspace.
  • Exposes machine-readable JSON and NDJSON for automation.
  • Spawns child agents with explicit parent/child lineage and optional git worktrees.
  • Uses MiniMax by default, with OpenAI, Anthropic, OpenRouter, and custom endpoint support.
  • Loads built-in tools plus optional MCP tools from config.
  • Sends native multimodal (text + image) messages to MiniMax and other vision-capable models.
  • Auto-summarizes long conversations to prevent token overflow.
  • Discovers skills from AGENTS.md sections, filesystem directories, and user-level skill directories.
  • Builds a cached CLI index for workspace-aware agent context.

Why People Reach For It

  • You want a coding CLI that feels quick and stays out of the way.
  • You want sessions, event logs, and resumable work instead of a throwaway prompt box.
  • You want child agents that can branch off cleanly with lineage and optional git worktrees.
  • You want a CLI that still works well when another system is driving it through JSON, NDJSON, and IPC.
  • You want intelligent context management that auto-summarizes without losing important context.

Common Use Cases

Use case Why nca fits
Solo coding in the terminal Start with nca, use the TUI, switch agent profiles, review diffs, and keep everything in one terminal-native flow.
Quick one-shot work nca run --prompt ... gives you a focused foreground task without opening a longer session than you need.
Background analysis nca spawn --prompt ... lets you kick off work, keep coding, then come back with status, logs, or attach.
Multi-agent exploration Parent and child sessions keep lineage, and child runs can use separate git worktrees for isolation.
Automation and orchestration --json, --stream ndjson, Unix-socket IPC, and NCA_ORCH_* metadata make it usable as a worker process.
Long-running research nca autoresearch once runs metric-driven experiments with parsed output for CI/profiling.

Installation

One-line install (macOS and Linux)

bash
curl -fsSL https://nca-cli.com/install | bash

This detects your platform, downloads the latest release from GitHub, and installs nca to /usr/local/bin. Set NCA_INSTALL_DIR to change the install path.

Windows: download the matching .zip from Releases and put nca.exe on your PATH.

GitHub Releases

Pre-built binaries for every release are available on the Releases page:

Platform Target Archive
macOS (Apple Silicon) aarch64-apple-darwin .tar.gz
macOS (Intel) x86_64-apple-darwin .tar.gz
Linux (x86_64) x86_64-unknown-linux-gnu .tar.gz
Linux (ARM64) aarch64-unknown-linux-gnu .tar.gz
Windows (x86_64) x86_64-pc-windows-msvc .zip

Build from source

Requires Rust edition 2024 (use a recent toolchain).

bash
git clone https://github.com/madebyaris/native-cli-ai.git
cd native-cli-ai
cargo build --release
cp target/release/nca /usr/local/bin/

Quick Start

bash
# Configure a provider
export MINIMAX_API_KEY="your-api-key"

# Start the interactive CLI
nca

# Line REPL instead of the full-screen TUI
nca --no-tui

# Run one task and exit
nca run --prompt "Explain this repository"

# Spawn a detached session
nca spawn --prompt "Inspect the repo and draft a plan"

# Inspect and attach
nca sessions
nca status 
nca attach 

The full-screen UI appears when stdin and stdout are TTYs and --stream human is active. Otherwise nca falls back to the line-oriented REPL or one-shot execution path.

Images (full-screen TUI)

In the default TUI you can attach images for the next user message:

  • Ctrl+V — paste a bitmap from the system clipboard (saved as PNG under the session).
  • /image paste — same as clipboard paste if Ctrl+V is not available.
  • /image path/to/screenshot.png — copy a file into the session attachment dir.
  • /image clear — remove staged images before you press Enter.

For MiniMax, pasted images are analyzed with the same HTTP API as the MCP's understand_image tool (POST /v1/coding_plan/vlm on https://api.minimax.io or your region host); nca does this in Rust (no Python MCP). The description is merged into the user message before /v1/messages. Other providers use their own multimodal chat formats where supported. If the selected provider/model is not treated as vision-capable, nca errors instead of silently dropping images. Session attachment copies are removed automatically after a successful send/process; your original source file is not deleted.

A Quick Look

The main interface is designed to feel like a serious terminal tool, not a toy overlay.

Core Commands

Command Purpose
nca Start the default interactive experience. Auto-resumes the last session unless --no-resume is used.
nca run --prompt ... Run one task in the foreground.
nca spawn --prompt ... Start a detached session and return immediately.
nca resume Resume a saved session.
nca attach Attach to a running session over IPC.
nca logs Read or follow the event log.
nca status Show session status and metadata.
nca cancel Mark a detached session as cancelled.
nca sessions List saved sessions, with filters like --status, --since-hours, and --search.
nca models Show configured models and provider-facing defaults.
nca doctor Check provider readiness, skills, and memory/config paths.
nca config Print effective config and resolved paths.
nca memory list|add Inspect or append workspace memory notes.
nca skills List discovered skills with their source (AGENTS.md, filesystem, or user directory).
nca mcp List configured MCP servers.
nca completion Generate shell completions.
nca index build|show Build or inspect a cached CLI index under ~/.local/share/ncacli/workspaces//.
nca autoresearch once Run a metric-driven research program and print parsed output.

There is also a hidden serve subcommand used for IPC-oriented service sessions.

Interactive UX

The interactive surface has two modes:

  • Full-screen TUI — transcript (markdown + syntax highlighting), composer, overlays (palette, pickers, connect wizard), approvals, structured questions, session sidebar, and branch chip.
  • Line-oriented REPL (reedline) — for scripts, non-TTY environments, or --no-tui.

Slash commands, the Ctrl+P command palette, autocomplete, and /help all come from one registry, so labels stay in sync. Palette Enter executes the command (it does not only pre-fill the composer).

Slash commands

Command Purpose
/help Show help (generated from the registry).
/agent Choose agent profile (build, plan, review, fix, test).
/plan /review /fix /test Run a preset turn for that profile.
/skills Browse discovered skills; /{skill} runs one.
/memory Show or append memory notes.
/compact Compact session context.
/copy Copy the latest assistant response (TUI; also Ctrl+Shift+C).
/todos Show the session todo list.
/model Open the model picker (/models is an alias).
/connect Connect / switch provider, API key, or custom endpoint (/provider, /apikey, /custom are aliases).
/status Session status and health (/stats, /cost, /doctor are aliases).
/config Config and editor settings (/settings, /set-editor are aliases).
/permissions Permission mode picker (/permission-bypass is an alias).
/sessions /new /export /attach /logs Session lifecycle and inspection.
/image Stage clipboard or file images (TUI).
/editor Open the external editor.
/mcp /agents /diff /thinking /stop /clear /exit System and turn controls.
/auto-answer Accept the suggested answer for a pending ask_question.

Keyboard shortcuts (TUI)

Binding Action
Ctrl+P Open the command palette (fuzzy; Enter runs).
Ctrl+V Paste image from clipboard (TUI).
Ctrl+Shift+C Copy last assistant response (TUI).
Ctrl+X then m / e / l / n / c / s / a / h / q Leader shortcuts: model, editor, sessions, new, compact, status, agent, help, exit.
Ctrl+Y / Ctrl+N / Ctrl+U Approve / deny / always-allow a pending tool (wins over an open question modal).
Tab Complete @ path or / command; otherwise cycle agent profile.
F2 / Shift+F2 Cycle recent models.
Ctrl+V Paste clipboard image (off the UI thread).
Ctrl+L Clear the transcript (same idea as /clear).
Esc / Ctrl+C Cancel the current turn when busy.
! Run a shell command.
@ File mention with fuzzy completion (indexes in the background on open).

Click the branch chip in the status line to open the branch picker (list/switch/create via background git).

While the agent is working, the status bar shows an animated busy state with elapsed seconds (thinking 12s, tool 3s) and a short detail (model wait, stream size, or file path). The transcript footer mirrors the same live activity so long provider waits do not look frozen.

Output and Automation

nca is designed to work well in two very different moods: terminal-first for humans, and machine-friendly for orchestrators.

  • --stream off returns only the final output.
  • --stream human renders the normal terminal experience.
  • --stream ndjson emits newline-delimited event envelopes.
  • --json is available on lifecycle-oriented commands such as spawn, sessions, status, cancel, skills, models, doctor, config, index show, and mcp.
  • NCA_ORCH_* and `NC

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rustagent-orchestrationaiautomationcli

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类AI 编程
定价开源

> 相关工具

G
GitHub Copilot
GitHub 官方 AI 编程助手,覆盖补全、Chat 与 Agent 模式。
C
Cursor
AI 原生代码编辑器,对话改代码、多文件 Agent 与规则体系是其核心。
S
skills
Skills for Real Engineers. Straight from my .agents directory.