CLI Reference
The lodec command-line tool provides five commands for working with LODE schemas and Vein binaries.
Usage
lodec <command> [arguments] [flags]Commands
compile
Encode a JSON file into Vein binary format.
lodec compile <input.json> -s <schema.lode> -o <output.vein>| Flag | Required | Description |
|---|---|---|
-s | Yes | Path to the .lode schema file |
-o | Yes | Output path for the .vein binary |
Output:
Compiled layer.json → layer.vein (87 bytes)
Fingerprint: a3f8c2e9b4d1...The fingerprint is printed to stdout for convenience — use it with verify later.
decode
Decode a Vein binary back to JSON and print to stdout.
lodec decode <input.vein> -s <schema.lode>| Flag | Required | Description |
|---|---|---|
-s | Yes | Path to the .lode schema file |
Output:
{
"name": "preview",
"isDefault": true,
"models": ["gpt-oss:20b", "qwen3:30b"],
"defaultModel": "gpt-oss:20b"
}fingerprint
Compute the canonical SHA-256 hash of a JSON file.
lodec fingerprint <input.json> [-s <schema.lode>] [--id <name>]Without -s, this is the v0.1 schema-less fingerprint: it operates on the raw JSON object and sorts every all-string array.
With -s (v0.2), the input is type-checked and the fingerprint is the SHA-256 of its typed canonical form: list<T> order is kept.
--id <name> prints a versioned identifier, <name>@<first 12 hex digits>, instead of the full hash.
Output:
a3f8c2e9b4d1f6a0...
rules-v0@5a316e4bf6d7 # with --id rules-v0check v0.2
Type-check a JSON file against a schema. Prints ✓ Conforms and exits 0, or prints one line per issue and exits 1.
lodec check rules.json -s routing-snapshot-v1.lode/stages/3/rules/0/emit/weightBp: int 12000 > max 10000
/stages/0/rules/0/when: variant needs exactly one of anyKeyword, regex, ...; got 2canonical v0.2
Type-check a JSON file and print (or write with -o) its canonical JSON: sorted keys, sorted string[], ordered list<T>, optional fields omitted when absent.
lodec canonical rules.json -s routing-snapshot-v1.lode -o rules.canonical.jsonverify
Check a Vein binary against a known fingerprint.
lodec verify <input.vein> <fingerprint> -s <schema.lode>| Flag | Required | Description |
|---|---|---|
-s | Yes | Path to the .lode schema file |
Output:
✓ VerifiedExit code: 0 on success, 1 on failure.
diff
Compare two Vein binaries field by field.
lodec diff <a.vein> <b.vein> -s <schema.lode>| Flag | Required | Description |
|---|---|---|
-s | Yes | Path to the .lode schema file |
Output:
defaultModel:
- "gpt-oss:20b"
+ "qwen3:30b"
models:
- ["gpt-oss:20b","qwen3:30b"]
+ ["gpt-oss:20b","qwen3:30b","devstral:24b"]If the two binaries are identical, prints No differences.
Help
lodec --help
lodec -hExamples
# Full workflow: compile, fingerprint, verify
lodec compile config.json -s schema.lode -o config.vein
lodec fingerprint config.json > config.fp
lodec verify config.vein $(cat config.fp) -s schema.lode
# Compare two versions
lodec diff v1.vein v2.vein -s schema.lode