Skip to main content
Version: v2.0.0-rc

Wasm Shell Configuration

This document describes the configuration options available for the wash CLI. Configuration can be specified in YAML, JSON, or TOML format (.json, .yaml, .yml, or .toml).

Wasm Shell uses two configuration files:

Configuration hierarchy

Configuration is merged with the following precedence (highest to lowest):

  1. CLI arguments
  2. Environment variables (WASH_ prefix)
  3. Project config (.wash/config.yaml)
  4. User config ($HOME/.config/wash/config.yaml)
  5. Default values

User configuration

By default, user configuration files are found at $HOME/.config/wash/config.yaml.

Under construction

This section is under active development—please check back soon for a more complete reference.

Project configuration

Projects can be configured via a project config file that resides in the .wash directory at the project root, and which may be expressed in JSON, YAML, or TOML format.

Top-level project configuration options include:

OptionTypeDescription
versionstringConfiguration schema version
buildobjectBuild configuration options
devobjectDevelopment server configuration options
witobjectWIT dependency management configuration

version configuration

Specify the wash version for this project.

Example:

yaml
version: 2.0.0-rc.7

build configuration

Wasm Shell builds WebAssembly component binaries by wrapping language-specific utilities like cargo, go, npm, etc, and project configuration files are used to define configuration for builds.

Wasm Shell executes the build command for your language toolchain specified in your project configuration file.

build options

OptionTypeDefaultDescription
commandstring-Build command to execute
envmap{}Environment variables to set during the build process
component_pathstring-Path to the output Wasm component file

build examples

yaml
build:
  command: cargo build --target wasm32-wasip2 --release
  component_path: target/wasm32-wasip2/release/project_name.wasm

dev configuration

wash dev builds a component according to the specified build options (unless otherwise specified in the dev options) and then starts a local development server. There are a variety of options available for local development.

dev options

OptionTypeDefaultDescription
commandstring-Custom command to run for building during development
addressstring-Address for the development server to listen on
servicebooleanfalseWhether to run as a long-running service with port binding
service_filestring-Path to a service definition file
componentsarray[]Additional components to load during development
volumesarray[]Volumes to mount from host to guest
host_interfacesarray[]WIT interfaces to expose from the host
tls_cert_pathstring-Path to TLS certificate file for HTTPS
tls_key_pathstring-Path to TLS private key file for HTTPS
tls_ca_pathstring-Path to TLS CA certificate file
wasi_webgpubooleanfalseEnable WASI WebGPU support
wasi_keyvalue_pathstring-Path for WASI key-value store data
wasi_blobstore_pathstring-Path for WASI blob store data
dev.components[]

Additional components to load alongside your main component.

FieldTypeDescription
namestringName identifier for the component
filestringPath to the component Wasm file
dev.volumes[]

Volume mounts for filesystem access from within the Wasm component.

FieldTypeDescription
host_pathstringPath on the host filesystem
guest_pathstringPath as seen from within the Wasm component

dev example

yaml
dev:
  command: cargo build --target wasm32-wasip2 --debug
  address: 127.0.0.1:8080
  service: true
  wasi_webgpu: true
  tls_cert_path: "./certs/cert.pem"
  tls_key_path: "./certs/key.pem"

wit configuration

Configuration for WIT (WebAssembly Interface Type) dependency management.

wit options

OptionTypeDefaultDescription
registriesarraywasm.pkg registryRegistries for WIT package fetching
skip_fetchbooleanfalseSkip fetching WIT dependencies
wit_dirstring./witDirectory where WIT files are stored
sourcesmap{}Source overrides for WIT dependencies (target → source mapping)

wit.registries[]

Registry configuration for fetching WIT packages.

FieldTypeDescription
urlstringRegistry URL endpoint
tokenstringOptional authentication token

wit example

yaml
wit:
  wit_dir: "./wit"
  skip_fetch: false
  registries:
    - url: "https://private-registry.example.com"
      token: "${REGISTRY_TOKEN}"
  sources:
    "wasi:http": "https://github.com/WebAssembly/wasi-http/archive/refs/tags/v0.2.0.tar.gz"