Expand description
CLI grammar: launch syntax, wrapper options and reserved command words (spec §5; SP1 design §4) and the repository commands (SP3 design §7).
Modules§
- completions 🔒
- The shell completion model. The model exists only for
clap_complete::generate: it never parses an argument line, and it mirrors the grammar table onCommandWord(scope, flags, positionals), so the generated scripts cannot drift from the hand dispatcher.
Structs§
- Cli 🔒
- Select and launch profiles for multiple coding agents.
Enums§
- Agent
Scope 🔒 - Where a command word may appear: with an agent, without one, or both.
- Command 🔒
- Every reserved word — the eight of spec §5.3 plus
resolve,current,repositories,doctorandcompletions— is dispatched before Clap (SP3 design §7.2), so Clap sees only the agent form. - Command
Word 🔒 - The repository commands (SP3 design §7.1).
- Invocation 🔒
- The outcome of the argument checks (SP1 design §4.2, SP3 design §7.2).
- Launch
Discovery 🔒 - Whether a launch runs discovery (SP3 design §7.6).
- Positional 🔒
- The positional words a command takes after its command word.
- Token 🔒
- One token before the first
--, after--repobinding (SP3 design §7.2 step 1).
Constants§
Functions§
- bare_
words 🔒 - base_
dir 🔒 - The directory a
--repovalue is joined to. An absolute--reponeeds no current directory, so a command given one still works from a working directory that no longer exists (design §6.2, §10 “--repois the explicit override”). - bind 🔒
- Step 1:
--repo=<v>carries its value; a bare--repoconsumes the next token whatever it is. - confirm 🔒
- Asks the user a yes/no question: prints
questionto stderr without a newline, flushes, and reads one line. Onlyyoryes, trimmed and ignoring ASCII case, counts; EOF or anything else is no. - current_
dir 🔒 - cut 🔒
- Splits at the first
--: the tokens before it, and the opaque arguments when there is one. - execute 🔒
- has_
help 🔒 - has_
version 🔒 - launch_
discovery 🔒 - no_
profile 🔒 - option_
name 🔒 - Only the part before
=is echoed: the value may be a secret meant for the agent (spec §36). - options 🔒
- parse_
profile 🔒 - repo_
value 🔒 - The value of a
--repo=<v>token, which may be non-UTF-8. - report 🔒
- run
- Runs the CLI and returns the process exit code. This is the only place an exit code is decided.
- run_
agents 🔒 agents(SP5a design §3): every registry entry with its executable evidence. Read-only — the load inrun_commandrefuses an invalid configuration but nothing is created here (V3 §17) — and it always exits 0: a missing or unusable executable is listed as a fact, not an error, while any discovery error that is not one of those facts propagates.- run_
command 🔒 - SP3 design §7.4 steps 2-5.
- run_
create 🔒 <agent> create <profile>(SP5a design §3): materializes the adapter’s paths exactly once. Both outcomes exit 0; the configuration was already refused if invalid byrun_command’s load, and is otherwise unused.- run_
delete 🔒 <agent> delete <profile> [--yes](SP5a design §3). An advisory referenced-profile check first, then--yesor an interactive confirmation, then the lockedlifecycle::delete. A missing profile exits 0 rather than erroring, because that is the state the user asked for — the same line and code as a profile that vanishes between the check and the lock. The configuration was already refused if invalid byrun_command’s load, and is read again under the lock insidelifecycle::delete.- run_
doctor 🔒 - SP5c design §3-§4: every check runs and prints; the exit code is 5 when any record failed. A working
directory that cannot be read is not an error here: discovering
.then yields therepositoryrecord. - run_
launch 🔒 - run_
profiles 🔒 profilesand barelistand<agent> list(SP5a design §3): the read-only listings. Nothing is created —run_commandhas already loaded the configuration (V3 §17) but no root, noconfig.tomland no lock is written here — and every outcome exits 0: an empty listing is the answer, not an error, and unrecognized on-disk entries are a stderr note rather than a failure.- run_
repositories 🔒 repositories(SP5b design §4): every stored mapping with its classification. Read-only, takes no lock, and always exits 0: an entry that cannot be examined is reported, not raised.- run_
unlink 🔒 unlinkchooses its keys without discovery when--repois given (SP3 design §6.2).- split 🔒
agent-profile <agent> …: SP1 design §4.2 rules 3-4 as replaced by SP3 design §7.2.- split_
top_ 🔒level agent-profile <command> …for the reserved words dispatched before Clap (SP3 design §7.2).- usage 🔒
- validate_
command 🔒 - Step 5:
bareholds the bare words after the command word. - with_
unknown_ 🔒configured - Fills
unknown_configuredonUnknownAgentandAgentNotInstalled. With no configuration at hand, one best-effort load is attempted; its failure leaves the list empty (design §4.2 check 3). - write_
lines 🔒 - write_
out 🔒