code

js/cli/code.md

fino code runs the Fino coding agent for one turn against the current directory and streams its answer. The agent reads, searches, and edits files under the project root, runs commands in the sandboxed shell, and can fan work out to sub-agents.

fino code "why does the h2 test time out?"
fino code --plan "how should the cache be invalidated?"
fino code --auto --continue "apply the fix and run the tests"
fino code sessions

Models

The model comes from --model, then FINO_CODE_MODEL, then the provider's default. A claude… id uses Anthropic and any other id an OpenAI-compatible API; --provider anthropic|openai overrides the guess. With no id, Anthropic is used when ANTHROPIC_API_KEY is set, otherwise OpenAI.

Variable Use
ANTHROPIC_API_KEY Anthropic credentials.
OPENAI_API_KEY OpenAI credentials.
OPENAI_BASE_URL An OpenAI-compatible server; no key is required.
FINO_CODE_MODEL Default model id.

Modes and approvals

Option Tools Edits and commands
(none) read, search, edit, shell Ask before each one.
--plan read and search only Not offered.
--auto read, search, edit, shell Run without asking.

On a terminal each gated call is confirmed. Without one it is rejected, and the agent is told to continue without it or to ask for --auto.

Every tool is bounded to the project root, as with fino mcp: paths outside it are refused, and shell runs under the strict process sandbox with no network access, failing closed where that sandbox is unavailable.

Sub-agents

The agent can spawn sub-agents for independent pieces of work. Each runs concurrently in its own conversation and reports back for review. A turn does not end while sub-agents are working: when the agent stops first, fino code waits for them and continues the conversation with their reports until each is accepted, iterated on, or reported as failed. Sub-agents follow the session's mode, and in --plan they are read-only.

Sessions

Conversations are stored in .fino/code/sessions.db under the project root.

Option Effect
--continue Continue the most recent session.
--thread <id> Continue the session with this id.
--model <id> Model id.
--provider <name> anthropic or openai.

Continuing a session first finishes what the previous process left: a run interrupted mid-step is re-driven from its last checkpoint, a pending approval is asked again, and sub-agents awaiting review are handed back to the agent.

fino code sessions lists sessions newest first with their title and attention state; --archived lists archived ones. Both commands accept --json; a turn's JSON result is { command, ok, status, threadId, text }, plus error when the turn failed.

The agent is built from public modules: sessions from fino:ai/session, titles and attention from fino:ai/threads, tools from fino:ai/tools, and sub-agents from fino:ai/subagents.