Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CLI Reference (rumi)

rumi is the command-line interface for running and validating matcher configs across three domains.

Installation

cargo install --path rumi/cli

Usage

rumi <command> [domain] [options]

Domains

The CLI supports three matching domains. Each domain has its own registry of type URLs and context type.

DomainContextDescription
(default)Key-value pairsTest domain (xuma.test.v1.*)
httpHTTP requestMethod, path, headers, query params (xuma.http.v1.*)
claudeHook eventClaude Code hook events (xuma.claude.v1.*)

Commands

run

Run a config file against a context and print the resulting action.

Test domain (default):

rumi run config.yaml --context method=GET path=/api
FlagDescription
--context key=value...Context key-value pairs

HTTP domain:

rumi run http routes.yaml --method GET --path /api/users
rumi run http routes.yaml --method POST --path /api --header content-type=application/json
FlagDescription
--method METHODHTTP method (required)
--path PATHRequest path (required)
--header key=valueHeader (repeatable)
--query key=valueQuery parameter (repeatable)

Claude domain:

rumi run claude hooks.yaml --event PreToolUse --tool Bash --arg command="ls -la"
rumi run claude hooks.yaml --event SessionStart --cwd /home/user --branch main
FlagDescription
--event EVENTHook event name (required)
--tool NAMETool name
--arg key=valueTool argument (repeatable)
--cwd PATHWorking directory
--branch NAMEGit branch
--session IDSession ID

Valid events: PreToolUse, PostToolUse, Stop, SubagentStop, UserPromptSubmit, SessionStart, SessionEnd, PreCompact, Notification.

Prints the matched action string, or (no match) if nothing matched.

check

Validate a config file without evaluating:

rumi check config.yaml
rumi check http routes.yaml
rumi check claude hooks.yaml

Loads the config against the domain’s registry (including type URL resolution and depth validation). Catches: unknown type URLs, invalid regex patterns, depth limit violations, malformed config.

Prints Config valid on success. Exits with non-zero status on error.

info

List all registered type URLs for a domain:

$ rumi info
Registered inputs:
  xuma.test.v1.StringInput

Registered matchers:
  xuma.core.v1.StringMatcher
  xuma.core.v1.BoolMatcher

$ rumi info http
Registered inputs:
  xuma.http.v1.PathInput
  xuma.http.v1.MethodInput
  xuma.http.v1.HeaderInput
  xuma.http.v1.QueryParamInput

Registered matchers:
  xuma.core.v1.StringMatcher
  xuma.core.v1.BoolMatcher

$ rumi info claude
Registered inputs:
  xuma.claude.v1.EventInput
  xuma.claude.v1.ToolNameInput
  xuma.claude.v1.ArgumentInput
  xuma.claude.v1.SessionIdInput
  xuma.claude.v1.CwdInput
  xuma.claude.v1.GitBranchInput

Registered matchers:
  xuma.core.v1.StringMatcher
  xuma.core.v1.BoolMatcher

help

rumi help
rumi --help
rumi -h

Config File Format

The CLI accepts the same config format used by all implementations. See Config Format for the full schema. Files can be YAML (.yaml, .yml) or JSON (.json).

Exit Codes

CodeMeaning
0Success
1Error (invalid config, unknown command, missing flags, etc.)

Design

The CLI has zero runtime dependencies beyond rumi, rumi-http, and rumi-test. No clap – argument parsing is hand-written. The binary is small and builds fast.

Each domain registers its own Registry<Ctx>:

  • Test: rumi_test::register() -> Registry<TestContext>
  • HTTP: rumi_http::register_simple() -> Registry<HttpRequest>
  • Claude: rumi::claude::register() -> Registry<HookContext>