Skip to main content

Module cli

Module cli 

Source
Expand description

The command line, declared with clap’s derive API. Every command starts from the same RepoArgs; capabilities reaches the registry through the registry’s own introspection capabilities, so no list of capabilities lives here.

Re-exports§

pub use docs::tree;
pub use docs::document;
pub use docs::render;
pub use docs::route;
pub use docs::ArgDoc;
pub use docs::CliDocument;
pub use docs::CommandDoc;
pub use docs::ExampleView;
pub use docs::PossibleValueDoc;
pub use docs::SetupView;
pub use docs::DECLARATION;
pub use docs::ROUTE_PREFIX;
pub use docs::SCHEMA;

Modules§

docs
The command line as documentation data.
local
Why a command of the command line is not itself a capability.

Structs§

BenchArgs
majordomus bench.
BriefArgs
majordomus brief: the brief.session capability on the command line (ADR 0136).
CapabilitiesArgs
majordomus capabilities.
Cli
The command line: one of the commands below.
CommandExamples
The examples of one command, by the command’s path without majordomus. The root is the empty string. cli::validate refuses a set whose command the clap declaration does not have, a command that can be run and has no set, and an example whose argv this crate’s own parser does not accept.
CommandsArgs
majordomus commands.
CommandsBridgeArgs
majordomus commands bridge.
CommandsGraphArgs
majordomus commands graph.
CommandsListArgs
majordomus commands list.
CommandsShowArgs
majordomus commands show and explain.
CommitArgs
majordomus commit: the commit as a value.
CompletionArgs
majordomus completion.
CompletionInitArgs
majordomus completion init.
CompletionInstallArgs
The arguments of completion install.
CompletionQueryArgs
majordomus completion query.
ContinuityArgs
majordomus continuity. The output shape is global, so it reads where a person writes it, and the group runs nothing of its own.
ConvergenceArgs
majordomus convergence: whether any of this repository’s work is held where only one disk can see it. It exits 10 when it is, so a hook or a script refuses on the verdict rather than on a parsed report.
DashboardArgs
majordomus dashboard. Every subcommand is one page of the Dashboard Suite, run through the capability that answers it.
DeliveryArgs
majordomus delivery: every product feature against the delivery invariant. The output shape is global, so it reads the way a person writes it — delivery report --format json.
DevcontextArgs
majordomus devcontext. Every subcommand is the projection of one devcontext.* capability; the request flags are declared once and shared by compile and explain.
DevcontextRequest
What to compile a context about; every flag is optional, and naming nothing is a legitimate request.
DevtaskArgs
majordomus devtask. The output shape is global, so a person writes it where it reads naturally — devtask issue I0901 --format json — and it is declared once.
DistributionArgs
majordomus distribution.
EconomicsArgs
majordomus economics. A group with no action of its own: a subcommand is required, and each one is either the command line of an economics.* capability or one of the three producers of evidence that cli::local classifies as command-line-only.
EconomicsCheckArgs
majordomus economics check. It takes no filter, because a gate that could be narrowed could be narrowed past the claim it exists to refuse. It exits 10 when it finds a quantity stated beside the economics vocabulary in hand-written prose, or a bound claim whose evidence does not stand.
EconomicsExplainArgs
majordomus economics explain. The metric is a required positional identifier, spelled as the summary lists it; one the methodology does not declare is refused as not found, with the declared metrics named, rather than answered with an empty explanation.
EconomicsMeasureArgs
majordomus economics measure. Runs a deterministic suite, the context compiler over the suite’s seeds with no model called, and writes its record as runs/<suite>/<commit>.json under the benchmark directory, so a second measurement at the same commit replaces the first. A live suite is refused with the run command that runs it; --dry-run measures, prints and writes nothing.
EconomicsReferencesArgs
majordomus economics references. Proves every task can fail: its hidden tests must fail on the starting fixture and pass once the reference solution is applied, or a failed run would say nothing about the agent. No model is called; the workspaces are built on this machine, under the system temporary directory unless --work-dir names another, and a task that breaks the rule makes the command exit 10.
EconomicsRunArgs
majordomus economics run. Spends provider usage: each selected task runs as real harness sessions with and without Majordomus installed, and each run is recorded as raw usage and gate verdicts. Empty tasks and repetitions mean every one the suite declares. --dry-run prepares each workspace, prints the harness command and removes the workspace again without starting a session, so it spends nothing. A run already recorded is skipped and never written over; --force is accepted only to be refused with the reason, because a recorded run is evidence.
EconomicsRunsArgs
majordomus economics runs. The recorded runs themselves, before any pairing or statistics: the raw facts a disputed metric is checked against. The filters combine as a conjunction and select whole records; they change no number inside one.
EconomicsSummaryArgs
majordomus economics summary. Every filter is optional and they combine as a conjunction. They narrow the pairs and the metrics computed from them; the verdict is always stated over all the live evidence, so a narrowed view cannot make publishable a statement the whole evidence does not support.
EntityArgs
majordomus entity. Every object of the layer as an addressable node.
EnvArgs
majordomus env.
EvidenceArgs
majordomus evidence. The output shape is global, so it reads the way a person writes it — evidence show --findings --format json — and is declared once.
ExampleDoc
One documented example of one command: what it shows, the argument vector it runs, what must happen when it runs, and anything that has to be done first. The argument vector is the canonical form; the command line a reader copies is rendered from it, never written out a second time.
ExecutionsArgs
majordomus executions. What the server serving this repository has run.
GenerateArgs
majordomus generate.
GuardArgs
majordomus guard: the edit guard (I2735).
GuardHookArgs
guard hook: the provider whose payload stdin carries, and the repository.
IntentArgs
majordomus intent. The output shape is global, so it reads where a person writes it.
KnowledgeArgs
majordomus knowledge. What the knowledge deriver left for review and whether it is still writing. The deriver itself is the shell tool’s (lib/knowledge.sh); this reads what it wrote — the candidate records under the tracked knowledge section, one record by id with its references resolved, and the derivation status of this checkout — through the knowledge_base capabilities, so the command line answers what HTTP and MCP answer.
McpArgs
majordomus mcp.
MeshArgs
majordomus mesh.
MeshClaimArgs
mesh claim: the paths a session takes, the session taking them, and whether the claim refuses an overlap or only reports one. The scope is positional and repeatable because a claim over nothing is not a claim; --session is required because a claim belongs to a session and ends with it, and --advisory is the difference between a claim that can refuse another runtime’s and one that only makes the overlap visible.
MeshEventsArgs
mesh events: a window onto the cooperation journal, in Lamport order. --after is a resume point rather than a timestamp, so a caller that remembers the last stamp it saw reads each event exactly once however the clocks of the machines involved disagree; --limit bounds one answer. Both are optional, and saying neither asks for the newest page under the server’s own default.
MeshFirewallApplyArgs
mesh firewall apply: the same --port the report takes, because the commands it runs are the report’s, and the same repository and output arguments, so that --format json prints the apply report unchanged for a script that records what ran.
MeshFirewallArgs
mesh firewall: the inbound admissions the declared mesh needs on this host, which firewall the host runs, the commands that admit them, and the firewall’s own word — a report, exit 10 when the host does not admit the mesh. mesh firewall apply runs those commands, and needs root. --port names the port this checkout’s server listens on beyond loopback, when it does, because a peer dials it there.
MeshHandoverArgs
mesh handover: the group that moves a handover record between runtimes. Continuity between two workers of one repository is otherwise a file one of them cannot see, and the two verbs here are the two halves of that move; the group runs neither by itself.
MeshHandoverConsumeArgs
mesh handover consume: which offered handover to take, and on whose behalf. The consumption is recorded on the mesh so that two workers cannot silently pick up the same handover, which is why the session is required and not inferred. --no-materialize records the act without writing the local record, for a caller that wants the claim on the handover but will read it some other way.
MeshHandoverPublishArgs
mesh handover publish: which record to offer, and what it belongs to. Every flag is optional because the useful default is the newest handover this checkout wrote — the one a worker has just finished — and --path exists for the case where that is not the one meant. The issue and milestone travel with the record so that a runtime receiving it can file it without reading it.
MeshPeerArgs
mesh peer: which single runtime of the mesh to describe. The runtime key is <node>-<runtime>, and a bare node id is accepted as a shorthand for that node’s first runtime, because a machine running one server is the common case and spelling its runtime out adds nothing. The key is positional and required: a peer question with no subject is peers, which is a different command.
MeshQueryArgs
One read-only mesh question.
MeshReleaseArgs
mesh release: the one claim to give back, by the <stream>/<claim> key mesh claim printed when it took it. The key names the stream that made the claim as well as the claim itself, so a runtime can only release what it holds, and a person who kept the line mesh claim printed needs nothing else.
MeshReviewAnswerArgs
mesh review answer: the request being answered, the session answering it, and the verdict. The verdict is one of three declared words rather than free text, so that a requester can act on an answer without reading it, and clap refuses anything else at the boundary; the note is where the reasoning goes.
MeshReviewArgs
mesh review: the group that carries a review across runtimes, so that a worker can have its branch read by a worker it cannot otherwise address. Asking and answering are separate acts by separate runtimes, which is why they are separate subcommands and the group itself runs nothing.
MeshReviewRequestArgs
mesh review request: what is to be read, who is asking, and optionally who is asked. The subject is a branch, a commit or a pull request, written as the requester refers to it; --scope is repeatable and narrows the request to the paths that matter, which is what makes an answer cheap enough to be worth asking for. Leaving --reviewer unsaid offers the request to every linked runtime rather than to none.
MeshReviewWithdrawArgs
mesh review withdraw: end a request this runtime asked for, because it is done, void or superseded, with what came of it. Any session of the asking runtime may, no other runtime may; the note is its own result, shown with the request, and never an answer.
MeshSessionArgs
mesh session: the group that carries a session’s lifecycle on the mesh. The group itself runs nothing — every runnable path under it is open or close — so it refuses to be invoked bare rather than guessing which half of a lifecycle was meant.
MeshSessionCloseArgs
mesh session close: the id of the session that has finished. Closing is the one act that ends a session’s claims everywhere at once, so it takes the session and nothing else — there is no partial close, and no flag that could make one.
MeshSessionOpenArgs
mesh session open: everything a session says about itself, so that another runtime’s operator can tell who is here and what they are doing. Only --session is required; the rest — client, worker, intent, task, issue, milestone, branch, head — are what the session knows about its own work, and opening the same id twice updates the record rather than refusing, which is what makes this usable from a hook that cannot know whether it has run before.
MeshViewArgs
mesh peers and mesh state: how much of the mesh to show. Without a flag the answer is the summary, which stays the same size however long the mesh’s history grows; --full is every session, claim, handover and review the fold holds. The filters narrow either.
ModelsArgs
majordomus models.
ModelsListArgs
majordomus models list.
ModelsRouteArgs
majordomus models route.
MonitorArgs
monitor: one page of the stream, or --follow to keep printing what is new. --count and --until end a follow, so a script or an agent can wait for one event and go on; --match keeps only the signals whose summary contains a text.
OffloadArgs
majordomus offload. The declaration is the repository’s own unless --declaration names a file; the output shape is global, as for worktree.
PackArgs
majordomus pack. The output shape is global, so it reads where a person writes it.
ProductArgs
majordomus product. The filters and the output shape are global, so they read the way a person writes them — product list --featured — and are declared once.
PrsArgs
majordomus prs (alias pr). Every subcommand but refresh, drain and cleanup reads the last recorded forge observation and never reaches the network.
QualityArgs
majordomus quality. Declared as a group so that each measurement of the crate joins it rather than crowding the root: the public surface’s quality, and the tree rustdoc renders from it.
QualityReportArgs
majordomus quality report.
QualityRustdocArgs
majordomus quality rustdoc: the tree rustdoc rendered from the crate, judged against the crate’s own inventory of exported items.
ReasoningArgs
majordomus reasoning: the command-line projection of the reasoning capabilities. The repository arguments and the output shape are shared by every subcommand, and the shape is global, so --format reads the same before or after the subcommand.
ReleaseArgs
majordomus release. The read half is derived and the write half is one command, so that raising a version is one edit to the one place it is authored, and the rest is derived.
RepoArgs
Where and how the repository is read; shared by every command that reads it.
RulesArgs
majordomus rules. The rule corpus against the proof there is for it: what each rule names, whether it is in the tree, whether a runner drives it, whether anything ran, and whether what ran is older than what it is about.
RunArgs
majordomus run. One capability, run as an execution in this process, followed to its end.
ScopeArgs
majordomus scope.
ServeArgs
majordomus serve.
ServedArgs
majordomus served: what a deployment serves, observed from outside and judged against a commit. ServedArgs carries the repository the question is asked of, the subcommand and the output shape.
ShellArgs
majordomus shell. The output shape is global, so it reads the way a person writes it.
SkillsArgs
majordomus skills. The output shape is global, so it reads where a person writes it.
Violation
One thing missing from the command line’s documentation.
WebArgs
majordomus web.
WhyArgs
majordomus why. The facets and the output shape are global, so they read the way a person writes them — why list --audience solo-builder — and are declared once.
WorktreeArgs
majordomus worktree (alias wt). The output shape is global, so it reads the way a person writes it — worktree list --format json — and is declared once.

