Guides

CLI

The command surface: run, compile, chat, MCP, scripts, memory, logs, and recovery.

Updated Nov 13, 20264 min readv0.3.0-beta
On this page13 sections

One binary contains the runtime, compiler, agent supervisor, MCP bridge, and plugin commands. This page groups the documented command surface by task; Troubleshooting covers failure modes.

Runtime

CommandWhat it does
sofuu run <file>Executes a JavaScript or TypeScript file without a build step, on QuickJS and libuv.
sofuu eval "<code>"Evaluates an inline JavaScript expression. -q suppresses output.
sofuu replStarts an interactive JavaScript and TypeScript shell.
sofuu serveHosts an OpenAI-compatible HTTP server for vector memory or local completions: --brain <path>, --model <path>, --port 7707.
sofuu capabilities --jsonPrints the runtime capability manifest: SIMD, GPU engines, transports, and enabled features.
sofuu doctorVerifies QTSQ memory linkage, a write and recall round trip, and context limits.
sofuu versionPrints the runtime version, commit revision, QuickJS version, and target architecture.
sofuu licensesPrints open-source licenses for Sofuu, QuickJS, libuv, and the QTSQ memory engine.

Compile and package

CommandWhat it does
sofuu compile <entry>Packages a supported JavaScript, TypeScript, or Kaze program as a single-file executable. Takes -o <out>, --profile <name>, --embed-brain <path>, and --no-strip.
sofuu mcp build <server.ts> -o <out>Compiles a supported MCP server with the micro profile. Equivalent to sofuu compile <server.ts> --profile micro -o <out>.

Profiles, embedded archives, and the output layout are covered in the compiler guide.

Chat and sessions

CommandWhat it does
sofuu chatStarts the terminal chat interface. Takes -m <model>, -p <provider>, and --sync off.
sofuu session listLists segmented project sessions.
sofuu session show <id>Shows one session and its stored state.
sofuu session repairRepairs a corrupted session manifest.
sofuu session pruneRemoves stale session checkpoints.
sofuu outputs listLists archived model and tool outputs.
sofuu outputs search <query>Searches archived outputs.
sofuu outputs context <id>Builds historical task context from an archived output.

The session mesh and resume flow are described in Chat and sessions.

Agents and Kaze scripts

CommandWhat it does
sofuu agent run <name> "<task>"Runs a registered agent headless. --json emits structured output for pipelines.
sofuu agent init <name>Scaffolds an agent in ~/.sofuu/agents/.
sofuu agent validate <file>Validates an agent definition against its schema.
sofuu agent listLists registered agents.
sofuu script run <file.kaze>Executes a Kaze routine in the linear arena VM.
sofuu script check <file.kaze>Parses and checks a routine without running it.
sofuu script compile <file.kaze> -o <out>Compiles a routine to embedded-engine bytecode.
sofuu script replOpens the Kaze expression and policy REPL.

Standalone Kaze is at 1.0; the engine embedded in Sofuu reports 0.1. The two are not interchangeable. See the Kaze reference for the standalone language.

MCP

CommandWhat it does
sofuu mcp listLists servers configured in ~/.sofuu/mcp.json.
sofuu mcp test "<cmd>"Tests the handshake, protocol negotiation, and tool count.
sofuu mcp inspect "<cmd>" --call <tool> --args '<json>'Inspects tool schemas and invokes one tool directly.
sofuu mcp link cursorWrites server configuration into Cursor settings.
sofuu mcp link claude-desktopWrites server configuration into Claude Desktop settings.

An external server launched through npx keeps its own dependencies and install requirements.

Memory, policy, and plugins

CommandWhat it does
sofuu brain statsReports statistics for a QTSQ memory file.
sofuu brain verify <path>Verifies a memory container.
sofuu brain backupBacks up a memory container.
sofuu brain restoreRestores a memory container.
sofuu brain repairRepairs a memory container.
sofuu policy checkValidates policies in .sofuu/policy.json.
sofuu policy why <action> [args]Explains an allow or deny decision.
sofuu plugin listLists plugins and circuit-breaker states.
sofuu plugin add <pkg>Installs a provider plugin.
sofuu plugin init <name>Scaffolds a plugin.
sofuu plugin validate <file>Validates plugin schemas and registration.
sofuu plugin test <tool>Runs a plugin tool and reports its circuit state.

Plugins run in-process and must be trusted as code. Their checks are not an operating system sandbox.

Logs and recovery

CommandWhat it does
sofuu logsLists recent runs with run ID, start time, step count, and exit status: DONE, ERROR, or CANCELLED.
sofuu logs show <id>Renders the event trace for model calls, tool executions, and step summaries.
sofuu logs --followStreams tokens and tool calls from an active background worker.
sofuu logs --last-errorPrints the failure context, stack trace, and post-mortem card for the newest failure.
sofuu resume <run_id>Attempts to resume a run from its last durable checkpoint. Checkpoints altered by redaction or truncation are refused.

Preview commands

These commands are marked preview in the current docs and may change:

CommandWhat it does
sofuu dev [dir] --port 3000Reactive dev server with a streaming JSX and TSX transpiler.
sofuu infer <model.gguf> [prompt]Local CPU inference over GGUF or SafeTensors files.
sofuu swarm workerDistributed transformer layer pipelining over LAN sockets.
sofuu drone statusMAVLink v2 telemetry and hardware safety gates.

Common workflows

Iterate on a script, then package it

Shell
sofuu run app.js
sofuu compile app.js -o dist/app
./dist/app

The first command runs from source. The second appends the compiled payload to a base runtime; the output is a single executable for the current platform.

Check a Kaze routine, then compile it

Shell
sofuu script check agent.kaze
sofuu script run agent.kaze
sofuu script compile agent.kaze -o agent.kazebc
sofuu compile agent.kaze -o dist/kaze-agent

script check parses and checks without executing. script compile emits embedded-engine bytecode, while sofuu compile packages a supported routine as a standalone executable.

Trace a failed agent run

Shell
sofuu agent run auditor "Audit src/"
sofuu logs
sofuu logs --last-error
sofuu resume <run_id>

If the run failed, --last-error produces the post-mortem card. resume only proceeds when it finds a usable checkpoint.

Test and publish an MCP server

Shell
sofuu mcp list
sofuu mcp test "npx -y @modelcontextprotocol/server-filesystem /tmp"
sofuu mcp build server.ts -o dist/my-mcp-server
./dist/my-mcp-server

mcp test checks the handshake before you depend on the server. mcp build uses the micro profile to keep the artifact minimal.