Complete a First Task
The point of a first task is not attractive prose; it is verifying the complete loop: CodeN inspects the workspace, the model proposes tool calls, permission policy intervenes, tools return results, the model continues from those results, and you verify the final state with tests or a diff. The default interface is the continuous-output CLI; the TUI requires explicit --tui.
Launch the CLI / TUI
Section titled “Launch the CLI / TUI”The three interface modes
Section titled “The three interface modes”| Mode | Trigger | Characteristics |
|---|---|---|
| CLI/REPL | default, or --cli |
Streaming output; interactive multiline input; startup banner |
| Full-screen TUI | explicit --tui |
Ink full-screen UI; transient activity enters the transcript; single-task serial execution |
-p / --print |
Plain text, pipe-friendly; exits after a single turn |
Selection rules
Section titled “Selection rules”- With no interface flag, CodeN always enters CLI/REPL, TTY or not.
--tuirequires stdin and stdout to both be TTYs, raw mode to be available, andTERM != dumb; otherwise it falls back to the CLI with a warning instead of failing.-p/--printrequires a prompt; for examplecoden -p --auto "Implement the feature and run tests".- Combining
--tuiwith--clior with--printfails argument parsing; combining--cliwith--printdoes not fail, and print wins. NO_COLORdisables color only and does not affect interface-mode selection.
Input in CLI sessions
Section titled “Input in CLI sessions”- With no initial prompt, the multiline editor is used when supported: Enter submits and a single trailing
\inserts a newline. Ctrl+D(empty input) exits;Ctrl+Ccancels the current task rather than exiting.- The startup banner shows version, workspace hash, model, approval mode, thinking level, and session ID, followed by a
Task >prompt.
TUI behavior highlights
Section titled “TUI behavior highlights”- The input area is enclosed by two full-width horizontal rules; Enter submits and Shift+Enter or a trailing
\inserts a newline. Ctrl+P/Ctrl+Nbrowse input history;PageUp/PageDownand the mouse wheel scroll the transcript, andEndreturns to the latest content.- While running,
Ctrl+Ccancels the current task; while idle,Ctrl+CorCtrl+Dwith empty input exits. - Tool authorization, workspace trust, and plugin confirmations appear as inline transcript requests instead of dialogs; the input area stays visible but disabled while waiting.
- The TUI runs one task at a time and does not queue input while running.
Launch examples
Section titled “Launch examples”coden # CLI/REPL (default)coden --tui # explicit full-screen TUIcoden --cli # explicit CLI/REPLcoden -p "Reply with exactly: coden-ok" # print single-turn outputcoden --tui "fix the failing tests in this project"Related references
Section titled “Related references”Complete Your First Task
Section titled “Complete Your First Task”Prerequisites
Section titled “Prerequisites”- Node.js 22+ (or run from source with Bun).
- A configured provider credential (see Configure Your First Provider).
- Enter the target project directory; the current working directory is CodeN’s workspace.
Shortest flow
Section titled “Shortest flow”cd /path/to/projectcoden "run the test suite and fix the first failure"What to observe
Section titled “What to observe”| Phase | Behavior |
|---|---|
| Startup | Reads configuration, discovers skills, loads plugins; prints the startup banner (version, workspace hash, model, approval mode, thinking level) |
| Authorization | The default approval mode is manual: read is auto-allowed; write/edit show a summarized input and ask for confirmation |
| Choices | y allows once; dangerous operations offer only y/N; ordinary modifications accept s to allow for the session (allow_session) |
| Tool calls | bash runs with the workspace as its cwd; output is bounded (default 30000 characters) and truncated |
| Completion | When the model stops calling tools, the turn ends; a task started with a prompt in the CLI exits when done |
The prompt inside a session is Task > and the first user message becomes the session title. The workspace hash and data directories are derived from the workspace path (workspaceHash).
Common variants
Section titled “Common variants”coden --auto "run the test suite and fix the first failure" # skip permission prompts (ordinary operations only)coden --smart-approve "run the test suite and fix the first failure" # LLM review for ordinary modificationscoden -p --auto "run the test suite and fix the first failure" # single-turn plain-text outputcoden --tui "run the test suite and fix the first failure" # run in the full-screen TUIcoden --resume # list sessions for the current workspacecoden --resume <session-id> # resume a specific sessionVerification and inspection
Section titled “Verification and inspection”git status # inspect the change scopegit diff --stat # inspect the change sizecoden --resume # session list: title, message count, last activityBoundaries and failure modes
Section titled “Boundaries and failure modes”- Permission denial: returns
permission.denied: <tool> was not authorized(orpermission.outside_workspace_denied); the model receives the error and adjusts.--autodoes not change thedeny/asksemantics ofPreToolUsehooks. - Step limit: the default
maxStepsis 80; hitting it throwsruntime.step_limit(Maximum model steps (80) reached) after the model exhausts its steps. - Outside-workspace access:
read/write/editare classified by the real path after symlink resolution; outside paths are requested as modification operations by default and denied outright under--auto. - Cancellation:
Ctrl+Ccancels the current task in the CLI; in the TUI,Ctrl+Ccancels while running and exits while idle. Interrupted tool calls are repaired withruntime.interruptederror markers on session resume. - Sessions and cost: every effective task creates a session file and counts toward provider usage; keep task scope explicit and verifiable.