Enums§

BaselineCommand
The bench baseline subcommands.
BenchCommand
The bench subcommands.
CapabilitiesCommand
The introspection commands; list and describe dispatch through the registry’s CLI exposure.
Command
The commands. A command listed here is implemented; nothing is advertised ahead of its behaviour.
CommandEffect
What running a command changes, as a filter.
CommandOrigin
Which program a command belongs to, as a filter.
CommandsCommand
What majordomus commands can be asked.
CommitCommand
The subcommands of majordomus commit: plan, scopes, history and validate.
CompletionCommand
What majordomus completion can be asked.
CompletionShell
A shell the integration is printed for.
CompletionSurface
The surface a completion request is spelled for.
ContinuityCommand
The subcommands of majordomus continuity: the command line of continuity.status, continuity.records, continuity.device, continuity.plan, continuity.publish, continuity.sync and continuity.resume.
DashboardCommand
The subcommands of majordomus dashboard: one per page of the suite.
DeliveryCommand
The subcommands of majordomus delivery: the command line of delivery.report and delivery.feature.
DevcontextCommand
What to ask of the context compiler: compile an answer, ask why one identifier is or is not in it, or read the rules the compiler decides by.
DevtaskCommand
The subcommands of majordomus devtask.
DiscoveryMode
How files are enumerated.
DistributionCommand
The subcommands of majordomus distribution.
EconomicsCommand
The subcommands of majordomus economics: four readers and three producers of evidence.
EntityCommand
The subcommands of majordomus entity.
EnvCommand
The subcommands of majordomus env.
EvidenceCommand
The subcommands of majordomus evidence: the whole matrix, one claim, one test, and the recorder.
ExecutionsCommand
The subcommands of majordomus executions.
Expect
What an example’s run must show for the example to be true. Small on purpose: enough to prove that the command line printed in the documentation does what the documentation says, and no more. A new variant is a new kind of evidence, not a new test framework.
GenerateTarget
What generate writes.
GuardCommand
The guard subcommands: one today, hook, which a provider’s pre-tool hook runs before every write; an unknown subcommand is refused rather than read as a path.
HostOrigin
Where the interface a local server binds came from.
IntentCommand
The subcommands of majordomus intent: the command line of intents.list, intents.record, intents.validate and intents.preflight.
KnowledgeCommand
The subcommands of majordomus knowledge.
MeshCommand
The mesh subcommands.
MeshFirewallCommand
The mesh firewall subcommands: only apply, because the report is the command itself with nothing after it. apply is the one mesh operation offered on the command line alone — it runs a privileged host tool, which nothing reachable over HTTP or MCP may do — and it refuses without root rather than failing half-way.
MeshHandoverCommand
The two halves of moving continuity across the mesh: publish offers this checkout’s handover to every linked runtime, and consume takes one another runtime offered and writes it where handover --resolve will find it. Publishing does not choose a reader and consuming does not ask the publisher, so neither side has to be running when the other acts.
MeshReviewCommand
The two sides of a review on the mesh: request puts a subject and its scope in front of the other runtimes, and answer records one runtime’s verdict on it. A request names a reviewer only when it wants a particular one; unaddressed, it is an offer any linked runtime may answer.
MeshSessionCommand
The two ends of a session’s life on the mesh: open, which announces a session and updates what it says about itself, and close, which ends it and with it every claim it held on every linked runtime. There is no third verb, because everything a session does between those two ends is a claim, a handover or a review.
ModelsCommand
The models subcommands.
OffloadCommand
The subcommands of majordomus offload: hosts reads the declaration and contacts nobody, probe measures every declared host over ssh and names the one a derive would take, and derive sends a worktree there and stages what the derive changed.
OutputFormat
Output shape for commands that print to a person or a script. mcp speaks its own protocol and does not use it; mcp --inspect does.
PackCommand
The subcommands of majordomus pack: plan is the verdict before anything is written, build writes the pack and verifies what it wrote, and verify reads a written pack.
ProductCommand
The subcommands of majordomus product.
ProfileArg
How much bench measures.
PrsCommand
The subcommands of majordomus prs. status, plan, explain and events render the recorded observation offline; refresh, drain and cleanup reach the forge, and a drain is bounded by --max merges and, without --dry-run, holds the base branch’s integration lease while it acts.
QualityCommand
The quality subcommands.
ReasoningCommand
The reasoning subcommands, one per capability: advisors, plan and status read, explain traces one record, check gates, and record is the one that writes.
ReleaseCommand
The subcommands of majordomus release.
ReportCommand
The reports this executable can render. Each reads evidence a run already produced and writes a surface; none of them runs anything or decides what passed.
RulesCommand
The subcommands of majordomus rules.
SchemaSide
Which schema of a capability to print.
ServeCommand
The subcommands of majordomus serve: the server’s lifecycle as something a person or a hook converges on rather than remembers. status is the projection of server.status; ensure and stop are process lifecycle, which no capability served by the process could be.
ServedCommand
The subcommands of majordomus served: observe is the command line of served.observe, forge of served.forge and show of served.show. observe and forge reach the network, and each is a command line and nothing else.
ShellCommand
The subcommands of majordomus shell: check measures the repository’s shell units against the automation inventory, and --canonical puts the inventory’s records back in canonical order before it measures.
SkillsCommand
The subcommands of majordomus skills: the command line of skills.status, skills.explain and skills.verify.
Transport
The transports available. One today; the option exists so that a second one is an addition, not a redesign.
TransportArg
The transports bench can be limited to.
WebCommand
The subcommands of majordomus web.
WhyCommand
The subcommands of majordomus why.
WorktreeCommand
The subcommands of majordomus worktree.

