WIT-first contract compiler for stable Rust, protobuf, JSON Schema, and versioned adapters
witforge rust wit --out generated/rust
witforge proto wit --out generated/proto
witforge schema wit --out generated/schema
witforge glue wit --out generated/glue \
--plain-root crate::plain \
--proto-root crate::proto
--plain-root and --proto-root are Rust module paths used by generated glue. They are not filesystem paths.
version = 1
[project.example]
root = "wit"
[project.example.rust]
out = "generated/rust"
serde = true
[project.example.proto]
out = "generated/proto"
[project.example.schema]
out = "generated/schema"
[project.example.glue]
out = "generated/glue"
plain-root = "crate::plain"
proto-root = "crate::proto"
Then run:
witforge rust --config witforge.toml
witforge proto --config witforge.toml
witforge schema --config witforge.toml
witforge glue --config witforge.toml
Each emitter needs its own output directory. witforge only overwrites or removes files that start with its generated header, and the Rust, protobuf, and glue emitters write the same header: in a shared directory each removes the others’ files as stale output. It refuses symlinks, directories, and unowned files at expected output paths.
Every generator supports --check, which writes nothing and fails on missing, changed, or extra generated files.
The generated-output guide shows current Rust, protobuf, JSON Schema,
glue, and version-adapter output from the committed runnable examples. The full files are checked
with --check in this repository’s CI.