-
Notifications
You must be signed in to change notification settings - Fork 0
Command Reference
I use this as my complete command-line reference for l0c in the current v1 toolchain.
I keep CLI behavior deterministic:
- success path prints stable text output (
ok, metadata lines, or run result) - failure path uses stable
usage: ...orerror: ...forms - exit-code/error class stability is frozen in
docs/ERROR_MODEL.md
Canonicalize a module and emit canonical source.
Forms:
./bin/l0c canon <module.l0>./bin/l0c canon <module.l0> -o <out.l0>
Success example:
./bin/l0c canon tests/valid_min.l0 -o /tmp/min.canon.l0Failure example:
./bin/l0c canon tests/invalid_order.l0Expected class: error: invalid module shape or non-canonical input.
Parse and verify canonical module validity.
Form:
./bin/l0c verify <module.l0>
Success example:
./bin/l0c verify tests/valid_min.l0Failure example:
./bin/l0c verify tests/invalid_order.l0Expected class: error: invalid module shape or non-canonical input.
Build L0 source to L0 image, optionally emitting debug-map and trace-schema side artifacts.
Forms:
./bin/l0c build <module.l0> <out.l0img>./bin/l0c build <module.l0> -o <out.l0img>./bin/l0c build <module.l0> <out.l0img> --debug-map <out.map> --trace-schema <out.schema>
Success example:
./bin/l0c build tests/valid_trace_noop.l0 /tmp/trace.img \
--debug-map /tmp/trace.map \
--trace-schema /tmp/trace.schemaFailure example:
./bin/l0c build /tmp/no_such_file.l0 /tmp/out.imgExpected class: error: cannot open input.
Build L0 source to ELF64 relocatable object output.
Form:
./bin/l0c build-elf <module.l0> <out.o>
Success example:
./bin/l0c build-elf tests/valid_sysv_abi_sum6_lowered.l0 /tmp/sum6.oFailure example:
./bin/l0c build-elf /tmp/no_such_file.l0 /tmp/sum6.oExpected class: error: cannot open input.
Validate L0 image container integrity and schema constraints.
Form:
./bin/l0c imgcheck <file.l0img>
Success example:
./bin/l0c imgcheck /tmp/trace.imgFailure example:
printf 'BADIMG' >/tmp/bad.img && ./bin/l0c imgcheck /tmp/bad.imgExpected class: error: invalid or corrupt L0IMG.
Print stable decoded metadata for a valid L0 image.
Form:
./bin/l0c imgmeta <file.l0img>
Success example:
./bin/l0c imgmeta /tmp/trace.imgFailure example:
printf 'BADIMG' >/tmp/bad.img && ./bin/l0c imgmeta /tmp/bad.imgExpected class: error: invalid or corrupt L0IMG.
Execute code payload from L0 image and print returned u64 value.
Form:
./bin/l0c run <file.l0img> [u64_a] [u64_b] [u64_c] [u64_d] [u64_e] [u64_f]
Success example:
./bin/l0c run /tmp/trace.img 123Failure example:
./bin/l0c run /tmp/trace.img not_a_u64Expected class: error: invalid run argument (expected unsigned decimal).
Decode binary trace records into stable text output.
Form:
./bin/l0c tracecat <trace.bin>
Success example:
./bin/l0c tracecat /tmp/trace.binFailure example:
printf '\x01' >/tmp/truncated.trace && ./bin/l0c tracecat /tmp/truncated.traceExpected class: error: invalid module shape or non-canonical input.
Decode debug-map payload into stable text output.
Form:
./bin/l0c mapcat <debug_map.bin>
Success example:
./bin/l0c mapcat /tmp/trace.mapFailure example:
printf 'BAD!' >/tmp/bad.map && ./bin/l0c mapcat /tmp/bad.mapExpected class: error: invalid module shape or non-canonical input.
Decode trace-schema payload into stable text output.
Form:
./bin/l0c schemacat <trace_schema.bin>
Success example:
./bin/l0c schemacat /tmp/trace.schemaFailure example:
printf 'BAD!' >/tmp/bad.schema && ./bin/l0c schemacat /tmp/bad.schemaExpected class: error: invalid module shape or non-canonical input.
Join trace records against debug-map entries and print correlated output.
Form:
./bin/l0c tracejoin <trace.bin> <debug_map.bin>
Success example:
./bin/l0c tracejoin /tmp/trace.bin /tmp/trace.mapFailure example:
./bin/l0c tracejoin /tmp/no_trace.bin /tmp/no_map.binExpected class: error: cannot open input.
- error model:
docs/ERROR_MODEL.md - workflows:
docs/WORKFLOWS.md - binary/trace schema contracts:
docs/DEBUG_MAP_SCHEMA.md,docs/TRACE_SCHEMA.md
- How-To-Write-L0
- Language-Reference
- Instruction-Set
- CLI-and-Compiler-Spec
- Implementable-Spec
- Command-Reference
- Examples-Catalog
- LLM-Quick-Reference
- Opcode-Examples
- LLM-Doc-Index