Constants§

DEFAULT_IDLE_SECONDS
How long a server started by serve ensure outlives its last peer, in seconds: long enough that an agent’s next attach finds it, short enough that a checkout nobody works in does not keep a process. The default of server.idle_seconds: in .ai/repo/policy.yaml, which a repository may declare beside the other server timings (lease::Timings::idle); --idle on the command line overrides both (I2701).
DEFAULT_PORT
The port of the HTTP projection a repository’s primary checkout asks for: serve, and the shared server mcp starts. A linked worktree asks for one of its own (checkout_port).
EXAMPLES
Every documented example of the native command line.
EXIT_USAGE
The exit code for a usage error, per the exit-code contract.
HTTP_HOST_ENV
The variable that names, for one machine, the interface a local server binds.
LOOPBACK_HOST
The interface a local server binds when nothing says otherwise.

Functions§

checkout_http_host
The machine’s interface for one checkout: a linked worktree does not take the one HTTP_HOST_ENV names. The variable is the machine’s face on its network, and that face is the repository’s primary server — the one other machines dial and whose mesh the worktrees cooperate through; a worktree’s own server serves its own sessions, and a variable inherited by every shell would otherwise put each of them on the network beside it. A flag still binds where it says, because a person typed it.
checkout_port
The port this checkout’s server asks for first, the same on every start (I2702).
linked_port
The port a linked worktree with this identity asks for: the identity’s leading 32 bits, reduced into the block above DEFAULT_PORT.
local_http_host
resolve_http_host against this process’s environment: what serve, mcp and server.status all read, so that the address a server binds and the address the status calls desired cannot disagree.
parse
The example’s argv through the canonical parser. Public so that a test can hold one argument vector to the declaration without going through the whole tree.
parse_duration
A duration as a person writes it: 90, 90s, 30m, 2h, 1d, in seconds.
resolve_checkout_http_host
resolve_http_host for a checkout that is, or is not, a linked worktree: an environment’s interface becomes loopback in a linked worktree; a flag never changes.
resolve_http_host
The interface a local server binds: the flag when one was given, else what HTTP_HOST_ENV names, else loopback. A variable that is set and blank is unset.
validate
Every violation in the tree, in command order, then in example order. An empty result is the contract met.