Expand description
Wyvern CLI library — load → validate → run → emit pipeline.
main.rs is a thin binary wrapper around pipeline::run_from_loaded.
Modules§
- examples
- Bundled example discovery from README frontmatter.
Bundled example discovery from
{wyvern_share}/examples/**/README.mdfrontmatter. - extensions
- CLI extension registry, match, preexec, and expand (ADR-0022). CLI extension registry: load, merge, match, expand, and dispatch.
- workflow
- Wizard workflow hooks and
next_wizardchain (REQ-0124–0126). Wizard workflow hooks andnext_wizardchain loop (REQ-0124–0126).
Structs§
- Allowlist
- Allowlisted roots for workflow script and
next_wizardpaths. - CliArgs
- Parsed CLI invocation: host options + remaining positional/stdin args.
- Extension
Registry - Merged,
extends-resolved extension registry. - Next
Invocation - Next hop loaded from
next_wizard.path(CLI resolves; host does not). - Workflow
Runner - Runs
workflow.pre/workflow.postthrough Phase F preexec helpers.
Enums§
- Browsers
Error - CLI browsers subcommand failure.
- Builtin
Domain - Built-in CLI family that owns subcommands (
browsers,extensions,examples,wizard). - Emit
Error - Failure serializing stdout or structured stderr JSON at the CLI emit boundary.
- Examples
CmdError - CLI
examplessubcommand failure. - Extension
Error - Structured extension-engine failure.
- Extension
Match - Successful argv match against one extension.
- Load
Error - Failure while loading command input from argv or stdin.
- Near
Miss Kind - Why remainder argv did not match an extension (REQ-0136).
- Pipeline
Error - Pipeline failure after load: stage stderr + exit, or emit-boundary serialize failure.
- Preexec
Failure Kind - Why a preexec subprocess failed.
- Usage
Error Kind - Host-flag / env usage failure kind for structured stderr recovery (RBP-F009).
- Viewer
Spawn Error - Failure locating or launching
wyvern-viewer. - Wizard
CmdError - Failure from
wyvern wizard …. - Wizard
CmdResult - Result of a successful
wizard lintinvocation. - Wizard
Lint Stage Error - Structured
wizard lintstage failure (RBP-001 / RBP-F001). - Workflow
Error - Workflow / chain failure (stderr via
wyvern_schema::ErrorCode::WorkflowError).
Constants§
- NEXT_
WIZARD_ MAX_ DEPTH - Maximum wizard sessions in one
next_wizardchain (REQ-0126). - WORKFLOW_
SCRIPT_ TIMEOUT - Timeout for every workflow pre/post script (REQ-0124 / REQ-0125).
Functions§
- apply_
host_ overrides - Apply extension
host.ui_rootover CLI--ui-rootwhen set (contract §7). - browsers_
usage_ message - Usage text for
wyvern browsers --help/-h. - check_
chain_ depth - Fail when
hopexceedsNEXT_WIZARD_MAX_DEPTH. - emit_
extension_ error - Serialize an extension-engine error as stderr JSON.
- emit_
fatal_ internal - Emit static internal stderr JSON and exit with code 8 (REQ-0078).
- emit_
host_ error - Serialize a
wyvern_host::HostErroras stderr JSON (REQ-0073). - emit_
io_ error - Serialize an I/O load error as stderr JSON.
- emit_
near_ miss - Serialize a near-miss as the existing
StderrErrorenvelope. - emit_
parse_ error - Serialize a parse load error as stderr JSON.
- emit_
stdout - Serialize a successful
wyvern_schema::CommandResultfor stdout. - emit_
usage_ error - Serialize
LoadError::Usageas stderr JSON with flag-specific recovery. - emit_
usage_ message - Serialize a usage / unknown-subcommand error as stderr JSON (exit 2).
- emit_
validation_ error - Serialize a validation/state error as stderr JSON.
- emit_
wizard_ lint_ stage_ error - Serialize a wizard lint stage failure as stderr JSON.
- emit_
workflow_ error - Serialize a workflow / chain failure as stderr JSON (
WORKFLOW_ERROR, exit 9). - examples_
usage_ message - Usage text for
wyvern examples --help/-h. - load_
command_ input - Load a command
Valuefrom positional args or stdin. - merge_
wizard_ config - Deep-merge
base ← input ← config_patch. - parse_
cli_ args - Split argv into host flags and positionals.
- resolve_
next_ wizard - Resolve an optional
next_wizardobject on finish JSON. - resolve_
viewer_ bin - Resolve
wyvern-viewervia sibling →CARGO_BIN_EXE→WYVERN_VIEWER_BIN→PATH. - run_
browsers_ command - Run a
browserssubcommand; returns stdout text on success. - run_
examples_ command - Run
wyvern examples …; returns stdout text on success. - run_
from_ loaded - Validate
value, run the host, and return stdout JSON on success. - run_
wizard_ command - Run
wyvern wizard …; returns aWizardCmdResulton success. - run_
wizard_ workflow_ loop - Every
Command::Wizardone-shot enters this loop (REQ-0124–0126). - set_
pipeline_ correlation_ id - Bind the session correlation id for pipeline
tracingevents (binary calls after init). - spawn_
embedded_ viewer - Spawn
wyvern-viewerfordialog_urlwith optional size hints. - usage_
message - Canonical usage text for
--help/-h/helpand invalid argv. - wizard_
usage_ message - Usage text for
wyvern wizard --help/wyvern wizard lint --help.