Quick Start
Run the Draxl Rust profile examples, patch a source file, and check conflicts.
These commands assume a checkout of the Draxl source workspace. Run them from
the workspace that contains Cargo.toml, crates/, and examples/.
Run The Example Loop
Validate the smallest example:
cargo run -p draxl-cli -- validate examples/01_add.rs.dxPrint canonical Draxl source:
cargo run -p draxl-cli -- fmt examples/01_add.rs.dxInspect the typed IR as JSON:
cargo run -p draxl-cli -- dump-json examples/01_add.rs.dxLower the annotated source to Rust:
cargo run -p draxl-cli -- lower examples/01_add.rs.dxThe lower-rust command is also available for the Rust profile:
cargo run -p draxl-cli -- lower-rust examples/01_add.rs.dxApply A Patch Stream
Patch streams use semantic operations over node ids and slots. This patch
renames function @f1:
// Rename the example entrypoint.
set @f1.name = add_one_fastSave it as /tmp/rename.dxpatch, then run:
cargo run -p draxl-cli -- patch examples/01_add.rs.dx /tmp/rename.dxpatchThe command prints the patched Draxl source. Add --in-place to rewrite the
source file:
cargo run -p draxl-cli -- patch --in-place examples/01_add.rs.dx /tmp/rename.dxpatchPatch comments that start with // are review notes inside the patch stream.
They are ignored during parsing, resolution, and execution.
Check Two Patch Streams
Conflict analysis compares two patch streams against the same base file:
cargo run -p draxl-cli -- conflicts \
examples/01_add.rs.dx \
/tmp/left.dxpatch \
/tmp/right.dxpatchThe command emits structured JSON for humans and agents. Hard conflicts report replay failures or incompatible operations. Semantic conflicts report structurally mergeable edits that still touch coupled meaning-bearing regions.
Use The Agent Server
Draxl can generate a workspace-local Codex MCP configuration:
cargo run -p draxl-cli -- mcp setup --client codex --root .The stdio MCP server can also run directly:
cargo run -p draxl-cli -- mcp serve --root .The server exposes tools for inspection, node replacement, statement insertion, scalar field updates, raw patch application, and conflict checks.
Example Files
The current example set is a guided tour of the Rust profile:
examples/01_add.rs.dxshows stable ids, ranks, comments, and lowering.examples/02_shapes.rs.dxshows ranked struct fields and enum variants.examples/03_match.rs.dxshows match arms, guards,<, and unary minus.examples/04_ranks.rs.dxshows lexicographic ranks inside a block.examples/05_use_tree_group.rs.dxshows groupedusetrees and paths.
Read Syntax for the file format and Patching for the patch language.