Wasmer Cheatsheet
Wasmer is a high-performance WebAssembly runtime that lets you run WebAssembly modules safely and quickly on desktops, servers, and embedded environments. This cheatsheet covers Wasmer CLI commands for installation, module execution, WAPM package management, runtime backends, and advanced features.
Updated: 2026-07-20·22 commands
Quick Start
``bash
# Install
curl https://get.wasmer.io -sSfL | sh
# Check version wasmer --version
# Run a WebAssembly module wasmer run app.wasm
# Validate a module wasmer validate app.wasm
# Inspect module exports
wasmer inspect app.wasm
`
Install & Setup
| Command | Description |
wasmer --version | Check Wasmer version |
wasmer self-update | Update Wasmer to latest version |
wasmer self-uninstall | Uninstall Wasmer |
Basic Usage
| Command | Description |
wasmer --help | Show help information |
wasmer validate app.wasm | Validate a WebAssembly module |
wasmer inspect app.wasm | Inspect module imports/exports/metadata |
wasmer login | Log in to WAPM account |
wasmer logout | Log out of WAPM account |
wasmer whoami | Show current logged-in user |
Running Modules
| Command | Description |
wasmer run app.wasm | Run a WebAssembly module |
wasmer run app.wasm --dir /data | Run with directory access |
wasmer run app.wasm --net | Run with network access |
wasmer run app.wasm --env KEY=val | Run with environment variables |
wasmer run app.wasm --backend llvm | Run with a specific backend |
wasmer run app.wasm --forward-host-env | Forward all host env vars |
Configuration
| Command | Description |
wasmer config | View configuration info |
wasmer config --key install_dir | Get a specific config value |
Package Management
| Command | Description |
wasmer publish | Publish a package to WAPM registry |
wasmer cache clean | Clean Wasmer cache |
Advanced
| Command | Description |
wasmer instantiate app.wasm | Instantiate and persist module state |
wasmer create-exe app.wasm | Compile wasm to native executable |
| wasmer gen app.wasm` | Generate language bindings for a module |
Install & Setup(3)
| Command | Level | ||
|---|---|---|---|
wasmer --versionCheck Wasmer version | Basic | wasmer --version | |
wasmer self-updateUpdate Wasmer to the latest version | Intermediate | wasmer self-update | |
wasmer self-uninstallUninstall Wasmer | Intermediate | wasmer self-uninstall |
Basic Usage(6)
| Command | Level | ||
|---|---|---|---|
wasmer --helpShow Wasmer help information | Basic | wasmer --help | |
wasmer loginLog in to WAPM account | Basic | wasmer login | |
wasmer logoutLog out of WAPM account | Basic | wasmer logout | |
wasmer whoamiShow current logged-in user information | Basic | wasmer whoami | |
wasmer validateValidate whether a WebAssembly module is valid | Intermediate | wasmer validate app.wasm | |
wasmer inspectInspect imports, exports, and metadata of a WebAssembly module | Intermediate | wasmer inspect app.wasm |
Running(6)
| Command | Level | ||
|---|---|---|---|
wasmer runRun a WebAssembly program | Basic | wasmer run app.wasm | |
wasmer run --dirGrant directory access to the WebAssembly program | Intermediate | wasmer run app.wasm --dir /data | |
wasmer run --netEnable network access for the WebAssembly program | Intermediate | wasmer run app.wasm --net | |
wasmer run --envSet environment variables for the WebAssembly program | Intermediate | wasmer run app.wasm --env API_KEY=abc123 | |
wasmer run --backendSpecify the WebAssembly runtime backend (singlepass/cranelift/llvm) | Expert | wasmer run app.wasm --backend llvm | |
wasmer run --forward-host-envForward all host environment variables to the WebAssembly program | Expert | wasmer run app.wasm --forward-host-env |
Configuration(2)
| Command | Level | ||
|---|---|---|---|
wasmer configView Wasmer configuration info (install path, version, etc.) | Basic | wasmer config | |
wasmer config --keyGet the value of a specific configuration key | Intermediate | wasmer config --key install_dir |
Package Management(2)
| Command | Level | ||
|---|---|---|---|
wasmer publishPublish a WebAssembly package to the WAPM registry | Intermediate | wasmer publish | |
wasmer cache cleanClean the Wasmer cache | Intermediate | wasmer cache clean |
Advanced(3)
| Command | Level | ||
|---|---|---|---|
wasmer instantiateInstantiate a WebAssembly module and persist its state | Expert | wasmer instantiate app.wasm | |
wasmer create-exeCompile a WebAssembly module into a native executable | Expert | wasmer create-exe app.wasm | |
wasmer genGenerate language bindings for a WebAssembly module | Expert | wasmer gen app.wasm |
FAQ
This cheatsheet is compiled from official tool documentation. Last updated: 2026-07-20.