Guides
CLI
The command surface: run, compile, chat, MCP, scripts, memory, logs, and recovery.
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
| Command | What 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 repl | Starts an interactive JavaScript and TypeScript shell. |
sofuu serve | Hosts an OpenAI-compatible HTTP server for vector memory or local completions: --brain <path>, --model <path>, --port 7707. |
sofuu capabilities --json | Prints the runtime capability manifest: SIMD, GPU engines, transports, and enabled features. |
sofuu doctor | Verifies QTSQ memory linkage, a write and recall round trip, and context limits. |
sofuu version | Prints the runtime version, commit revision, QuickJS version, and target architecture. |
sofuu licenses | Prints open-source licenses for Sofuu, QuickJS, libuv, and the QTSQ memory engine. |
Compile and package
| Command | What 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
| Command | What it does |
|---|---|
sofuu chat | Starts the terminal chat interface. Takes -m <model>, -p <provider>, and --sync off. |
sofuu session list | Lists segmented project sessions. |
sofuu session show <id> | Shows one session and its stored state. |
sofuu session repair | Repairs a corrupted session manifest. |
sofuu session prune | Removes stale session checkpoints. |
sofuu outputs list | Lists 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
| Command | What 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 list | Lists 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 repl | Opens 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
| Command | What it does |
|---|---|
sofuu mcp list | Lists 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 cursor | Writes server configuration into Cursor settings. |
sofuu mcp link claude-desktop | Writes server configuration into Claude Desktop settings. |
An external server launched through npx keeps its own dependencies and install requirements.
Memory, policy, and plugins
| Command | What it does |
|---|---|
sofuu brain stats | Reports statistics for a QTSQ memory file. |
sofuu brain verify <path> | Verifies a memory container. |
sofuu brain backup | Backs up a memory container. |
sofuu brain restore | Restores a memory container. |
sofuu brain repair | Repairs a memory container. |
sofuu policy check | Validates policies in .sofuu/policy.json. |
sofuu policy why <action> [args] | Explains an allow or deny decision. |
sofuu plugin list | Lists 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
| Command | What it does |
|---|---|
sofuu logs | Lists 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 --follow | Streams tokens and tool calls from an active background worker. |
sofuu logs --last-error | Prints 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:
| Command | What it does |
|---|---|
sofuu dev [dir] --port 3000 | Reactive dev server with a streaming JSX and TSX transpiler. |
sofuu infer <model.gguf> [prompt] | Local CPU inference over GGUF or SafeTensors files. |
sofuu swarm worker | Distributed transformer layer pipelining over LAN sockets. |
sofuu drone status | MAVLink v2 telemetry and hardware safety gates. |
Common workflows
Iterate on a script, then package it
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
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
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
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.