OAKENMAIL
Generated

CLI

Every `oaken` command, its options and the exit codes — generated by walking the real command-line parser.

The oaken command is a thin client over the local core: every command is one call to a registry operation. It holds no logic of its own, so a new operation is reachable immediately through the generic oaken operation NAME fallback, with no new release.

Output is human-readable by default; --json gives the machine form on stdout (never sanitized — it is the contract a script reads), while logs and errors go to stderr. Text printed to a terminal is stripped of control and escape sequences, because mail is untrusted.

1

Global options

These work before or after the command name:

2

Commands

Command What it does
start Start the core daemon (foreground; --detach for background).
stop Stop the core daemon.
restart Restart the core daemon.
operation Call any registry operation by name (generic fallback).
status Is core running? (does not start it)
search Search the mail (keyword and meaning, merged).
show Show one message (cleaned text, or --raw/--headers).
summarize Summarize messages with the local model.
read Mark messages read.
unread Mark messages unread.
undo Undo a read-state change from the audit log.
sync Sync an account (or one folder) now.
ask Answer a question from the mail, citing the messages.
pipeline Pipeline status: stages, throughput, parked jobs.
usage Model calls and tokens per workspace, stage and model.
plugins List plugins; --check runs the health probe now.
accounts The configured accounts (never credentials).
audit The newest audit-log rows.
operations Every operation with its permission and MCP exposure.
reprocess Bring one pipeline stage up to date.
rebuild-index Rebuild the search index from the raw store.
watch Stream core events as lines (or --json).
agents Create, list and revoke external agents (the swarm).
jobs Lease and finish jobs as an agent (OAKEN_AGENT_TOKEN).
mcp Bridge an MCP client that speaks stdio to the MCP server in core.
enrich Run or show the enrichers (summary, triage, actions, inspector) on a message.
sieve Check, try and list Sieve filter scripts; refilter stored mail.
admin Administration: add and inspect accounts.
auth Store an account's credential (Gmail consent, SMTP or IMAP password).
completion Print a shell completion script (bash, zsh or fish).
3

Exit codes

Code Meaning When
0 ok The command succeeded.
1 error The operation ran and failed, or an unexpected error.
2 usage Bad arguments.
3 core down Core is not running — start it with "oaken start".
4 auth A bad API token, or a provider that needs re-authorizing.
5 needs confirmation A mutation returned a proposal and was not confirmed.
4

Command details

start

Start the core daemon (foreground; --detach for background).

Options:

stop

Stop the core daemon.

No arguments.

restart

Restart the core daemon.

Options:

operation

Call a registry operation directly. The input is JSON on --json-input or stdin. This reaches every operation the daemon offers, including ones added after this CLI was released. 'oaken operation' with no name lists the operations.

Arguments:

Options:

status

Is core running? (does not start it)

No arguments.

Hybrid search: keyword and vector results merged by rank. Operators in the query: from:, before:, after:, label:, in:, -term, "phrase", term*. Each hit says which retriever found it; if the vector side was down the result says so.

Arguments:

Options:

show

Show one message (cleaned text, or --raw/--headers).

Arguments:

Options:

summarize

Summarize messages with the local model.

Arguments:

Options:

read

Mark messages read.

Arguments:

Options:

unread

Mark messages unread.

Arguments:

Options:

undo

Undo a read-state change from the audit log.

Arguments:

sync

Sync an account (or one folder) now.

Options:

ask

Answer a question from the mail, citing the messages.

Arguments:

pipeline

Pipeline status: stages, throughput, parked jobs.

Arguments:

usage

Model calls and tokens per workspace, stage and model.

Options:

plugins

List plugins; --check runs the health probe now.

Options:

accounts

The configured accounts (never credentials).

No arguments.

audit

The newest audit-log rows.

Options:

operations

Every operation with its permission and MCP exposure.

No arguments.

reprocess

Bring one pipeline stage up to date.

Arguments:

Options:

rebuild-index

Rebuild the search index from the raw store.

Options:

watch

Stream core events as lines (or --json).

No arguments.

agents

Agents lease jobs from the queue with a token of their own (the swarm page).

agents create

Register an agent and print its token once.

Arguments:

Options:

agents list

List agents.

Options:

agents revoke

Revoke an agent; its jobs go back on the queue.

Arguments:

jobs

The agent side of the queue. Authenticated by the agent's own token (OAKEN_AGENT_TOKEN or --agent-token-file); the API token is not used.

Options:

jobs claim

Lease the next job.

Options:

jobs heartbeat

Extend a lease.

Arguments:

jobs complete

Hand back a result.

Arguments:

Options:

jobs fail

Report an error.

Arguments:

Options:

mcp

Reads MCP messages on stdin and forwards them to the MCP server inside the running core, writing its answers to stdout. It adds nothing: the tools, the confirmation step and the limits are core's. If core is not running, tool calls answer with a core_not_running error. It never starts core. Point a stdio-only client (Claude Desktop) at 'oaken mcp'.

Options:

enrich

Run or show the enrichers (summary, triage, actions, inspector) on a message.

enrich run

Run the enrichers on one message now.

Arguments:

Options:

enrich show

Show the stored results.

Arguments:

sieve

Scripts are files you edit; these commands never change them.

sieve check

Compile a script file.

Arguments:

sieve test

Run a script on one message and show each effect. Stores nothing.

Arguments:

Options:

sieve list

The scripts core would load.

No arguments.

sieve refilter

Re-run the scripts over stored mail (a job).

Options:

admin

Administration: add and inspect accounts.

admin account

Mail accounts.

admin account list

List accounts.

No arguments.

admin account show

One account and its settings.

Arguments:

admin account add

Asks for the provider, an id, a name and the provider's own non-secret settings, then stores them. The credential is stored afterwards with 'oaken auth'. Give --provider, --id and --name (and --set) to skip the questions.

Options:

auth

gmail opens Google's consent and waits; smtp and imap read the password without echo. Nothing is ever printed, taken as an argument, or written to disk: the credential goes to the OS keyring.

Arguments:

Options:

completion

Install with, for example: eval "$(oaken completion bash)".

Arguments: