Skip to content
Theme:

Headless CLI

aether headless runs a single prompt, streams events to stdout, and exits.

Terminal window
aether headless "Explain the settings loader in this project"
Terminal window
aether headless [OPTIONS] [PROMPT]...

If prompt words are provided, Aether joins them with spaces. If no prompt is provided and stdin is not a TTY, Aether reads stdin, trims it, and uses that as the prompt.

Terminal window
git diff --staged | aether headless "Review these changes"

Headless mode has two ways to choose what runs:

OptionBehavior
--agent <name>Resolve a named userInvocable agent from settings.
--model <provider:model>Create an ad-hoc default agent using that model.

--agent and --model are mutually exclusive. If neither is provided, Aether resolves the first user-invocable agent from settings. If there are no configured agents, it falls back to Aether’s built-in default agent spec.

Terminal window
aether headless --agent Researcher "Find the API route definitions"
Terminal window
aether headless --model zai:glm-5.1 \
"Summarize the architecture"

Use --provider for provider-specific request routing and connection overrides. For Bedrock inference profiles, keep --model as the Bedrock model ID and pass the ARN separately:

Terminal window
aether headless --model bedrock:anthropic.claude-sonnet-4-5-20250929-v1:0 \
--provider bedrock.inference-profile-arn=arn:aws:bedrock:us-west-2:000000000000:application-inference-profile/000000000000 \
"Summarize the architecture"
FlagTypeDescription
[PROMPT]...positionalPrompt text. Reads stdin if omitted and stdin is not a TTY.
-a, --agentstringNamed agent from settings. Defaults to first user-invocable agent.
-m, --modelstringAd-hoc model spec. Mutually exclusive with --agent.
-C, --cwdpathWorking directory. Defaults to ..
--settings-jsonstringInline settings JSON.
--settings-filepathSettings JSON file.
--mcp-configpathAdditional MCP config file. Repeatable.
--mcp-config-jsonstringAdditional inline MCP config JSON. Repeatable.
--system-promptstringAdditional system prompt text.
--outputtext | pretty | jsonOutput format. Defaults to text.
-v, --verboseflagVerbose diagnostic logging to stderr.
--eventscomma-separated listEvent kinds to emit. Omit to emit all.
--providerprovider.field=valueProvider override. Supports PROVIDER.url, PROVIDER.auth, and bedrock.inference-profile-arn.

--sandbox-image is a global CLI flag, so it can appear before the subcommand or in the subcommand options shown by help.

Human-readable lines. Final text is printed as plain text; tool calls, tool results, errors, context usage, and other selected events are formatted as simple lines.

Terminal window
aether headless --output text "What does this project do?"

--output json writes NDJSON to stdout: one aether_core::events::AgentMessage JSON object per line. Parse each line independently:

let event: aether_core::events::AgentMessage = serde_json::from_str(line)?;

Example lines:

{"type":"tool_call","request":{"id":"tc1","name":"bash","arguments":"{}"},"model_name":"test"}
{"type":"text","message_id":"msg1","chunk":"done","is_complete":true,"model_name":"claude"}
{"type":"done"}

Diagnostics from tracing are written to stderr. Keep stdout and stderr separate when parsing JSON output.

By default, headless mode emits every output event. Use --events to restrict output:

Terminal window
aether headless --output json --events tool_call,tool_result \
"Refactor this module"

Available event kinds:

Event kindDescription
textFinal text chunks.
thoughtFinal reasoning/thought chunks.
tool_callTool invocation.
tool_resultTool return value.
tool_errorTool failure.
errorAgent-level error.
cancelledOperation cancelled.
auto_continueAgent auto-continuing.
retryingAgent retrying after a failure.
model_switchedModel changed through alloying.
tool_progressTool execution progress.
context_compaction_startedContext compaction beginning.
context_compaction_resultContext compaction completed.
context_usageToken usage update.
context_clearedContext was cleared.
doneAgent run completed.

When --events is set, error events are shown only if error is explicitly listed.

Headless mode resolves normal Aether settings from global and project settings unless you provide --settings-file or --settings-json.

Additional MCP configs provided with --mcp-config or --mcp-config-json override the agent’s MCP source list for that run.

Terminal window
aether headless \
--agent Researcher \
--mcp-config .aether/readonly-mcp.json \
"Map the auth flow"

Print the fully assembled system prompt for debugging:

Terminal window
aether show-prompt --agent Researcher

show-prompt accepts --cwd, settings overrides, MCP config overrides, --system-prompt, --agent, and --sandbox-image.

Run declarative eval files in Docker sandboxes. Evals execute aether headless --output json under the hood and aggregate pass/fail results.

Terminal window
aether eval evals/ --output json

See Evals for eval file examples, Docker requirements, and result handling.

Manage project agents:

Terminal window
aether agent new [path]
aether agent list [path]
aether agent remove <name> [path]

See Getting Started and Settings for project scaffolding details.