cd /news/ai-agents/show-hn-a-tiny-shell-agent-in-rust Β· home β€Ί topics β€Ί ai-agents β€Ί article
[ARTICLE Β· art-24521] src=github.com pub= topic=ai-agents verified=true sentiment=↑ positive

Show HN: A tiny shell agent in Rust

A developer has released nano-agent, a lightweight shell agent written in Rust that interfaces with any OpenAI-compatible API to execute commands with user approval. The tool, available via Cargo install, offers both one-shot prompting and an interactive REPL mode, with features including MCP tool support, planning mode, and optional sandboxing via bwrap. The agent requires explicit user approval before running any command, positioning it as a security-conscious alternative for developers seeking AI-assisted terminal operations.

read1 min publishedJun 11, 2026

A tiny shell agent in Rust. Talks to any OpenAI-compatible API, runs commands with your approval, and stays out of the way.

cargo install --path .
export OPENAI_API_KEY=sk-...

nano-agent "what's in this repo?"

That's it. Run nano-agent

with no arguments for an interactive REPL.

nano-agent "fix the failing test"   # one-shot prompt
nano-agent                          # REPL
nano-agent -c                       # continue last session here
nano-agent -s                       # pick a recent session

Every command the agent wants to run is shown first:

$ cargo test
Approve? [y] Approve  [a] Approve All  [n] Deny:

In the REPL: :q

quits, :reset

starts over, end a line with \

for multiline.

Point it anywhere with an OpenAI-compatible API:

export OPENAI_BASE_URL=http://localhost:11434/v1   # e.g. Ollama
export OPENAI_MODEL=gemma4

Or keep providers in ~/.config/nano/config.json

(or ./nano_config.json

):

{
  "provider": "local",
  "custom_providers": {
    "local": {
      "provider_type": "openai",
      "base_url": "http://localhost:11434/v1",
      "api_key": "",
      "model": "gemma4"
    }
  }
}

See example_config.json for the full format.

MCP toolsβ€” add servers undermcp_servers

in the config; their tools are exposed to the model automatically.Planning modeβ€” prefix a message with/mito

to talk to a separate local planning agent that prepares a detailed handoff before the main model acts (enablemito-mode

in the config).ACPβ€” build with--features acp

to run nano as an ACP stdio agent (nano-agent --acp

) or to delegate subtasks to child agents configured underacp_agents

. A child'sworking_directory

is its sandbox boundary; without one, its tools are disabled.

Useful environment variables: OPENAI_API_KEY

, OPENAI_BASE_URL

, OPENAI_MODEL

, NANO_MAX_STEPS

, NANO_SANDBOX=0

(disable bwrap sandboxing).

cargo test
cargo test --features acp
── more in #ai-agents 4 stories Β· sorted by recency
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain β€” perfect for shipping the agent you just read about.

$git push zahid main
β†’ Live at https://your-agent.zahid.host βœ“
Get free account β†’ Pricing
from €0/mo Β· no card required
LIVE [news/show-hn-a-tiny-shell…] indexed:0 read:1min 2026-06-11 Β· β€”