Docs
The CLI — codana
codana is a terminal coding agent built on @nanocodana/nodejs — the fastest way to feel what the framework does before you write a line against it.
npm install -g @nanocodana/cli
codana chat # start chatting in the current directory
codana chat --continue # resume the last conversation here
codana chat --yolo # auto-approve all toolsConfiguring providers#
Keys are stored on disk, per provider; switch any time with /provider in-session.
codana config --provider openai --api-key sk-...
codana config --provider anthropic --api-key sk-ant-...
codana config --provider custom --base-url https://openrouter.ai/api/v1 --api-key sk-or-...In-session commands#
| Command | What it does |
|---|---|
| /model | Switch the model. |
| /provider | Interactive picker — base URL, key, model. |
| /yolo | Toggle auto-approval of tools. |
| /skills | List the skills the agent discovered. |
| /cost | Session cost and token usage. |
| /clear | Clear the conversation. |
| /help | All commands. |
| /exit | Leave. |
Type @ to reference project files in your message — the agent gets the path, not a paste.
Non-interactive mode#
codana -p "…" runs one prompt with no TUI and exits, so it composes with everything else. Piped stdin becomes context, answers go to stdout and progress to stderr, so a pipe receives only the answer.
codana -p "write a commit message for the staged diff" | pbcopy
git diff | codana -p "review this"
codana -p "which tests are failing?" --json | jq -r .text--yolo, anything that could change your files is denied and the run exits 2. Nobody is there to approve, so -p reads, searches and reasons — and tells you what it wanted to do instead of doing it. That includes the sandboxed shell: it operates on your real working directory, so leaving it open while denying Write just means the model reaches for echo > file instead. --yolo allows everything, including your host shell.| Exit code | Meaning |
|---|---|
| 0 | done |
| 1 | error |
| 2 | something was denied — re-run with --yolo to allow it |
--json emits one object with the text, the tools used, which were denied, and token usage. MCP servers are passed only with --yolo, since a deny-list of tool names cannot cover names it has never seen.
Skills#
Skills load from ~/.agents/skills, ~/.claude/skills, and the same directories in the project — project overrides home, and --skills <dir> adds more. If you already keep skills for Claude Code, codana picks them up unchanged.
Size#
The whole CLI — TUI, AI SDK, agent, shell — is compiled into a single 6.2 MB file at publish time, so it installs as 50 packages rather than 300. What stays external is only what a bundler can't inline: wasm, native addons, the rg binary.
That's 36 MB on disk, and three of those payloads are optional:
npm install -g @nanocodana/cli --omit=optional # 36 MB -> 27 MB, 50 -> 8 packagesThe cost is tar -J, tar --zstd, and native-speed grep (which falls back to JS). sqlite3, python3 and js-exec keep working. Of what remains, 12 MB is CPython — delete node_modules/@nanocodana/cli/vendor/ if you never use python3.
--yolo is for sandboxes and throwaway repos. In anything you care about, let the approval prompts do their job.