Expand description
Why a command of the command line is not itself a capability.
§The question this answers
Every capability of this executable is projected to HTTP and to the OpenAPI document, and most of them to MCP. The command line is the one projection that also carries commands of its own: starting a server, writing a generated file, rendering a value for a person. Left alone, that is how an operation goes missing from the API — not by decision, but because nobody noticed it had.
So the rule is not every command is a capability. It is: a command is the
projection of a capability, or it says here why it is not, and the reason is checked.
LOCAL is that statement, and crate::quality::parity is the check. A command in
neither place is a finding; an entry here naming a command that no longer exists is a
finding; an entry here for a command that is bound to a capability is a finding. None
of the three can be reached by forgetting.
§Where it lives
Beside the clap declaration it is about, for the same reason
super::EXAMPLES does: the person adding a command is looking at this file, and a
statement kept anywhere else is a statement that goes stale in a refactor nobody
connects to it.
use majordomus_cli::cli::local::{LocalReason, LOCAL};
// starting a server is not an operation that can answer over a socket
let serve = LOCAL.iter().find(|l| l.command == "serve").unwrap();
assert!(matches!(serve.reason, LocalReason::ProcessLifecycle));
// and a command that renders a capability names the capability it renders
let list = LOCAL.iter().find(|l| l.command == "web list").unwrap();
assert_eq!(list.reason.renders(), Some("web.surfaces"));Structs§
- Local
Command - One command of the command line that is not itself a capability, and why.
Enums§
- Local
Reason - Why a command belongs to the command line alone.
Constants§
- LOCAL
- Every command of the command line that is not the projection of a capability.
Functions§
- find
- The entry for a command, by the words a person types after
majordomus.