anrlc compile

converts a source file or an entire project directory into anrl. when the input is a directory, it enters project mode — walking the tree, resolving cross-file imports, and writing a mirror tree with a manifest.

# single file
$ anrlc compile input.json

# single file to stdout
$ anrlc compile input.json --stdout

# project mode — entire directory
$ anrlc compile ./src/ --semantic off

# with semantic enrichment and snapshot
$ anrlc compile data.json --semantic on --snapshot pre-refactor

flags

flagdefaultdescription
-o, --output <PATH>auto / <dir>-anrl/destination file (single-file) or directory (project mode)
--stdoutfalseprint result to terminal — single-file only
-f, --format <text|bin>textoutput format. bin uses messagepack — 1.2–2.7× larger than text in practice
--optimize <low|high>highhigh enables full semantic pipeline and graph-opt
--min-confidence <f32>0.3prune nodes below this epistemic threshold [0.0–1.0]
--input-format <fmt>autooverride format detection (json, yaml, md, txt, anrl, py, rs, ...)
--semantic <off|auto|on>autofastembed enrichment mode. auto triggers on island detection + prose entropy
--semantic-alpha <f32>0.75precision threshold for --implies--> similarity links [0.0–1.0]
--exclude <GLOB>exclude paths matching this glob (repeatable, project mode)
--anchor-top <N>5number of north star anchors duplicated per file (project mode)
--no-anchorsfalseskip anchor duplication (project mode)
--no-manifestfalseskip writing project.manifest.json (project mode)
--snapshot [LABEL]capture a snapshot under <source>.anrl-state/ after compile

multi-file compilation

when the input is a directory, anrl walks the tree and runs a seven-stage pipeline — resolving cross-file imports, linking shared entities, and writing a graph-native manifest you can query programmatically.

seven-stage pipeline

1
walk
discovers all supported source files, honoring .gitignore + --exclude
2
ingest
each file compiled independently
3
module-path derivation
assigns canonical module path (__init__.py-aware, Cargo.toml-aware)
4
linker
resolves imports → --references--> edges; external deps → stubs
5
semantic pass
optional project-wide --implies--> inference
6
anchor duplication
top-K highest-weight entities replicated into every file prelude
7
emit
mirror tree + project.manifest.json + project.anchors.anrl

output layout

project-anrl/
├── project.manifest.json
├── project.anchors.anrl
├── src/
│   ├── main.anrl
│   └── utils.anrl
└── config/
    └── settings.anrl
$ anrlc compile examples/project/
✓ 12 files compiled, 847 entities, 634 links
✓ wrote examples/project-anrl/

parse, stats, and inspection

utility commands for inspecting existing anrl files and auditing source files before compilation.

anrl parse

pretty-prints an existing .anrl file for human inspection. useful for verifying compiler output before injecting into llm context.

$ anrlc parse output.anrl

anrl stats

diagnostic audit of a source file — shows size, estimated tokens, anrl token count, and savings percentage. good for deciding whether to use semantic enrichment.

$ anrlc stats data.yaml

source:   575 tokens
anrl:     984 tokens
savings:  −71.1%  (helm values — deep nesting)

snapshot, diff, and stream

anrl graphs evolve over time. three subcommands capture, compare, and aggregate that evolution — enabling graph-native change tracking and rolling event aggregation.

anrlc snapshot
save, list, show

saves the current graph for a source file under <source>.anrl-state/<timestamp>-<label>.anrlb and updates a sidecar manifest.json. snapshots can also be triggered automatically as part of a compile (--snapshot flag).

anrlc snapshot save examples/code/api.py --label v1
anrlc snapshot list examples/code/api.py
anrlc snapshot show examples/code/api.py --label v1
anrlc compile src/ --snapshot pre-refactor
anrlc diff
<a> <b>

computes a graph delta and renders it as a transition graph using ~recent (added), ~expired (removed), and => (modified) markers. either side can be a source file, directory, .anrl, .anrlb, or a snapshot reference of the form <path>@<label>. apply(invert(d), b) == a is a hard invariant.

anrlc diff examples/temporal/before examples/temporal/after
anrlc diff before/ after/ -o changes.anrldiff
anrlc diff src/@v1 src/@v2          # snapshot refs
anrlc diff after/ before/ --invert  # reversible
anrlc stream
<input.jsonl>

aggregates a jsonl event log (or raw anrl lines, auto-detected per line) into a rolling graph. temporal decay: events older than --window seconds receive ~expired. reads stdin if input == '-'. supported event kinds: entity, edge, causal, primitive, expire. lines starting with @ are parsed as raw anrl.

anrlc stream examples/stream/events.jsonl
anrlc stream events.jsonl --window 60
anrlc stream events.jsonl --every 50
tail -F log.jsonl | anrlc stream - --every 50