CLI Reference
Every command the Orvienm CLI exposes today, what it does, and the exit code it returns.
Invocation
The CLI is installed as orvienm. Run orvienm --help for the command list and orvienm <command> --help for a single command. orvienm --version prints the engine version.
Commands that take an optional file argument fall back to the first of .orvienm.yaml, orvienm.yaml orvienm.yml found in the working directory. validate, verify, status, doctor, fingerprint require the argument explicitly.
Lifecycle commands
orvienm validate <file> [--json]
Check a specification without touching the filesystem.
The file argument is required. Every other command validates before doing anything, so a failure here blocks the rest of the lifecycle.
exit: 0 valid · 1 validation error · 4 file missing or unparseable
orvienm plan [file]
Show the difference between the declared structure and what exists.
Prints one line per directory — create, keep or undeclared — followed by a summary. A declared path is compared together with the directories it implies, so a nested entry converges after apply. Undeclared means present on disk but absent from the specification; apply neither creates nor removes it.
exit: 0
orvienm apply [file] [--dry-run] [--json]
Create the declared structure.
Additive and conservative. If the root does not exist, creates it and every declared directory inside it, including intermediates implied by nested entries. If the root already exists, creates the declared directories that are missing and leaves the rest untouched. Directories and files that are not declared are never removed or overwritten. Refuses to run when the specification has drifted from .orv.lock unless --dry-run is passed. A successful run records the specification in .orv.lock. If a file occupies a path declared as a directory, apply names it, creates nothing at all and leaves the file untouched.
exit: 0 created, grown or already compliant · 2 filesystem error or a file where a directory is declared · 3 drift detected
orvienm verify <file>
Check that every declared directory exists.
Prints Status: VALID or Status: INVALID, checking each declared path together with the directories it implies. It does not look at the lock file, the fingerprint or undeclared directories — use status or doctor for those.
exit: 0 complete · 2 a declared directory is missing
Inspection commands
orvienm status <file> [--json]
Summarise root, structure, lock file and fingerprint in one view.
Reports FOUND/NOT FOUND for the root and the lock file, COMPLIANT/INVALID for the declared directories, and MATCH/DRIFT_DETECTED for the fingerprint. Overall is CLEAN only when all four are good.
exit: 0 clean · 2 anything else
orvienm doctor <file> [--json] [--strict]
Full diagnostic, including undeclared directories.
The only command that reports orphan directories — directories present on disk but absent from the specification — alongside missing directories and fingerprint state. Diagnosis is HEALTHY or CRITICAL; any missing directory, any orphan or a drifted fingerprint makes it CRITICAL. Reporting by default: --strict is what turns a CRITICAL diagnosis into a failure. Detection is identical either way, and so is the --json output.
exit: 0 · 2 with --strict when the diagnosis is not HEALTHY
orvienm fingerprint <file> [--json]
Print the SHA-256 fingerprint of the specification.
Hashes a canonical manifest built from version, style, structure.name and the sorted directory list. Reordering directories does not change it; changing style does.
exit: 0
orvienm policy [file] [--strict]
Check declared policy rules against the declared structure.
Reads policy.forbid from the specification and reports any forbidden name found inside the declared structure, at any depth. Reporting by default, so adding a policy block cannot turn a green pipeline red on its own; --strict is what makes a violation fail a build. The scan covers the declared structure root, not the working directory, so a forbidden name beside that root passes even under --strict.
exit: 0 · 2 with --strict when a violation is found
Scaffolding commands
orvienm new <name>
Create an example project in a new directory.
Creates name/, writes name/.orvienm.yaml, and creates core, governance and products inside it. Run the lifecycle commands from the directory that contains name/, not from inside it — structure.name is resolved relative to the working directory, so applying from inside would create a second nested root.
exit: 0 · 4 if the directory already exists
orvienm init <name>
Declare a structure in the current directory.
Writes .orvienm.yaml in the current directory declaring name as the managed root, with core, governance and products inside it. It creates no directories — apply does that, as everywhere else — so plan immediately after init shows the whole structure as pending. The name is required and is the root being declared: run init in the directory you want the structure to live under. It will not overwrite an existing specification.
exit: 0 · 2 usage error if no name is given
Exit codes
Every command exits with one of six codes, which is what makes the CLI usable in CI.
0 success 1 validation error 2 structure invalid 3 drift detected 4 file error (missing, empty or unparseable) 5 internal error
verify, status and doctor --strict all exit 2 on a structural problem, so any of them can gate a pipeline. policy reports by default and exits 0 even when it finds a violation; --strict is what turns the same finding into exit 2. Detection is identical either way - only the exit code changes.
Flags
--json is available on validate, apply, fingerprint, status, doctor. --dry-run exists only on apply. --strict exists only on doctor, where it makes any non-healthy diagnosis a hard failure.
graph
orvienm graph [file] [--edges] prints the declared structure as a hierarchy, expanding nested entries into the tree the engine actually creates. It exits 0.
--edges reports that the specification declares no relationships. The format has no relationship syntax in this Alpha — the validator rejects any such key — so there are no edges to draw.