Useful WebAssembly Tools
Beyond the wasmCloud toolchain, the WebAssembly community maintains many open source projects that are invaluable for Wasm users. This is a non-comprehensive list of tools we've found particularly useful.
WIT syntax highlighting (VSCode)
Syntax highlighting can make WIT definitions easier to read. The VSCode extension maintained by the Bytecode Alliance brings a more legible WIT experience to your IDE.
You can install via the extensions marketplace or manually. For a manual install, you will need npm
. Run:
git clone https://github.com/bytecodealliance/vscode-wit.git && cd vscode-wit
npm ci && npm run install-plugin
WIT dependency management with wit-deps
It's important to ensure consistency between the WIT dependencies defined in your deps.toml
manifest and the actual files in your project. wit-deps
is a simple dependency management CLI tool maintained by the Bytecode Alliance that ensures your dependencies are consistently and correctly populated.
You will need Rust and cargo
. Install wit-deps
by running:
cargo install wit-deps-cli
Run wit-deps
from the root of a wasmCloud project directory (one level above wit
) to populate the deps
directory with the definitions specified in deps.toml
and create a deps.lock
file:
wit-deps
For more detail on wit-deps
, see the documentation in the project README.
WebAssembly artifact manipulation with wasm-tools
Sometimes you might want to observe or manipulate a component independently of wasmCloud—perhaps to view the component's WIT interface, compose Wasm components into one, or even for more niche jobs like converting a WebAssembly module to a component. The wasm-tools
CLI tool is a utility belt with a long list of options.
You will need Rust and cargo
. Install wasm-tools
by running:
cargo install wasm-tools
A standalone WebAssembly runtime: Wasmtime
Wasmtime is the WebAssembly runtime used by the wasmCloud host. If you'd like to test a component against standalone Wasmtime or explore runtime features, you can also install Wasmtime locally and use it to run components.
To install on Linux or macOs run:
curl https://wasmtime.dev/install.sh -sSf | bash
Virtualize components with WASI Virt
WASI Virt allows you to encapsulate a virtualized component within another component. This is particularly useful when you want to use potentially sensitive WASI APIs such as Sockets and Filesystem but don't want to give them access to core operating system interfaces.
WASI Virt requires the nightly release channel for Rust:
rustup toolchain install nightly
Install the wasi-virt
command line tool with cargo
:
cargo +nightly install --git https://github.com/bytecodealliance/wasi-virt