Expand description
omni — shared command logic for the CLI and the MCP server.
The same typed command contracts back both the clap CLI surface and the
mcp-cli ToolRouter, so omni mcp stdio is a valid MCP server that
exposes exactly the operations the CLI performs. This mirrors the pattern
every harryaskham ecosystem project follows (see cacophony templates/).
The omni binary is built on the mcp-cli / updatable-cli / feedback-cli
stack (the status / update / mcp surfaces) plus these modules, all
landed:
wire— canonical NDJSON InjectionCommand schema (bd-44dac8).transport— Android adb am-broadcast (bd-17026f), direct NDJSON-over-TCP, and the iOS/watch relay (bd-a5452f).config— declarative connection targets (bd-2da1d9);dispatchfans a cast out to a target’s endpoints (--target, bd-bfb732).cast— stdin streaming (bd-5cd61e);receive— relay casts as flushed NDJSON (omni listen|get);daemon/service— desktop replay daemon + service units (bd-1eefe5).
Modules§
- cast
- omni cast mode — stream stdin to the omni wire command stream (bd-5cd61e).
- config
- Canonical configuration lives in the reusable SDK; existing public paths remain valid.
- daemon
- omni daemon — persistent-connection desktop keystroke replay (bd-1eefe5).
- dispatch
- Target dispatch (bd-bfb732): cast
InjectionCommands to the endpoints of a resolved config target, mapping eachTransportto a concrete sender, with group fan-out and PER-ENDPOINT ERROR ISOLATION (one failed endpoint never aborts the rest) plus an aggregate report. - events
- Non-injecting event API, shared with direct library consumers.
- macros
- omni macro runner — parse a human-writable keystroke macro file into an
ordered list of steps (semantic commands + inter-step waits) for
omni run(bd-fdb154). - receive
- Receive omni casts from a relay as an NDJSON stream.
- service
- omni daemon service-unit generation (bd-b5c55a).
- transport
- Platform transports and shared client connection primitives.
- wire
- Canonical InjectionCommand wire, unchanged and shared with the lightweight SDK.
Structs§
- AppContext
- Context shared by every MCP tool. Kept minimal in the scaffold.
- AppError
- Same public error contract; the SDK provides the optional MCP trait adapter.
- Devices
Input - Input for the
devicesMCP tool: which devices are connected to a relay. - Devices
Output - Output for the
devicesMCP tool. - Doctor
Check - One environment/health probe result.
- Doctor
Input - Input for the
doctorcommand /doctorMCP tool. - Doctor
Report - Aggregated runtime health report for
omni doctor. - Send
Input - Build the [
ToolRouter] exposing the CLI’s command surface as MCP tools, including theself_update_*tools contributed byupdatable-cliand the Input for thesendMCP tool: a single keystroke command, optionally cast through a relay. Set exactly one oftext/key/combo/scroll. - Send
Output - Output for the
sendMCP tool. - Status
Input - Input for the
statuscommand /statusMCP tool. - Status
Output - Output for the
statuscommand /statusMCP tool.
Enums§
- Check
Status - Severity of a single
DoctorCheck.
Constants§
- TOOL_
NAME - Tool name on disk, used by the self-updater for
<tool>/<tool>_next. This is the binary name (omni). - UPDATE_
REPO_ SLUG - GitHub
owner/repothe self-updater pulls release assets from.
Functions§
- build_
router feedback_*tools contributed byfeedback-cli.- devices_
tool devicesMCP tool: list the device ids connected to a relay hub (mirrorsomni devices --relay, bd-bc8b5c).- doctor
doctorimplementation shared by the CLI and the MCP tool.- doctor_
with doctorhonoring an explicit config path (CLI--config) and an optional--probefor bounded runtime reachability checks (bd-3c9554).- feedback_
config - Feedback reporting configuration. Loaded from the environment convention:
- send_
tool sendMCP tool: cast a keystroke command, mirroringomni send. Withrelay, casts through the hub and reports delivery; otherwise returns the wire line so an agent can preview/generate the command.- status
statuscommand implementation shared by the CLI and the MCP tool.- status_
with - Pure core of
status, testable without depending on the ambient process environment.statusresolves feedback config viafeedback_config()(which consultsFEEDBACK_WEBHOOK_*); this variant takes the resolved [FeedbackConfig] explicitly so callers and tests are deterministic. Mirrors theupdater_config/updater_config_withsplit, which exists for the same reason (env mutation isunsafeunder this crate’sunsafe_code = forbid). - updater_
config - The self-updater configuration (bd-7b8ba4 builds on this).
- updater_
config_ with - Pure core of
updater_config, testable without env mutation (which isunsafeunder this crate’sunsafe_code = "forbid"). Always enables thegh auth tokenfallback for the private release repo, and uses an explicit non-empty token when provided.