Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Transpiler CLI

cambrian-transpiler [OPTIONS] <INPUT.cam>
cambrian-transpiler --project <project.yaml> [OPTIONS]

Targets

--targetOutput
evm (default)Flat Solidity + Foundry harness
leanLean 4 Lake project

Flags

FlagDescription
-o <dir>Output directory
--project <file>Load a multi-file project.yaml (target, sources, optional library_paths / imports)
--target <name>Select backend
--dump-astParse, print AST, exit
--source-mapEmit source maps
--check-leanAfter Lean codegen, run lake build

Examples

cambrian-transpiler contracts/counter.cam -o /tmp/c-evm --target evm
cambrian-transpiler contracts/counter.cam -o /tmp/c-lean --target lean --check-lean
cambrian-transpiler --project examples/governor/project.yaml
cambrian-transpiler contracts/counter.cam --dump-ast

Build the binary with cargo build --release in the cambrian-lang workspace; the executable is target/release/cambrian-transpiler.