Skip to main content

Module cli

Module cli 

Source
Expand description

Argv routing and the dispatch skeleton.

Structsยง

DoctorArgs
ServePrep
What serve resolves before it starts logging: settings loaded with the RAW environment (an empty OPENCODE_CTL_SERVER must stay visible as the background-service override), the pairing identity resolved and applied (pairing.rs), and the warnings for the log.

Enumsยง

Route

Constantsยง

SUBCOMMANDS ๐Ÿ”’

Functionsยง

argv0_stem ๐Ÿ”’
The file stem of argv0 with the directory and a .exe suffix stripped (either separator).
blank_is_unset
The ONE empty-is-unset rule: a value empty after trimming is unset; any other value is returned verbatim.
dispatch
doctor_main ๐Ÿ”’
doctor-json: the report for the real environment, as the value to print on stdout.
emit_skill
emit-skill <name> --host <cc|qwen|agy|opencode> (the two words in either order): the rendered skill, byte for byte what goes to stdout. Any other argument shape, name or host is INVALID_ARGUMENT.
env_nonempty
gc_main ๐Ÿ”’
gc (no arguments): the report for the real environment as the JSON to print on stdout.
launcher_bin_dir
The launcher install dir (spec Launcher, install-launcher): ~/.local/bin on POSIX, %LOCALAPPDATA%\opencode-ctl on Windows. get is the raw environment lookup.
launcher_main ๐Ÿ”’
pair and install-launcher for the real environment; returns the exit code.
launcher_run ๐Ÿ”’
launcher_withheld ๐Ÿ”’
The OpenCode host (the compiled constant or OPENCODE_CTL_HOST=opencode) is never offered the launcher.
log_gc_report ๐Ÿ”’
One line per pair gc touched, appended to that pairโ€™s pair-<id>.log (the gc subcommand opens each log Scoped; pair writes to its own already-open log instead and never calls this).
parse_doctor_args
doctor-json [verbose] [--host <h>], the two in either order; any other word is INVALID_ARGUMENT.
prepare_serve
route
Under the name opencode-pair (the launcher link) a leading resume, attach, gc, install-launcher, doctor-json or --version is that subcommand and anything else, no arguments included, is pair. Under the long binary names the subcommand is always explicit.
serve ๐Ÿ”’
usage
version_line