Skip to content

Using plugins

Wago keeps host capabilities outside the core runtime. Plugins add the capabilities a module needs without putting every integration into Wago itself.

In this guide, you will add WASI Preview 1 support to a local project and run a module that writes to standard output.

Installing the WASI plugin and running a WASI module

Before you begin

You need:

  • Wago installed with a runtime selected. Complete Getting started first if wago --version does not show an active runtime.
  • Go 1.22 or newer. Wago plugins are Go modules compiled into your runtime.

Check both tools from your terminal:

sh
wago --version
go version

Create a local Wago project

Create or enter a directory for the example, then initialize it:

sh
mkdir wasi-example
cd wasi-example
wago init --run

This creates a wago.json manifest. Keeping the plugin local makes the project's dependencies and reviewed access reproducible instead of changing the runtime used by every project on your machine.

Add WASI

WASI defines system-style interfaces that WebAssembly modules can import. Wago provides those interfaces through the official wago-org/wasi plugin:

sh
wago add wago-org/wasi

Keep Preview 1 selected for this example. Review the source, dependencies, and requested Authorities before accepting them. Plugins are native Go dependencies; grants control access to privileged Wago integration APIs, but they do not sandbox arbitrary plugin code.

Now, check to make sure it is installed:

sh
wago plugins list

A lot of the subcommands have aliases so that it reads naturally. For example, wago plugin and wago plugins both work the same way.

The command updates wago.json, writes the complete resolved graph and reviewed grants to wago-lock.json, and builds a project runtime. Commit both JSON files with your project.

Download a WASI module

This small module imports WASI Preview 1's fd_write function and calls it from _start:

sh
curl -fsSL https://wago.sh/corpora/wasi-hello.wasm -o wasi-hello.wasm

You can see the import before executing the module:

sh
wago module imports wasi-hello.wasm

Run it

sh
wago run wasi-hello.wasm

You should see:

text
hello from wasi

You can even compile it to a standalone executable:

bash
wago compile wasi-hello.wasm -o wasi-hello
./wasi-hello
powershell
wago compile wasi-hello.wasm -o wasi-hello.exe
.\wasi-hello.exe

Wago finds the nearest wago.json, selects its project runtime, and uses the WASI plugin to satisfy the module's import.

Where to go next

Released under the Apache 2.0 License.