Show HN: A tiny shell agent in Rust

modinfo1 pts0 comments

GitHub - skorotkiewicz/nano-agent: A minimal Rust shell agent with OpenAI-compatible model calls · GitHub

/" data-turbo-transient="true" />

Skip to content

Search or jump to...

Search code, repositories, users, issues, pull requests...

-->

Search

Clear

Search syntax tips

Provide feedback

--><br>We read every piece of feedback, and take your input very seriously.

Include my email address so I can be contacted

Cancel

Submit feedback

Saved searches

Use saved searches to filter your results more quickly

-->

Name

Query

To see all available qualifiers, see our documentation.

Cancel

Create saved search

Sign in

/;ref_cta:Sign up;ref_loc:header logged out"}"<br>Sign up

Appearance settings

Resetting focus

You signed in with another tab or window. Reload to refresh your session.<br>You signed out in another tab or window. Reload to refresh your session.<br>You switched accounts on another tab or window. Reload to refresh your session.

Dismiss alert

{{ message }}

skorotkiewicz

nano-agent

Public

Notifications<br>You must be signed in to change notification settings

Fork

Star

main

BranchesTags

Go to file

CodeOpen more actions menu

Folders and files<br>NameNameLast commit message<br>Last commit date<br>Latest commit

History<br>37 Commits<br>37 Commits

src

src

.gitignore

.gitignore

Cargo.lock

Cargo.lock

Cargo.toml

Cargo.toml

QUICK_START.md

QUICK_START.md

README.md

README.md

example_config.json

example_config.json

justfile

justfile

View all files

Repository files navigation

nano

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

Quick start

cargo install --path .<br>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.

Usage

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

Every command the agent wants to run is shown first:

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

In the REPL: :q quits, :reset starts over, end a line with \ for multiline.

Other models

Point it anywhere with an OpenAI-compatible API:

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

Or keep providers in ~/.config/nano/config.json (or ./nano_config.json):

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

See example_config.json for the full format.

Going further

MCP tools — add servers under mcp_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 (enable mito-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 under acp_agents. A child's working_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).

Development

cargo test<br>cargo test --features acp

About

A minimal Rust shell agent with OpenAI-compatible model calls

Resources

Readme

Uh oh!

There was an error while loading. Please reload this page.

Activity

Stars

stars

Watchers

watching

Forks

forks

Report repository

Contributors

Uh oh!

There was an error while loading. Please reload this page.

Languages

Rust<br>98.6%

Just<br>1.4%

You can’t perform that action at this time.

agent nano cargo rust openai model

Related Articles