Skip to content

CLI reference

The maiden binary operates on an agent folder. run, serve and eval drive an agent; tool authors the sandboxed components it can call.

maiden --version prints the version, and maiden help <command> prints usage for one command.

Run one agent loop against a message and print the final answer.

Terminal window
maiden run <dir> <message> [options]
Argument / optionDefaultDescription
<dir>Path to the agent folder.
<message>The user message to send.
--thread <id>defaultThread to run on. Reusing a thread resumes its durable history.
--mockoffUse the scripted offline provider — no API key, fully deterministic.
--model <m>Override the model from agent.toml (top agent only; subagents keep their own).
--state <dir><dir>/.maiden/stateWhere thread snapshots are stored.

The answer is printed to stdout; run metadata (agent name, tool list, turn count) goes to stderr, so you can pipe the answer cleanly.

Terminal window
maiden run examples/echo-agent "echo the phrase hello" --mock

Serve the agent over HTTP with durable per-thread resume. Also starts the agent’s schedules and channels.

Terminal window
maiden serve <dir> [options]
OptionDefaultDescription
--port <n>8080TCP port to bind.
--bind <addr>127.0.0.1Bind address. Also settable via the MAIDEN_BIND environment variable.
--mockoffScripted offline provider.
--model <m>Override the model from agent.toml.
--state <dir><dir>/.maiden/stateThread snapshot directory.

The server accepts a JSON body and returns either a single JSON response or a stream of Server-Sent Events. See Serve over HTTP and stream for the request and response shapes.

Terminal window
maiden serve examples/echo-agent --port 8080
curl -s localhost:8080 -d '{"thread":"t1","message":"echo hello"}'

Run the agent’s evals (evals/*.toml) and report pass/fail. Exits non-zero if any case fails, so it drops straight into CI.

Terminal window
maiden eval <dir> [options]
OptionDefaultDescription
--mockoffScripted offline provider — the usual mode for deterministic evals.
--model <m>Override the model from agent.toml.

Evals run against ephemeral state (a fresh temp directory per invocation), so a case never resumes a previous run — every invocation is reproducible.

Terminal window
maiden eval examples/echo-agent --mock
# ok echo
# [maiden] 1/1 eval(s) passed

See Write and run evals for the case format.

Write a complete, buildable tool source under <dir>/tools/src/<name>/, including the tool.wit contract this binary implements.

Terminal window
maiden tool new <name> [options]
Argument / optionDefaultDescription
<name>Tool name. Lowercase letters, digits, - and _; becomes the tool’s model-facing name.
--dir <dir>.The agent folder to create the source in.
--lang <rust|js>rustAuthor in Rust (cargo-component) or JavaScript (jco).

Refuses to overwrite an existing source.

Terminal window
maiden tool new triage-rank --dir my-agent --lang rust

Compile tool sources into <dir>/tools/*.wasm, where the runtime discovers them.

Terminal window
maiden tool build [name] [options]
Argument / optionDefaultDescription
[name]allBuild only this source. Omit to build every source under tools/src/.
--dir <dir>.The agent folder.

Requires cargo-component for Rust tools (cargo install cargo-component) and Node.js for JavaScript tools — jco is invoked through npx, so there is nothing to install globally. A missing toolchain is reported as such rather than as a compiler error.

Terminal window
maiden tool build --dir my-agent

See Add a sandboxed tool for the authoring flow.