code
js/commands/code.ts
fino:commands/code — the fino code coding agent.
fino code "<prompt>" runs one turn of the Fino coding agent against the
current directory and streams the answer. The agent reads, searches, and
edits files under the project root, runs commands in the sandboxed shell,
and fans work out to sub-agents; a turn ends only once the sub-agents it
started have been reviewed.
Conversations persist in .fino/code/sessions.db under the project root.
--continue resumes the most recent session, --thread <id> a specific
one, and fino code sessions lists them. Continuing first finishes
anything the previous process left behind: a run interrupted mid-step, a
pending approval, or sub-agents still awaiting review.
Modes
- default (
build): file edits and shell commands ask for approval. On a terminal each one is confirmed; without one they are rejected and the agent is told to continue without them. --plan: read-only tools only; the agent researches and writes a plan.--auto: edits and commands run without asking.
The model comes from --model/--provider, then FINO_CODE_MODEL, with
credentials from ANTHROPIC_API_KEY, OPENAI_API_KEY, or
OPENAI_BASE_URL for an OpenAI-compatible server.
--max-cost <usd> caps what this invocation spends across the agent and
its sub-agents: the model call that would exceed it fails and ends the
turn. Spend is priced from fino:ai/context's PRICING, so a model
missing from that table is refused rather than counted as free.
Besides the file tools and shell, the agent gets Fino's own commands as
tools: docs_search and docs_show over the project's fino doc build
index, fino_lint, and (outside --plan) fino_fmt, fino_test and
fino_bench, all under the same sandbox as shell.
fino code "why does the h2 test time out?"
fino code --auto --continue "apply the fix and run the tests"
fino code sessionsConstants
const command
Run one fino code turn against the current directory.