Quickstart¶
Build and run your first WASI component in under 2 minutes.
Prerequisites¶
- Run installed with v2 support (
cargo install run-kit --features v2) wasm-toolsinstalled (cargo install wasm-tools)
1. Create a Project¶
This creates:
my-app/
├── run.toml # Project configuration
├── components/
│ ├── hello.wat # Starter component (WebAssembly Text)
│ └── hello.wasm # (will be compiled)
└── wit/
└── hello.wit # WIT interface definition
The generated run.toml:
[project]
name = "my-app"
version = "0.1.0"
[[component]]
name = "hello"
path = "components/hello.wasm"
[[test]]
component = "hello"
function = "greet"
args = ["s32:42"]
expected = "s32:43"
2. Build the Starter Component¶
The starter is a WAT (WebAssembly Text) file — a human-readable format that compiles to .wasm:
What's in the starter?
The generated hello.wat exports a greet function that takes an s32 (signed 32-bit integer) and returns it incremented by 1. Simple, but it proves the entire pipeline works.
3. Run the Test¶
4. Execute the Component¶
Call with different arguments:
5. Start the Dev Server¶
The dev server watches for file changes and rebuilds automatically. Press Ctrl+C to stop.
6. Inspect the Component¶
What Just Happened?¶
You just:
- Created a WASI 0.2 component from a WAT source file
- Tested it with automated assertions
- Executed it in a sandboxed Wasmtime runtime with strict determinism
- Inspected its interface (exports, types)
- Started a dev server with hot reload
The component runs identically on macOS, Linux, and Windows. No Docker. No VM. No platform-specific binaries.
Next: Write a Real Component¶
The starter uses WAT for simplicity. For real applications, write components in your preferred language:
Define your component in run.toml:
Requires tinygo installed:
Next: Publish to Registry¶
Once your component works, share it:
Others can install it:
Next Steps¶
- Commands — Full reference for all
run v2commands - Configuration — Complete
run.tomlreference - Registry — Publish and install components
- Deployment — Deploy to edge platforms