orion-search / cli
bin/orion for Orion: plan, apply, reindex, prune, drift, status, flush, verify, capabilities and the outbox drain, as deterministic JSON an agent can branch on
dev-main / 1.0.x-dev
2026-10-27 18:41 UTC
Requires
- php: >=8.3
- orion-search/core: ^1.0
- symfony/console: ^7.0 || ^8.0
- symfony/yaml: ^7.0 || ^8.0
Requires (Dev)
- orion-search/testing: ^1.0
Suggests
None
Provides
None
Conflicts
None
Replaces
None
This package is auto-updated.
Last update: 2026-10-27 19:17:36 UTC
README
bin/orion, Orion's command line: plan, apply, reindex, prune, drift, status, flush, verify, capabilities, the
outbox drain and retry, and receipt key generation, run against your application's own storage and engines, with
output as YAML for people or canonical JSON for scripts and agents.
composer require orion-search/cli
<?php // orion.php: what bin/orion runs against require __DIR__ . '/vendor/autoload.php'; return new Orion\Wiring\Config( storage: new Orion\Pdo\PdoStorage($pdo), engines: new Orion\Registry\EngineRegistry(elasticsearch: Orion\Elasticsearch\ElasticsearchEngine::connect($url)), tenancy: Orion\Tenancy\Tenancy::single(), );
vendor/bin/orion apply products --bootstrap=orion.php ORION_BOOTSTRAP=orion.php vendor/bin/orion outbox:drain --json
- The bootstrap file returns your
Orion\Wiring\ConfigorOrion\Orion; pass it with--bootstrap(-b) orORION_BOOTSTRAP.receipts:keygenneeds none. - A schema comes from the index's
search:manifest, or from--schema=<file>(a manifest or the schema's array form, YAML or JSON). The engine defaults to the one that built the index, then the manifest's, then the only one configured;--engineoverrides it. - Every mutating command takes
--dry-runand prints what it would do. - Exit codes: 0 done; 1 failed, with the error printed as data (
error.type,error.message); 3 action required (applyfound a breaking change that needs a reindex,drift --checkfound drift). --jsonoutput is canonical: keys sorted at every depth, so the same state prints the same bytes.- A host can add the commands to its own console:
Orion\Cli\Application::commands(new Orion\Cli\Context($orion))returns them all. The Univeros module does this, asbin/altair orion:*.
| Command | Does |
|---|---|
plan <index> |
Diff the declared schema against the live index and classify every change |
apply <index> |
Create the index or apply additive changes in place; refuse breaking ones |
reindex <index> |
Rebuild from the outbox into the next version and swap the alias; --abort gives up an interrupted one |
prune <index> |
Drop replaced versions after the grace window (--grace, 300 s) |
drift |
Report drift between declared schemas and their indices; --check exits 3 on any |
status <index> |
Versions, alias, outbox lag, dead letters, pending reindex, receipts, capabilities |
flush <index> |
Refresh or commit the index behind the alias |
verify |
Verify the receipt chain; --head=<sequence>:<hash> anchors it |
capabilities [<engine>] |
Print the capability matrix |
outbox:drain [<index>] |
Write outbox entries to their indices and report lag |
outbox:retry <index> |
Resend an index's dead letters |
receipts:keygen |
Generate an Ed25519 key pair (--kid) |
Every command, with its options and output, is in the CLI reference.