CLI & Dispatch Layer
Architectural Layer: L9 CLI / Interface
Source Directory:src/cli
File Count: 6 source files
Clap 4 argument hierarchy, output formatters, exit codes, and runtime command dispatch.
Module Files & Detailed Referenceβ
| Source File | Lines | Key Types | Responsibility |
|---|---|---|---|
| args.rs | 505 | AgentArgs, ArtifactArgs, CapabilityArgs | Clap 4 CLI Command & Argument Hierarchy (CLI-01, CLI-02). |
| dispatch.rs | 2301 | CliDispatcher, CliOutput, CliError | Shared Runtime Application Command Dispatch Layer (CLI-01, CLI-04, D-1... |
| doctor.rs | 541 | DeploymentProbe, DoctorReport, DoctorRunner | Modular Doctor Environment Diagnostics Probes (CLI-01, D-20). |
| exit_codes.rs | 68 | M31aExitCode | Stable Documented Exit Code Taxonomy (CLI-03, D-18). |
| mod.rs | 17 | Functions/Traits | CLI Command Suite & Application Runtime Interface (CLI-01βCLI-04). |
| output.rs | 89 | NdjsonStreamWriter, TerminalFrame, CliStreamMessage | NDJSON Streaming Output & Envelope Formatting (CLI-02, D-18). |
src/cli/args.rsβ
- Source Link:
src/cli/args.rson GitHub - Lines of Code: 505 (13952 bytes)
- Runtime Properties: π‘οΈ Enforces Policy Gate | π Supports Cancellation Tokens
Primary Responsibilityβ
Clap 4 CLI Command & Argument Hierarchy (CLI-01, CLI-02).
Types & Trait Declarationsβ
- Structs (19):
AgentArgs,ArtifactArgs,CapabilityArgs,CheckpointArgs,Cli,ConfigArgs,DeploymentArgs,DoctorArgs,EvalArgs,ExecutionArgs,InitArgs,PolicyArgs,RollbackArgs,RunArgs,SessionArgs,TaskArgs,TelemetryArgs,UpdateArgs,VersionArgs - Enums (13):
AgentCommands,ArtifactCommands,CapabilityCommands,CheckpointCommands,Commands,ConfigCommands,EvalCommands,ExecutionCommands,OutputFormat,PolicyCommands,SessionCommands,TaskCommands,TelemetryCommands
src/cli/dispatch.rsβ
- Source Link:
src/cli/dispatch.rson GitHub - Lines of Code: 2301 (100944 bytes)
- Runtime Properties: πΎ Interacts with SQLite Persistence | π‘οΈ Enforces Policy Gate | π Supports Cancellation Tokens
Primary Responsibilityβ
Shared Runtime Application Command Dispatch Layer (CLI-01, CLI-04, D-18).
Types & Trait Declarationsβ
- Structs (2):
CliDispatcher,CliOutput - Enums (2):
CliError,RuntimeCommand
Key Functions & Signatures (15 shown)β
// pub
fn success(text: impl Into<String>, data: serde_json::Value) -> Self;
// pub
fn with_exit_code(mut self, code: i32) -> Self;
// private
fn from(r: crate::telemetry::TelemetryInspectionReport) -> Self;
// private
fn default() -> Self;
// pub
fn new() -> Self;
// pub
fn with_policy_gate(mut self, gate: Arc<dyn PolicyGate>) -> Self;
// pub
fn with_capabilities(mut self, reg: Arc<CapabilityRegistry>) -> Self;
// pub
fn with_event_bus(mut self, bus: Arc<BroadcastEventBus>) -> Self;
// pub
fn with_pool(mut self, pool: SqlitePool) -> Self;
// pub
fn with_mission_repo(mut self, repo: Arc<dyn MissionRepository>) -> Self;
// pub
fn with_execution_run_repo(mut self, repo: Arc<dyn ExecutionRunRepository>) -> Self;
// pub
fn with_checkpoint_manager(mut self, mgr: Arc<CheckpointManager>) -> Self;
// pub
fn with_artifact_store(mut self, store: Arc<dyn ArtifactStore>) -> Self;
// pub
fn with_approval_coordinator(mut self, coord: Arc<ApprovalCoordinator>) -> Self;
// pub
fn with_runtime(mut self, rt: Arc<crate::runtime::AppRuntime>) -> Self;
src/cli/doctor.rsβ
- Source Link:
src/cli/doctor.rson GitHub - Lines of Code: 541 (18069 bytes)
Primary Responsibilityβ
Modular Doctor Environment Diagnostics Probes (CLI-01, D-20).
Types & Trait Declarationsβ
- Structs (11):
DeploymentProbe,DoctorReport,DoctorRunner,EnvironmentProbe,GitProbe,ModelsProbe,NetworkMcpProbe,PlatformProbe,ProbeResult,SandboxProbe,StorageProbe - Enums (2):
ProbeCategory,ProbeStatus - Traits (1):
DoctorProbe
Key Functions & Signatures (15 shown)β
// pub
fn as_str(&self) -> &'static str;
// pub
fn ok(category: ProbeCategory,
name: impl Into<String>,
message: impl Into<String>,) -> Self;
// pub
fn warning(category: ProbeCategory,
name: impl Into<String>,
message: impl Into<String>,
remedia;
// pub
fn error(category: ProbeCategory,
name: impl Into<String>,
message: impl Into<String>,
remediati;
// private
fn category(&self) -> ProbeCategory;
// private
fn name(&self) -> &str;
// private
async fn check(&self) -> ProbeResult;
// private
fn category(&self) -> ProbeCategory;
// private
fn name(&self) -> &str;
// private
async fn check(&self) -> ProbeResult;
// private
fn category(&self) -> ProbeCategory;
// private
fn name(&self) -> &str;
// private
async fn check(&self) -> ProbeResult;
// private
fn category(&self) -> ProbeCategory;
// private
fn name(&self) -> &str;
src/cli/exit_codes.rsβ
- Source Link:
src/cli/exit_codes.rson GitHub - Lines of Code: 68 (2189 bytes)
- Runtime Properties: π‘οΈ Enforces Policy Gate
Primary Responsibilityβ
Stable Documented Exit Code Taxonomy (CLI-03, D-18).
Types & Trait Declarationsβ
- Enums (1):
M31aExitCode
Key Functions & Signatures (4 shown)β
// pub
fn as_i32(self) -> i32;
// pub
fn description(&self) -> &'static str;
// private
fn from(code: M31aExitCode) -> Self;
// private
fn from(val: i32) -> Self;
src/cli/mod.rsβ
- Source Link:
src/cli/mod.rson GitHub - Lines of Code: 17 (599 bytes)
Primary Responsibilityβ
CLI Command Suite & Application Runtime Interface (CLI-01βCLI-04).
src/cli/output.rsβ
- Source Link:
src/cli/output.rson GitHub - Lines of Code: 89 (2370 bytes)
- Runtime Properties: π‘οΈ Enforces Policy Gate
Primary Responsibilityβ
NDJSON Streaming Output & Envelope Formatting (CLI-02, D-18).
Types & Trait Declarationsβ
- Structs (2):
NdjsonStreamWriter,TerminalFrame - Enums (1):
CliStreamMessage
Key Functions & Signatures (3 shown)β
// pub
fn new(writer: W) -> Self;
// pub
fn emit(&mut self, message: &CliStreamMessage) -> io::Result<()>;
// pub
fn is_sealed(&self) -> bool;