tarawasm is a CLI that standardizes a WebAssembly component workflow:
- initialize project config from an input component
- generate language bindings from WIT
- build a runnable guest component
- Supported languages
- How to run tarawasm
- Quickstart
- Installation
- Docker usage
- Workflow
- Command reference
- Examples
- Development
- Tests
- Troubleshooting
| Language | init --lang |
Bind tool | Build tool | Default source | Default output |
|---|---|---|---|---|---|
| Python | python |
componentize-py |
componentize-py |
main.py |
<world>.wasm |
| Go | go |
go tool wit-bindgen-go |
tinygo build |
main.go |
<world>.wasm |
| JavaScript | js |
jco guest-types |
jco componentize |
main.js |
<world>.wasm |
| Rust | rust |
cargo component bindings |
cargo component build |
src/lib.rs |
<world>.wasm |
| C/C++ | c |
wit-bindgen c |
clang + wasm-tools component new |
component.c |
<world>.component.wasm |
In this README, tarawasm ... means "run the CLI". You can do it in any of these modes.
python3 -m tarawasm.cli --helpConvenient shell function:
tarawasm() { python3 -m tarawasm.cli "$@"; }make build
./target/tarawasm --helpdocker pull mandeser0/tarawasm:latest
alias tarawasm='docker run --rm -v "$PWD":/work -w /work mandeser0/tarawasm'Minimal local flow on Debian/Ubuntu (Python guest example):
# from repository root
make install
make check
tarawasm() { python3 -m tarawasm.cli "$@"; }
mkdir -p demo && cd demo
cp ../examples/python/docs:adder@0.1.0.wasm .
tarawasm init --lang python --wasm-file docs:adder@0.1.0.wasm adder
tarawasm bind
tarawasm build
wasmtime adder.wasm
# Hello from Python WASM!If you do not want local toolchain setup, use Docker usage instead.
make install
make checkmake install runs scripts/install_deps.sh and installs pinned tool versions.
make check runs both make system-check and make sdk-check.
If you prefer manual setup, use the same versions as the scripts:
| Category | Required version (or newer) |
|---|---|
| Go | 1.26.0 |
Rust (rustc) |
1.93.1 |
| TinyGo | 0.40.1 |
| Node.js | 24.x |
| Python | 3.10+ |
| Clang (WASI SDK build) | 19.1.5+ with wasm32-unknown-wasi target |
wkg |
0.15.0 |
wasm-tools |
1.245.1 |
cargo-component |
0.21.1 |
wit-bindgen (wit-bindgen-cli) |
0.53.1 |
@bytecodealliance/jco |
1.17.0 |
@bytecodealliance/componentize-js |
0.19.3 |
@bytecodealliance/preview2-shim |
0.17.8 |
componentize-py |
0.21.0 |
nuitka |
4.0.2 |
click |
8.3.1 |
For exact installation commands, see:
scripts/install_deps.shscripts/verify-system.shscripts/verify-sdk.sh
Use Docker when you want reproducible tooling without local installation:
docker pull mandeser0/tarawasm:latest
alias tarawasm='docker run --rm -v "$PWD":/work -w /work mandeser0/tarawasm'When building Python components, install additional packages via:
tarawasm pip install <package>By default, packages are persisted in ./.tarawasm/site-packages in your mounted project folder.
Override location if needed:
TARAWASM_PY_SITE_PACKAGES=/work/.custom-python-site tarawasm pip install <package>You need a .wasm component file (for example from WIT sources):
wkg wit build --wit-dir=<path-to-wit>tarawasm init --lang <python|go|js|rust|c> --wasm-file <input.wasm> <world>Optional overrides:
tarawasm init --lang <lang> --wasm-file <input.wasm> --wit-dir ./wit --src-file <source-file> <world>init writes tarawasm.json, extracts WIT, and generates starter source from templates.
tarawasm bindOne-off overrides:
tarawasm bind --world <world> --wit <wit-path>Language-specific flags must come after --:
tarawasm bind --world <world> -- --tool-specific-flag valueShow tool help:
tarawasm bind --tool-helptarawasm buildOne-off overrides:
tarawasm build --world <world> --src <src-file> --wit <wit-path> --out <output.wasm> --cleanLanguage-specific flags must come after --:
tarawasm build --out <output.wasm> -- --tool-specific-flag valueShow tool help:
tarawasm build --tool-help# Python
tarawasm bind -- --help
tarawasm build -- --python-path .
# Go
tarawasm bind -- --versioned
tarawasm build -- -opt=z
# JavaScript
tarawasm bind -- --quiet
tarawasm build -- --world-name adder
# Rust
tarawasm bind -- --quiet
tarawasm build -- --quiet
# C
tarawasm bind -- --rename-world adder
tarawasm build -- -O0| Command | Description |
|---|---|
tarawasm init |
Initialize project and save config |
tarawasm bind |
Generate bindings from WIT |
tarawasm build |
Compile source into WASM component |
tarawasm clean |
Remove generated artifacts |
tarawasm all |
Run clean + bind + build |
tarawasm strip |
Remove custom sections from a WASM binary |
strip default output:
tarawasm strip adder.wasm
# writes adder.strip.wasmCustom output:
tarawasm strip adder.wasm --output adder.min.wasmInstall development dependencies:
python3 -m pip install -r requirements-dev.txt
pre-commit installRun linters/formatters:
ruff .
black .
pre-commit run --all-filesBuild standalone binary:
make buildBy default, tests use wasmtime as runtime:
export WASM_RUNTIME=wasmtime
pytestRun docker-mode tests on explicit linux/amd64 image:
make test-docker-amd64Manual equivalent:
docker buildx build --platform linux/amd64 --load -t tarawasm:test-amd64 .
TARAWASM_DOCKER_IMAGE=tarawasm:test-amd64 \
TARAWASM_DOCKER_PLATFORM=linux/amd64 \
TARAWASM_RUNTIME_MODE=docker \
WASM_RUNTIME=wasmtime \
PYTHONPATH=. \
python3 -m pytest -k "cli:docker" -vvRun optional upstream integration tests:
make test-upstream-amd64Manual equivalent:
docker buildx build --platform linux/amd64 --load -t tarawasm:test-amd64 .
TARAWASM_DOCKER_IMAGE=tarawasm:test-amd64 \
TARAWASM_DOCKER_PLATFORM=linux/amd64 \
TARAWASM_RUNTIME_MODE=docker \
TARAWASM_UPSTREAM_MODE=docker \
TARAWASM_UPSTREAM_IT=1 \
PYTHONPATH=. \
python3 -m pytest tests/test_upstream_tool_repos.py -vvCommon option '--...' must be provided before '--': pass common CLI options before tool args separator.- C build fails with target error: ensure
clang --versionreportswasm32-unknown-wasi(WASI SDK clang). - Go
1.26+with TinyGo:tarawasm buildauto-setsGOTOOLCHAIN=go1.25.4+autowhen needed.