Expand description
Async handlers for every cli leaf command (except api,
schemas, the internal instance subprocess runner, and
clap’s external plugin dispatch). Stubs today; typed Args
pub async fn handle(...)signatures land in follow-up commits.
Re-exports§
pub use command_executor::*;
Modules§
- agents
- api
- command_
executor - db
db— direct database access at the CLI level.- functions
- kill_
all kill-all— terminate every process holding a lock anywhere under the configuredOBJECTIVEAI_DIR.- mcp
- plugins
- swarms
- tasks
agents tasks— task store + (eventual) runner.- tools
- update
update— async handler stub.- viewer
Structs§
- Agent
Arguments - Agent identity + response routing args carried per call.
- From
Args Error - Request
Base - Request
Base Args - Clap mirror of
RequestBase,#[command(flatten)]-ed into every transform-capable leaf’sArgs. - Response
Schema - Stream
Once
Enums§
- Command
- From
Args Error Source - GetScope
- Which config layer a read targets.
- McpResponse
Item - MCP-side projection of one CLI response item.
- Ok
- Success-only response shape. Wire form is the bare string
"Ok"— a single-variant enum gives us a typed sentinel that serializes and deserializes through serde as the static string. Used asResponseon every cli leaf whose only success signal is “it worked.” - Parse
Error - Error from
parse_request. Either clap rejected the argv (ParseError::Clap—--help, unknown subcommand, missing required arg, etc.) or the typedCommandcouldn’t be lowered into aRequest(ParseError::FromArgs— inline body JSON failed to parse, etc.). - Remote
- Wire-level source enum: which remote backend a path references.
Same shape as
crate::Remotebut lives undercli::commandso it can beclap::ValueEnumwithout dragging clap into the SDK’s non-cli surface. - Request
- Response
Item - SetScope
- Which config layer a mutation targets.
- Transform
- Exactly one output transform. Extends by VARIANT without
changing any leaf’s
execute_transformsignature. (A hand-constructedRequestBasecan carry both fields at once — there, python overrides jq.)
Traits§
- Command
Request - Convert a typed CLI request struct into the argv tail the cli binary
should be invoked with. Implementors are the per-leaf request shapes
in the surrounding tree (e.g.
agents::spawn::Request) and emit the flags + positional args their leaf command expects — without the binary name. Callers prepend whatever launcher prefix they need (["objectiveai-cli"],["objectiveai-cli", "instance"], …). - Command
Response - Convert a typed CLI response item into its MCP-shaped projection —
either a media [
ContentBlock] for MCP tool results or a JSONLserde_json::Valuefor the line-oriented stream wire format. Implementors are the per-leaf response shapes in the surrounding tree (agents::spawn::ResponseItem,tools::run::ResponseItem, …) — not yet wired up; the trait exists to anchor the contract.
Functions§
- execute
- execute_
transform - parse_
request - Parse an argv slice into a typed
Request. Accepts either shape: - remote_
path_ to_ arg_ string - Serialize a
RemotePathCommitOptionalback into its docker-stylekey=value,...form for round-tripping through argv.