Expand description
Machine-readable introspection for Foundry CLIs.
This module implements the --introspect flag described in
docs/agents/spec.md. It walks a
clap::Command tree, merges in metadata from a per-binary
CommandRegistry, and emits an IntrospectDocument suitable for
agent consumption.
Modules§
- build 🔒
- Build an
IntrospectDocumentfrom aclap::Commandtree. - document 🔒
- Serializable types describing a Foundry binary’s command surface.
- registry 🔒
- Per-binary registry of stable command metadata.
Structs§
- ArgInfo
- Information about a single command argument.
- Binary
Info - Information about the binary itself.
- Capabilities
- Capability flags exposed for agent consumers.
- Command
Info - Information about a single command (or group) in the CLI tree.
- Command
Meta - Per-leaf metadata that overlays the clap-derived defaults.
- Command
Registry - A binary’s command registry.
- Exit
Code Info - Documented exit code for a command, beyond the global table.
- Introspect
Document - Top-level introspection document.
Enums§
- ArgKind
- Argument shape.
- Output
Mode - Output mode under machine mode.
- Side
Effects - Coarse classification of a command’s side effects.
- Value
Type - Best-effort classification of an argument’s value type, for agent UI hints.
Constants§
- INTROSPECT_
SCHEMA_ ID - Stable schema id for the introspect document.
- INTROSPECT_
SCHEMA_ VERSION - Schema version for the introspect document.
Functions§
- build_
document - Build an
IntrospectDocumentforcommandoverlaid with metadata fromregistry. - collect_
command_ ids - Collect every
command_id(recursively) emitted by anIntrospectDocument. - duplicate_
command_ ids - Assert that every
command_idindocis unique. - render_
introspect_ document - Serialize an
IntrospectDocumentas compact JSON.