Skip to main content

Crate omni_cli

Crate omni_cli 

Source
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); dispatch fans 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 each Transport to 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.
DevicesInput
Input for the devices MCP tool: which devices are connected to a relay.
DevicesOutput
Output for the devices MCP tool.
DoctorCheck
One environment/health probe result.
DoctorInput
Input for the doctor command / doctor MCP tool.
DoctorReport
Aggregated runtime health report for omni doctor.
SendInput
Build the [ToolRouter] exposing the CLI’s command surface as MCP tools, including the self_update_* tools contributed by updatable-cli and the Input for the send MCP tool: a single keystroke command, optionally cast through a relay. Set exactly one of text/key/combo/scroll.
SendOutput
Output for the send MCP tool.
StatusInput
Input for the status command / status MCP tool.
StatusOutput
Output for the status command / status MCP tool.

Enums§

CheckStatus
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/repo the self-updater pulls release assets from.

Functions§

build_router
feedback_* tools contributed by feedback-cli.
devices_tool
devices MCP tool: list the device ids connected to a relay hub (mirrors omni devices --relay, bd-bc8b5c).
doctor
doctor implementation shared by the CLI and the MCP tool.
doctor_with
doctor honoring an explicit config path (CLI --config) and an optional --probe for bounded runtime reachability checks (bd-3c9554).
feedback_config
Feedback reporting configuration. Loaded from the environment convention:
send_tool
send MCP tool: cast a keystroke command, mirroring omni send. With relay, casts through the hub and reports delivery; otherwise returns the wire line so an agent can preview/generate the command.
status
status command implementation shared by the CLI and the MCP tool.
status_with
Pure core of status, testable without depending on the ambient process environment. status resolves feedback config via feedback_config() (which consults FEEDBACK_WEBHOOK_*); this variant takes the resolved [FeedbackConfig] explicitly so callers and tests are deterministic. Mirrors the updater_config / updater_config_with split, which exists for the same reason (env mutation is unsafe under this crate’s unsafe_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 is unsafe under this crate’s unsafe_code = "forbid"). Always enables the gh auth token fallback for the private release repo, and uses an explicit non-empty token when provided.