@ordo-engine/cli
v0.9.1
Published
CLI for Ordo, an open-source decision engine. Write decisions as rule files, test and trace them, and see which decisions a change moves. Includes an MCP server for coding agents and Ordo Guard.
Maintainers
Readme
Ordo CLI
Turn judgments into decisions. Ordo is an open-source decision engine: models and scores tell you what is going on, and Ordo decides what to do about it. Write those decisions as rule files with tests, and see which decisions a change moves before you ship it. It works offline, and coding agents can use it over MCP.
Write and test rules as files
npx @ordo-engine/cli init my-rules
cd my-rules
npx @ordo-engine/cli validate
npx @ordo-engine/cli test
npx @ordo-engine/cli trace loan-approval --input '{"amount":5000}'Or install globally:
npm i -g @ordo-engine/cli
ordo --helpThe install step downloads a prebuilt static binary for your platform from the matching GitHub Release. If none is available, build from source:
cargo install --git https://github.com/Ordo-Engine/Ordo ordo-cliSee what a change affects
Apps that use a decision model like Jev often have a line such as
if jev.confidence > 0.85: refund(order). It rarely gets reviewed, and it
means something else after the next model update. In the
jev-routing
rule pack that threshold is a rule with tests. Lower it to 0.80 and all 12
tests still pass. impact shows what they missed:
$ ordo impact refund-routing
impact refund-routing (HEAD → working tree)
309 inputs: 12 tests, 0 captured, 297 boundary probes
LLM_DRAFT → AUTO_REFUND 18 inputs
LLM_DRAFT → HUMAN_REVIEW 3 inputs
…
21 changed · 288 unchanged18 requests that used to wait for a person now get their money back without anyone reading the message.
impact runs your working copy next to the last commit in git, over the
ruleset's tests, real inputs you provide (--inputs) and probe inputs on both
sides of every threshold, and lists each decision that changed. Add
--fail-on-change to stop surprise changes in CI.
Ready-made projects to try it on (refund routing after Jev, credit approval, promo stacking, fraud scoring) are in examples/rule-packs.
Use it from a coding agent (MCP)
claude mcp add ordo -- ordo mcpThis exposes list_files, read_file, grep, write_file, delete_file,
validate, run_tests, trace, impact, and publish to the agent. Local edits and
checks run offline; publish requires ordo mcp --allow-publish.
Ordo Guard: keep coding agents in bounds
npx @ordo-engine/cli guard init # Claude Code (default)
npx @ordo-engine/cli guard init --agent codex,cursor # …and/or Codex CLI, CursorEvery tool call from the hooked agent(s) now runs through the same local rule that decides allow, deny or ask. When the agent tries something destructive, Ordo stops it with a reason:
⛔ Denied by policy: Destructive shell command blocked by policy [[email protected] · DENY]The policy lives in .ordo-guard/ as a normal Ordo project, so it has its own
tests:
ordo guard doctor # check the hook is registered, present and answering
ordo guard test # run the policy's own tests
ordo guard log # every decision, with a timestamp
ordo guard upgrade # move a policy scaffolded by an older CLI to the current defaultEdit .ordo-guard/rulesets/policy.json in plain expressions
(tool == 'Bash' && 'terraform destroy' in subcommands) and add a test.
Shell commands are parsed, not substring-matched, so rm -r -f, /bin/rm -Rf
and bash -c 'rm -rf x' hit the same rule. The default policy blocks
destructive shell + secret access, asks before git push / npm publish, and
allows read-only git right away. On an internal error the hook allows the
call (--fail-closed denies it instead).
Commands
| | |
|---|---|
| ordo guard init / hook / test / log / doctor | deterministic guardrails for a coding agent |
| ordo init [dir] | scaffold a project |
| ordo validate / test / trace | check rules offline |
| ordo impact <ruleset> | which decisions an edit changed vs git HEAD (tests + boundary probes) |
| ordo replay <captured.jsonl> | replay recorded decisions; spot flips; --write-tests |
| ordo fmt / lint / new | format, lint, scaffold |
| ordo login / link / pull / push / publish | sync with the platform |
| ordo mcp | run as an MCP server (stdio) |
Add --json to any command for machine-readable output.
