rkat is designed for three main workflows:
- interactive terminal use
- scripts and CI
- Unix pipes and chained command composition
Global flags
The top-level parser exposes the same realm and convention-root flags to each command family:--confinement flags select the OS process confinement of the shell,
command hooks and MCP stdio servers this invocation launches, replacing the
[confinement] config section for every launch kind; see
OS process confinement.
--default-model <model> persists the default agent model into the
scope-resolved config (project/user/realm resolution included) and exits when
given without a command — rkat --default-model claude-fable-5 is the
one-liner for switching what every future run talks to. The model is
validated against the catalog and configured custom models.
In a governed realm (see realm), --as-agent <agent> acts as
that agent: its executor and the grants the operator selected for it. The
default agent is rkat-agent.
By default, CLI commands use the current directory as the invocation context
and derive a stable workspace realm id from that path. For project-local state,
StorageLayout walks upward to the nearest ancestor containing a .rkat
entry and stores realms under <project-root>/.rkat/realms/<realm>/. When no
ancestor contains .rkat, the context root is the project root fallback.
A realm that already exists under a farther ancestor’s .rkat/realms is used
where it lies; a realm found under more than one root is refused, and the
refusal names both realm directories and the two ways out.
--context-root changes the derived workspace identity and the starting point
for that ancestor search; it does not necessarily change the project root when
both contexts are inside the same project. --state-root bypasses discovery
and changes only where realm directories are stored.
Some maintenance or host commands reject combinations that have no safe
meaning. In particular, storage verbs reject --isolated and
--default-model, and rkat mob host rejects --isolated.
Fresh prompt-first runs and rkat help are fail-soft only at the default
workspace storage boundary. If the workspace-derived realm cannot be opened,
no historical session from that realm is loaded into the fresh run, and the
explicit compatibility bridge is never invoked automatically. The ordinary
strict open may already have completed supported manifest initialization or an
earlier domain migration before a later store refuses. The CLI warns and
creates a new generated realm using durable SQLite under the same resolved
state root. The workspace’s configuration, auth policy, provider selection,
and tool policy remain in force; only persistence-owned state is isolated in
the generated realm. The warning names both realms and prints the explicit
recovery command:
--realm, --isolated, every resume form, and all session
commands remain fail-closed. Historical session access therefore stays an
explicit maintenance operation. The fresh-run fallback is never an in-memory
session and never makes a historical session from the failed workspace realm
part of the new run.
Common commands
Prompt-first usage
Common run flags
-m, --model <MODEL>-o, --output <text|json|html>--json-s, --stream--no-stream--no-web-search--export-atif(write an ATIF trajectory to the realmtrajectories/directory after the turn, with one metered step per provider request: each tool-call turn, the answer, and each structured-output extraction request; default off)--resume[=<SESSION>]--skill <BUILTIN_ID>repeatable-d, --max-duration <DURATION>-t, --tools <safe|workspace|full|none>--stdin <auto|blob|lines|off>--keep-alive--wait-for-mcp--mcp-auth <stored|interactive>-v, --verbose
--stream or --verbose, rkat run prints one token line per provider
request (N tokens (I in / O out, C cached, R reasoning), extraction requests
labelled extraction:) and closes with total:, the run’s own run_usage.
Input counts are presented input, so cached input is included on every
provider. Before exiting, rkat run waits for the session event log
(.rkat/sessions/<id>/events.jsonl and the realm event store) to finish
writing and warns on stderr if it cannot.
For the full advanced set, use:
Tool presets
rkat uses presets instead of many enable/disable booleans.
--yolo is an alias for --tools full.
Scheduled deliveries
A realm’s schedules are delivered by a schedule host. Anrkat run whose mob
tools are on (--tools full, or tools.mob_enabled in the realm’s config)
starts one for the realm, for as long as the command runs. A run without the
mob tools and rkat resume start none: a schedule that falls due while only
such a command runs is not delivered by it. The servers (rkat-rpc,
rkat-rest, rkat-mcp) host schedules for as long as they run.
While such a run’s schedule host is up, a fire for a session target
(exact_session, resumable_session) is delivered:
- into the run’s own session, when that session is the target: the run’s live session takes the scheduled input, and no second live copy of it is built;
- into any other stored session of the realm, by making it live in this
process. The session is composed as
rkat resume <id>composes it with no flag: its stored tool flags, the realm’s MCP servers and mob tools, its bindings. Nothing is added to the session but the scheduled input. As withrkat resumewithout--wait-for-mcp, the scheduled turn can start before the realm’s MCP servers have connected. The session stays live until the process ends, and a later fire for it is delivered into it.
- a session that another process serves (or another runtime of this process)
is never made live a second time. The fire fails with the occurrence’s
failure class
target_materialization_failedand a detail that says another runtime owner on the realm serves the session; - on a store whose locks cannot be trusted (its filesystem’s), the host cannot tell who serves a session, so it never builds one for a fire: the fire fails the same way and says so.
- a stored session that is not resumed fails the fire with
target_materialization_failedand the reason in its detail: a help session (its tools exist only in the live session that ended), or a record the session service refuses to build from; - a store that does not answer the load of the stored record is “not now”,
not a failure: the occurrence stays owed, and the driver drives it again
once its claim on it has lapsed (60 seconds). What happens then follows the
schedule’s misfire policy: under
skip, whose grace is 30 seconds, the late occurrence is marked misfired; with a catch-up window that covers the wait it is delivered; - in a governed realm the schedule host refuses the fire before any session is
made live (
schedule_mandate_unavailable), as it does for a session a schedule would create.
- it lends its timer to the realm’s WorkGraph store as this process opened
it for the host, so
workgraph_waitis offered on that store’s tools and a wait’s deadline fires in this process; - a wake for a session is delivered as a scheduled prompt for that session is, by the rules above: into the run’s own session when it is the waiter, and into any other stored session of the realm by making it live in this process. The wake is one turn of the session, and a wake delivered again admits nothing;
- a stored session the host makes live has the tools its record names. A run
records whether it had the WorkGraph tools (
--tools full, ortools.workgraph_enabledin the realm’s config), and a session it stored is made live with them or without them as recorded; a record that holds no choice follows the realm’stools.workgraph_enabledas it is then. Where the session has the WorkGraph tools, they stand on the store the host lent its timer to: the turn a wake starts there is offeredworkgraph_waitandworkgraph_wait_status; - a wake whose session cannot be made ready stays owed in the store, and
rkat workgraph waits --owedshows it. Where the reason may pass (another process serves the session, the store does not answer) the host delivers the wake again later. A stored session this host never makes live, by a fact of its record or of the realm’s store (a help session, a record with no session metadata, a mob member’s session, a record the store cannot read, a store whose locks cannot be trusted), is asked for no delivery: its wake stays owed until a host that states this of the session makes its first pass at or after seven days after the wait’s deadline, and that pass ends it asundeliverable. A run’s host ends with the run, so onrkatthat pass is this run’s, or a later run’s that hosts waits; another host on the realm that can deliver the wake may still deliver it before then. A stored session whose record the session service refuses to build from is found only when it is built: this host refuses that wake for good, the wake stays owed, and this host does not deliver it; - the wake of a session that was archived (
rkat session delete) ends: it reads asundeliverableand is not delivered.
rkat as a wait host: only such a run hosts waits. A run
without the mob tools, rkat resume and the other commands lend no timer and
deliver no wake, and a run’s host ends with the run. A wait is not lost by
that: its record and its owed wakes are in the realm’s store, and the next
host that serves the store (a later run with the mob tools, or a server on
the realm) takes them up as the
reference describes.
Three stated limits of what rkat says about a stored session it never
makes live:
- on a realm whose hosting locks cannot be trusted (its files are on a
network or userspace filesystem, or the filesystem could not be asked),
rkatcannot tell whether another process serves a stored session, and makes none live. Every stored session that is not live in the process is then one it never delivers a wake to; - a record
rkatcannot decode counts as one the store cannot read. An olderrkaton a realm that a newer release writes says so of such a record: the wake keeps its seven days, a host of the newer release delivers it at its first pass, and otherwise the older host ends it asundeliverableat its first pass at or after the deadline plus seven days; - whether the hosting locks can be trusted is read when a store is opened: for this statement when the run’s host opened the realm, for a delivery when it opens the realm for the session. Where the filesystem check fails at one of the two and answers at the other, the two can differ.
Provider and structured output controls
Use--param for common tuning and --params-json as the escape hatch:
--reasoning-effort <LEVEL> sets the provider-neutral
reasoning effort of the session:
none, minimal, low, medium, high, xhigh or max. Meerkat checks
the level against the model on the route that serves the request and writes
the provider’s own field; a level the model or route does not accept is
refused before any provider request with
exit status 2. It composes with
tools, --schema and --stream, and --output json reports what was sent in
the result’s reasoning_effort block:
--resume the flag changes the session’s level from that turn on,
--no-reasoning-effort removes it, and neither keeps the level the session
recorded:
--param reasoning_effort=high is the same setting; a command that gives
both must give the same level. Otherwise the command exits 2 (an invalid
request), and with --output json its failure document has the code
INVALID_PARAMS.
Structured output is file-friendly:
--json is a convenience alias for --output json.
With JSON output, stdout ends with exactly one JSON document: the run result
when the run succeeds, the pending document ("status": "pending_tool_call")
when it stops to wait for an external tool result, or the
failure document
({"error": {...}}) when it fails. A script reads the document’s top-level
keys, not whether stdout is empty: a failed run writes to stdout too. Exit
statuses are the same in every output mode, and stderr still carries the
Error: line. With --stream, the streamed text comes first and the
document last. rkat has no JSON-lines event output.
HTML output asks the agent to make the final answer a standalone local HTML artifact:
--html is a convenience alias for --output html. --browser is a compact
shortcut for HTML output plus --open-in-browser. HTML output writes the file
under the active realm’s presentation/html directory and prints the path.
The Config schema accepts template defaults under [presentation.html]:
presentation
section. On that path, the accepted config above does not supply a custom
default or named template to the HTML resolver. This is a composition
limitation, not a limitation of direct Rust consumers of a parsed Config.
Use the builtin template or a file read directly by the run command:
--html-template-file bypasses configured-template lookup. HTML output itself
remains available.
Streaming defaults
- In a TTY, text output streams by default.
- In pipes and scripts, streaming is off by default.
- JSON and HTML output stay non-streaming by default so stdout remains machine-friendly unless
--streamis explicitly requested.
Stdin modes and Unix pipes
rkat treats piped stdin as a first-class interface:
autodefault: if stdin is piped, read it as one blob of context; input that has not started within 2 s is skipped with a warning, so an open, silent stdin never blocks the runblob: always read full stdin to EOF before running, however long the producer takes to startlines: keep stdin open and process one line at a timeoff: ignore stdin even if something is piped in
--line-format json treats each incoming line as JSON instead of plain text.
run —resume
SESSION_ID accepts:
- a full UUID
- a bare UUID prefix or tail handle
<realm>:<uuid>, where<realm>matches the active realmlast,~, or~0for the most recent session~Nfor the Nth older session (~1is one before the most recent)
last, so rkat run --resume "keep going" and rkat run --resume last "keep going" are equivalent.
When --resume is followed by the run’s only positional argument, that
argument is the prompt and the session is last. A lone argument that names a
session (a UUID, <realm>:<uuid>, a hexadecimal handle of 8 to 36 characters,
last, ~, or ~N) is read as the session instead, and the prompt is still
required. Option values, such as gpt-5.5 in -m gpt-5.5, are not
positional arguments.
The CLI displays short handles as the final eight UUID characters. Ambiguous
prefix/tail matches fail instead of selecting a session. A qualified locator
does not switch realms: select the matching realm and storage root first.
Relative aliases and short-handle lookup require session-store support.
Quote tilde aliases so the shell does not expand them.
Resume supports the same stdin model as run, plus per-turn tool overlays and provider params.
Self-hosted aliases work the same way:
session
session no-action-record prints the session’s no-action record as JSON:
the run_id and the reason of a run that ended by declaring no action
with the no_action tool. It prints the word none when nothing is on
record: the last run did not declare, or something was stored after the
run that did. rkat reads the stored session and hosts no run: a later
run that another process hosts and that has stored nothing yet is not
known to it, so the earlier run’s record is still printed until that run
stores something; --run-id with the later run’s id prints none. With
--run-id, the record is printed only if it is that run’s, as
session/no_action_record answers run_id over JSON-RPC.
session export-atif reads the currently available event audit/replay
projection. A slow live subscriber can receive a typed stream-truncation
marker without dropping projector input, but projection is asynchronous
best-effort derived state and export does not first drain it to the latest
committed session boundary.
session repair-wholeblob diagnoses, and with --apply repairs, a WholeBlob
session whose every send reports reload_required; see
Storage operations.
session resolve-held-tail reports why durable-tail recovery holds a
session’s tail as ambiguous (tail_held_for_recovery), or holds an
interrupted tail beside inputs another run left staged or queued (a shape
only pre-release builds of 0.9.5, or a store fault, leave), and what the
repair keeps, answers, ends and requeues. With --apply it commits a repair
the runtime machine authorizes as an interrupted run. Stop every host of the
session first: the repair is refused while the persisted lifecycle row is
not quiescent, and an idle live host is not detected. A row a host left
Stopped when it ended before unregistering (no current run, no unregister
in progress) counts as the Idle row a start would normalize it to: the
report says so, and --apply writes it with the repair. The command never
retries.
See Storage operations.
Meerkat supports ordinary durable-state opens from 0.8.10 onward. For an older
SQLite realm, stop every process that can access it and run the explicit
current maintenance bridge:
blob
blob get writes the decoded raw bytes to stdout.
--output writes those bytes to a file. --json prints the complete
BlobPayload (blob_id, media_type, and base64 data) instead of raw bytes. Blob
IDs are realm-scoped, so use the same realm that produced the session or
artifact reference.
realm
realm current prints the realm selected by the CLI scope. realm list and
realm show inspect manifests in the active state root. realm prune defaults
to a 24-hour age threshold. --force bypasses active-lease safety checks, so
use it only after confirming that no process still owns the target realm.
Neither command removes a realm that another realm’s own config document
names as its parent, --force included: the refusal (or prune’s
kept_parents note) names the child, which would otherwise stop composing
the parent’s [confinement] and [governance]. Nor does either remove a
realm an admission holds: both take the realm’s
admission fence first, without waiting and
before the lease check, and hold it through the removal. realm delete then
exits 58, --force included (it overrides heartbeat leases only), and
realm prune keeps the realm, counted as active.
realm govern makes an existing realm governed, durably, with the local user
as operator; every later rkat process opens it governed, and no flag selects
that posture. realm grant then issues a named agent (default rkat-agent)
one grant per target: an installed MCP server and its raw operations
(--mcp <server>=<op>[,<op>...], or <server>=* for all of them), the tool
catalog (--catalog), or the agent’s controller (--controller with one or
more --route <key>; a controller grant has no expiry). A new grant
supersedes only its target’s previous one.
In a governed realm rkat attaches a configured MCP server only when it is
the realm’s own installation (rkat mcp add --scope realm) with an operation
ceiling (--allow-operation). A server from mcp.toml, one the realm
inherits from a parent, and an installation without a ceiling are refused
before the server is started (attachment authority is unavailable), and
their tools are not offered. Install the server with its ceiling first, then
grant it (realm grant --mcp): a grant for a server that is not one of the
realm’s own installations is refused. Both steps work when the realm is
already governed.
In a script, check the exit code of each rkat realm command: after a failed
realm govern the realm may not be governed, and the commands that follow
then run against an ordinary realm.
realm revoke-grant revokes the grant selected for one target and exits
successfully only when it is revoked. Use the global --as-agent to run as a
granted agent. realm govern, grant and revoke-grant take the realm’s
admission fence first, waiting up to 5 s for an
admission that holds it: past that they exit 58, and 59 when the fence
cannot be used, with nothing written.
config
--json (or --toml for set).
rkat config set takes a full config. In JSON (--json, or a .json file) it is a JSON object: a JSON array is refused. In JSON and in TOML, a top-level key or table that the config does not hold (a misspelled section name, for one) is refused, as is a top-level config key (a read envelope or a set request in place of a config). A refused set writes nothing. One limit stands: a section given as a JSON array inside an otherwise valid config ({"retry": []}) is still read by position by the config type, an empty one as the section’s defaults.
rkat config patch takes a JSON merge patch of the config, which is a JSON object. A patch that is not one (it would replace the whole config) and a patch that names a top-level key the config does not hold are refused, and nothing is written. A null for such a key is still applied: it removes a stale key from the document. One limit stands: rkat config patch reads its JSON into a value in which the last of a repeated member is kept, so a patch that names a member twice is not refused here, and the last one is applied.
rkat config get shows <redacted> in place of each stored secret value, in every format; the realm’s document file holds the values. A document written back with <redacted> in a place keeps the value stored there (see Secret values in config answers).
Examples:
auth
rkat auth profile prints the profile’s id, provider, auth_method and
source_kind as JSON, the auth_profile shape JSON-RPC auth/profile/get
returns. It never prints a credential value: not an inline_secret source’s
secret, nor a command source’s arguments or environment values.
<PROVIDER> is anthropic, openai, gemini, or copilot (GitHub
Copilot: the device sign-in interactively, a GitHub token with
--non-interactive; see
GitHub Copilot with a service-account token).
connector-client manages the
realm’s connector OAuth clients: writes go to
the realm’s own config, and client secrets go to the credential store, read
from stdin and never from the command line.
Interactive OAuth/device rkat auth login writes nonsecret backend, auth
profile, and binding declarations into the reserved global config doc
at ~/.rkat/config.toml. Secret tokens are stored separately through
TokenStore. The stock CLI uses
<platform-config>/meerkat/credentials/global/<credential-stem>.json,
where the platform config directory comes from dirs::config_dir(); files
are created with mode 0600 on Unix. --user-config-root changes the config
document location, not this TokenStore root. Custom hosts can select a keyring
or another store.
Interactive login therefore materializes global as the optional chain tail,
after which a single sign-in is inherited by workspace realms without a
per-realm re-login. Earlier dev-realm logins are
migrated to global on the run path (one-time, idempotent, no-clobber), so an
existing sign-in keeps working without re-auth.
--backend and --method are accepted but ignored during interactive login;
the provider determines its OAuth/device flow. In --non-interactive mode,
--method selects an allowed persisted-secret mode (default api_key), and
--backend is token metadata, not backend provisioning or full tuple
validation. Scripted login saves a token under global:default_<provider> but
does not create backend/auth/binding config or materialize global config.
Using that token requires an already-configured matching managed_store
binding; see the scripted API-key example. Alternatively,
use environment-key auth. If --secret is omitted, scripted login reads one
line from stdin.
copilot is the exception. rkat auth login copilot --non-interactive
checks a GitHub token (from --secret or one line of stdin), stores it under
the shared github_copilot credential account, and writes the three Copilot
routes global:copilot_openai, global:copilot_anthropic and
global:copilot_gemini with auth_method = "github_copilot_token". With
--from-env it stores nothing and writes routes that read
COPILOT_GITHUB_TOKEN, then GH_TOKEN, then GITHUB_TOKEN, checking the
token when one is set. A token that fails the check is never stored, and
--backend and --method are refused. Both rkat auth login copilot forms
refuse, before writing anything, a [realm.global] that configures its
Copilot account once in a [copilot] section (see
GitHub Copilot configured once).
Runtime credential reads inherit down the realm chain. CLI auth
administration differs: --realm on profile, status, test, and refresh
commands selects an owner section within the scope’s already-loaded effective
config (normally the workspace/global chain). It does not by itself discover
<state-root>/<selected-realm>/config.toml or inherit a missing profile/binding
for those subcommands. The selected owner’s sections must already be reachable,
for example through a workspace parent link at the same state root or a
multi-section workspace/global document. The default owner section is global.
HostAuthService and RPC/REST credential writes are strict-owner and
reject child-addressed inherited writes. Current CLI logout exception:
when the loaded config resolves child:<binding> to an inherited owner,
rkat auth logout child:<binding> can clear that owner’s stored credential,
including a shared credential account used by other routes. Explicitly address
the true owner instead. A bare logout binding means global; --realm does
not retarget logout. Config get / set / patch still operate on the raw
head document.
See Realm inheritance and the
auth guide for the full model.
models
self_hosted aliases and their server_id.
doctor
ok config <path>, or
warn config missing config at <path> when the realm has none yet. A
warn config line also names a project .rkat/config.toml whose
[confinement] or [governance] table is not what is in effect, with where
the section is read from (see
config files); that line is a warning
only and does not change doctor’s verdict.
For self-hosted setups, doctor checks the normalized /v1/models endpoint for each configured server and warns when configured aliases are missing from the returned model list.
For Gemma 4, prefer chat_completions in your server config unless you have validated a specific responses path for your serving stack.
Follow Self-hosting models for the full Gemma 4 examples.
storage
Storage administration verbs. All of them dispatch before realm resolution, so they run against the exact on-disk state they diagnose — including split-brain realms the normal resolver refuses. Because no runtime scope is resolved, the global--isolated and --default-model flags are rejected
as usage errors on every storage verb rather than silently ignored; scope
the sweep with --realm, --root, or --state-root instead.
-wal/-shm sidecars needed for a coherent WAL read.
With no root given, storage doctor reads the roots ordinary runtime
resolution probes: the .rkat/realms of the context root and of every
ancestor that has a .rkat directory, and the user-global root. A realm
present under more than one of them is reported with both directories.
storage migrate and storage prune act on the invocation-context-local
(<context-root>/.rkat/realms) and user-global roots by default, and on an
ancestor’s root only when --root names it;
any explicit root (--state-root or repeatable --root) restricts the
sweep to exactly those roots. --realm focuses the sweep on one realm.
Reports per-root realm inventory, schema-ledger state per database,
dual-root twins, dangling session→blob references, orphaned
lease/lock/backup artifacts, and the SQLite lock profile the rkat binary
runs with (a sqlite-lock-profile warning when a process-wide lock is on). It
also lists, as informational findings, the sessions written at session
envelope 5 (operator-instruction-envelope) and the mob databases that hold
operator-instruction events (operator-instruction-mob-events), which a
release before 0.9.9 refuses, and the identity-store rows of schema version 2
or later of each mob database that holds any (identity-store-rows, counts
only), which a release before 0.9.9 does not read (see
Downgrading to 0.9.8), and the mob
databases whose journal holds more than 64 operator instruction records or
more than 1 MiB of Active bodies in total
(operator-instruction-mob-totals), which a release before 0.9.15 cannot
serve (see
Rolling back to 0.9.14). Exit 0
means no error-severity findings; exit 1 means errors were found.
migrate is dry-run by default, offline, resumable, and fail-closed. It
sweeps the same roots (and honors the same --realm filter) as storage doctor. The dry run reads each realm’s schema-ledger baseline read-only —
no fence, no store opens, no mutation. --apply acquires the realm’s
exclusive maintenance fence (--fence-wait-secs, default 10, bounds the
wait for in-flight store operations to drain and kept connections to close),
then per realm: stamps
ledgers by opening every store through its normal constructor under the
held fence and reports state-root adoption (report-only — realms are used
where they lie). Exact 0.8.10 session-state conversion is owned by each
backend’s activation transaction, which binds the released schema, key, and
source bytes before installing current store authority; storage migrate
does not bulk-adopt documents or defer conversion to ordinary reads. A realm
materialized under multiple swept roots is a fail-closed refusal unless
--apply --adopt-root <path> names the swept root whose copy to keep:
every copy is fenced first, the divergence report is recomputed under the
held fences, and archiving is gated on that comparison being conclusive
(an unreadable entry poisons it and refuses) — then every other copy is
archived read-only under the registered *.pre-<version>-<timestamp>
backup naming. Divergent data is preserved and reported, never merged.
Before its maintenance fence, the resolution takes each copy’s
realm admission fence without waiting and holds
it through the archive: while an admission holds any copy, the resolution is
refused, naming the fence.
Per-mob databases under mobs/ are report-only, and credential stores are
never read, moved, or reported. Exit 0 = clean; exit 1 = errors or
fail-closed refusals (split-brain without --adopt-root, unacquirable
maintenance fence, a held or unusable admission fence).
--bridge-pre-0-8-10 is an explicit --apply-only maintenance lane for
SQLite realms. JSONL and memory realms are rejected before any database is
mutated. While the realm fence is held, it runs a frozen importer before the
normal store constructors. A domain is authenticated as exactly one
caller-authorized source catalog; an unknown or ambiguous catalog refuses that
domain instead of being inferred or stamped, and each domain owns its own
transaction, so a domain that committed stays committed when a later one
refuses. The same authentication answers the eligibility sentence an ordinary
open prints, so a realm the bridge recovers is never described as
unrecoverable and a realm it cannot recover is never handed this command.
Row admission is per record, not per domain. Every runtime input row is
carried forward when it decodes through the current typed contract and
re-encodes without losing a field; a row that cannot be is left with its
bytes exactly as found - never deleted, never blanked - and named in the
output with the reason and the consequence. Rows are preserved in the current
representation without being scheduled or replayed, and that includes their
ingress payloads: a rescued realm keeps the operator’s own prompt whatever
lifecycle state its input reached. A later session activation follows normal
recovery, which applies this binary’s ordinary payload retirement to rows it
writes itself. Ordinary store opens never enter this bridge.
prune owns the lifecycle of registered maintenance artifacts only —
*.pre-<version>-<timestamp> migration backups and *.corrupt-<timestamp>
index quarantines; nothing outside those naming patterns is ever touched.
The default run lists artifacts with sizes and ages; --apply deletes
those at least --older-than-days (default 30; 0 = all) days old. Age
comes from the timestamp embedded in the registered name, not filesystem
mtime — renames preserve mtime, so a long-idle file archived today would
otherwise look instantly prunable. --realm restricts eligibility to one
realm’s artifacts. Exit 0 = clean; exit 1 = deletion failures. Not to be
confused with rkat realm prune, which deletes whole realm directories.
hosts-fences reports whether each directory’s filesystem can host a realm
admission fence. It runs, in this process’s own view of the filesystem, the
one predicate that fence writers, holders and verifiers use, and prints one
JSON object per directory, one per line, in argument order, and nothing else
on stdout: {"dir": "<path>", "hosts": true} (or false), or, when the
directory’s filesystem could not be inspected (a directory that does not
exist, for one), {"dir": "<path>", "unavailable": {"kind": "<kind>", "cause": "<text>"}},
where kind is a stable snake_case name and cause is for people. It runs
before any realm, state, config or auth step, creates nothing, and takes no
global option (giving one is a usage error). Exit 0 when every directory was
evaluated, whatever the answers; exit 1 only when the report could not be
written; exit 2 on a usage error, or when the process could not start at all
(for example, a refused thread spawn), as for every command. See
Realm admission fences.
mcp
rkat mcp manages the selected realm’s own MCP servers (--scope realm) and
the project and user mcp.toml files.
--scope realm writes [[tools.mcp_servers]] in the realm’s own config (the
realm selected by --realm), which its child realms inherit. Only that list
changes; the rest of the config document is kept as written.
--expected-generation refuses the write unless the realm config is still at
that generation (rkat config get --with-generation). A server that a realm
only inherits is removed in the realm that configures it. Realm servers are
literal: --scope realm refuses a ${VAR} reference in the command, args,
-e values, URL or -H values; put env-derived values in mcp.toml.
--allow-operation <OPERATION> (repeatable) allows only the named raw MCP
operations on the server; every other operation is refused and not offered.
--oauth-account sets the OAuth account a streamable HTTP server’s login
must prove (the provider subject ID, not an email or display name).
--oauth-account-selection discover binds the account the provider verifies
at the first login instead, and --oauth-account-selection unverified is an
explicit opt-in to resource-bound access with no account evidence; the two
flags conflict. add prints the selection it wrote, and for a streamable
HTTP server without either flag (and without a static Authorization
header) it names these choices in case the server uses OAuth sign-in.
Examples:
--scope on list or get to search all configured scopes, the realm
included. An mcp.toml server that names an environment variable that is not
set is listed with nothing expanded and marked unresolved with the field and
the variable’s name (--json: the entry as written, with an unresolved
object holding field and variable); the other servers are unaffected.
The text forms of list and get mask every env and header value and show a
URL without its userinfo and query. --json prints the values as the server
is given them.
HTTP OAuth is discovered when connecting, not stored in .rkat/mcp.toml.
Interactive login requires an account selection on the server entry: its
oauth_account (the account the login must prove; the OpenID Connect sub
for the default strategy), or oauth_account_selection = "discover" (bind
the account verified at the first login) or "unverified" (an explicit
opt-in for servers that cannot prove an account; no account is verified).
rkat mcp add writes them (--oauth-account, --oauth-account-selection);
rkat mcp get shows them. rkat mcp login never sets or changes a
selection. Without one it refuses before any network request and prints the
rkat mcp remove and rkat mcp add commands for each choice. discover
and --oauth-account need account evidence: the default strategy reads the
issuer’s OpenID Connect UserInfo endpoint, and an issuer without one is
refused before client registration, with no credential stored and the
selection unchanged; the refusal says to retry first if the issuer could not
be reached, and names unverified as the deliberate alternative. A slot that
holds a credential this login may not replace is refused with the way to
disconnect it (RPC auth/logout with the MCP target, or the SDK helpers;
rkat has no disconnect command). The printed commands single-quote the
server name and URL, so they paste as shown. A login, including one during
rkat run --mcp-auth interactive, reports the account it bound, or that the
credential is unverified.
Use rkat mcp login <NAME> to open the browser flow ahead of time
(--allow-headless permits it without an interactive terminal and prints the
authorize URL to stderr if no browser opens, so avoid it where output is
captured or logged), or
rkat run "..." --mcp-auth interactive to allow a TTY run to authenticate
when an HTTP MCP server with an account selection first requires it. The CLI
owns the loopback callback and your browser; agents never see the authorize
URL or callback data. The default --mcp-auth stored uses persisted tokens
only, and a server without a usable credential is reported as awaiting human
authorization.
mob
rkat mob is the artifact, typed callable run, and operational run-resource
surface. Runtime semantics still live in the shared mob runtime; the CLI only
binds to it.
rkat mob hoststarts only the signed member-host and optional live listeners. It uses the workspace-derived realm (or explicit--realm) and rejects--isolated; it does not expose an RPC, REST, or MCP console.- When enabling the host pairing branch, prefer
--pairing-password-envor--pairing-password-fileso the secret does not appear in process arguments. The three pairing-secret options are mutually exclusive;--pairing-passwordremains available for compatibility. Pairing secrets must be at least 32 bytes and are validated before host startup effects. Pairing is accepted only on an IP loopback listener because it returns the one-time binding descriptor over the plaintext comms transport. Use the 0600 descriptor out-of-band for remote hosts, or tunnel a loopback listener. rkat mob bind-hostconsumes the descriptor JSON written byrkat mob host --descriptor-out; the 0600 descriptor carries a single-use bootstrap token, and the bind report (host id, authority epoch, capability record) prints as JSON.grant,revoke-grant, andgrantsmanage the closed control-scope set:list,read_history,subscribe_events,send_command,cancel,retire,wire_topology,live,admin_host, andadmin_grants.rkat mob live openprints the wireLiveOpenResultJSON — including the live URL and single-use token — to stdout only; stderr carries a token-free note. The socket it names is the input plane: there is nolive sendverb.--transportis the member’s own live host’s to serve or refuse. A member host started byrkat mob hostserves WebSocket only, so it refuses--transport webrtc(LiveTransportUnsupported), and the one-shot CLI composes no live host for a member it runs itself. WebRTC to a member goes through JSON-RPCmob/member_live_openwithtransport: "webrtc"andlive/webrtc/answeron the same server. Session-scopedlive/openrefuses a mob member’s session, and controllersession/*methods do not proxy a placed member’s host-local session in multi-host v1.- Mob verbs exit with typed codes: scope denied
45, host unavailable46, stale cursor47, stale fence48, and stale delivery scope56(the member’s session rotated under a still-current fence; capture the delivery scope again), each with a one-linedetail: {...}JSON rendering on stderr. Everything else keeps the generic exit1. - Durable member role migration is not a CLI spawn option. The one-shot
resume_from_roledeclaration is restricted to trusted in-processSpawnMemberSpecconstruction and the private member-host materialization protocol. CLI helpers, public RPC/SDK spawn requests, REST, MCP, and standing profiles cannot grant it.
Trust policy
--trust-policy strictrejects unsigned packs and unknown signers--trust-policy permissiveallows unsigned packs with warnings but still rejects invalid signatures
Web build prerequisites
The CLI does not compile wasm32 itself.--wasm is required and must point at
the prebuilt meerkat-web-runtime artifacts — either the wasm-pack --target web
output directory (which holds meerkat_web_runtime.js +
meerkat_web_runtime_bg.wasm) or that *_bg.wasm file (the sibling .js glue
is copied alongside). mob web build copies those artifacts into its output.
wasm-pack is one way to generate the required input:
index.html (it includes the glue, a meerkat-bootstrap.js module, and the
mobpack). The generated page trust-verifies the package and initializes the
WASM runtime only. It does not call mob_create, spawn members, or provide a
transcript UI; integrate the package with the generated WASM glue or
@rkat/web to build those application flows.
skill
workgraph
rkat workgraph provides operator lookup plus narrow goal and attention controls for the active realm.
default, in the selected
realm: other --namespace values and --all-namespaces are refused.
rkat workgraph waits reads how the realm’s
waits and their
wakes stand, from the realm’s store, with no host running. It lists, newest
first, the waits that still wait and the waits that owe a wake: one line per
wait with its id, its state (waiting, satisfied, timed_out,
item_closed), its
deadline, how the waiter’s wake and the owner’s wake stand (not_owed,
owed, delivered, undeliverable, owner_not_found) and its item. A
wait that is not for the close of the item itself says after the item what
it is for: (on checklist), (until evidence, above 2) or
(on checklist, until evidence, above 1), the number being the evidence
count the wait was opened at. Once such a wait has ended the note also says
what ended it, as in (until evidence, above 2, ended by item_closed_first).
--owed keeps the waits that owe a wake, --session the waits of one
session, --item the waits on one item; --limit bounds the list (50 by
default, at most 200). A wait that ended and owes nothing is not listed:
read it with --wait <WAIT_ID>. A wait id that names no wait is an error,
and so is a wait asked for together with a --session that is not its
waiter. --json prints the page (waits and truncated) as the JSON-RPC
method workgraph/waits answers it.
Agents mutate WorkGraph through workgraph_* tools. The CLI exposes only the
narrow trusted goal/attention controls above; attention continuation injection
remains runtime-host owned rather than a REST-backed CLI command.
capabilities
init
.rkat/config.toml as a copy of the user document
(~/.rkat/config.toml, created from the template when missing). A run reads
only the hook entries of that file; every other setting of a project goes in
its realm document (see config files).