---
title: "wash Configuration — User and Project Settings | wasmCloud"
description: "Configure the wash CLI for wasmCloud — user settings, project config files, and available options in YAML, JSON, or TOML for WebAssembly workflows."
canonical: "https://wasmcloud.com/docs/wash/config/"
---

Version: v2

# 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:

- [**User configuration**](https://wasmcloud.com/docs/wash/config/#user-configuration) that is local to the machine
- [**Project configuration**](https://wasmcloud.com/docs/wash/config/#project-configuration) in the `.wash` directory at the root of each project

## 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

## Managing the config file

`wash` ships three subcommands for managing the project-local config file in `.wash/`. Together they cover the typical lifecycle: scaffold a working file, check it before you run anything against it, and clean up stale state when something goes wrong.

### Creating a new config

Use `wash config init` to create a starter file. The `--example` flag populates every section with illustrative values, which is the fastest way to see what `wash` accepts:

shell

```shell
wash config init --example
```

The `--format` flag selects the serialization format. `yaml` is the default; `yml`, `json`, and `toml` are also supported:

shell

```shell
wash config init --format toml --example
```

`init` always writes to the project-local `.wash/` directory. The legacy `--global` flag is deprecated and has no effect.

### Validating a config

Run `wash config validate` to catch hard errors in the merged project configuration before they show up at runtime:

shell

```shell
wash config validate
```

Validation covers socket-address syntax, `redis://` / `nats://` / `postgres://` URL schemes, paired TLS cert and key files, WebGPU availability on Windows, non-empty build commands, well-formed WIT registry URLs, and local WIT source paths that actually exist on disk. Remote sources (HTTP, Git, OCI) are skipped — `validate` doesn't reach out to the network. Errors are collected across every section before the command returns, so every issue surfaces in one pass.

To validate a specific file instead of the merged project config (useful when working with multiple variants), pass `--file`:

shell

```shell
wash config validate --file ./alternate-config.yaml
```

### Cleaning up cache and data directories

`wash config cleanup` removes the wash cache and/or data directories. Use it to reclaim disk space or to recover from a corrupted cache. Always preview with `--dry-run` first to see what would be removed and how much space it would free:

shell

```shell
# Preview
wash config cleanup --all --dry-run

# Apply
wash config cleanup --all
```

Use `--cache` or `--data` instead of `--all` to target a single directory.

## 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:

| Option | Type | Description |
| --- | --- | --- |
| `version` | string | Configuration schema version |
| `build` | object | Build configuration options |
| `dev` | object | Development server configuration options |
| `wit` | object | WIT dependency management configuration |

### `version` configuration

Specify the `wash` version for this project.

Example:

yaml

```yaml
version: 2.3.0
```

### `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

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `command` | string | - | Build command to execute |
| `env` | map | `{}` | Environment variables to set during the build process |
| `component_path` | string | - | Path to the output Wasm component file |

#### `build` examples

**Rust**

yaml

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

**TinyGo**

yaml

```yaml
build:
  command: go generate ./... && tinygo build -target wasip2 -wit-package ./wit -wit-world example -o build/output.wasm ./
  component_path: build/output.wasm
```

**TypeScript**

yaml

```yaml
build:
  command: npm run install-and-build
  component_path: dist/output.wasm
```

This build command will execute the `install-and-build` script defined in your TypeScript project's `package.json` file. Make sure the value for `component_path` matches the path defined in your build script.

### `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

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `command` | string | - | Custom command to run for building during development |
| `address` | string | - | Address for the development server to listen on |
| `service` | boolean | `false` | Whether to run as a long-running service with port binding |
| `service_file` | string | - | Path to a service definition file |
| `components` | array | `[]` | Additional components to load during development |
| `volumes` | array | `[]` | Volumes to mount from host to guest |
| `host_interfaces` | array | `[]` | WIT interfaces to expose from the host |
| `plugins` | array | `[]` | Host plugin declarations: `id` plus an `image`/`file` source for component plugins, with `config`/`configFrom`/`secretFrom`, `bindings`, and `workloadConfig`, which defaults to `allow` in dev (since 2.9.0; `host_plugins` is a deprecated alias). See [Creating host component plugins](https://wasmcloud.com/docs/runtime/creating-host-component-plugins/#wash-dev). |
| `tls_cert_path` | string | - | Path to TLS certificate file for HTTPS |
| `tls_key_path` | string | - | Path to TLS private key file for HTTPS |
| `tls_ca_path` | string | - | Path to TLS CA certificate file. Since 2.13.0 setting it requires every client of the dev server to present a certificate that CA issued; before 2.13.0 the bundle was read and ignored |
| `tls_reload_interval` | string | - | Re-read `tls_cert_path`, `tls_key_path` and `tls_ca_path` on this interval, minimum `1s` (since 2.13.0). Unset reads them once |
| `secrets` | array | `[]` | Credentials `wash dev` substitutes into the component's outgoing requests, standing in for a host that brokers them (since 2.13.0). See [`dev.secrets[]`](https://wasmcloud.com/docs/wash/config/#devsecrets) |
| `wasi_webgpu` | boolean | `false` | Enable WASI WebGPU support |
| `wasi_keyvalue_redis_url` | string | - | Redis URL for the keyvalue plugin. Takes precedence over the other keyvalue settings |
| `wasi_keyvalue_nats_url` | string | - | NATS URL for the keyvalue plugin. Overrides `data_nats_url` for keyvalue only |
| `wasi_keyvalue_path` | string | - | Path for WASI key-value store data |
| `wasi_blobstore_path` | string | - | Path for WASI blob store data |
| `data_nats_url` | string | - | Unified NATS URL for the blobstore, keyvalue, and messaging plugins (since 2.4.0), mirroring `wash host --data-nats-url`. Per-plugin settings (`wasi_keyvalue_redis_url`, `wasi_keyvalue_nats_url`, `wasi_keyvalue_path`, `wasi_blobstore_path`) take precedence over it; messaging has no per-plugin override. |
| `wasm_proposals` | array | `[]` | Top-level Wasm proposals to enable on the engine (since 2.5.0). Recognized values: `component-model-async`, `gc`, `exception-handling`, `wide-arithmetic`, `threads`, `tail-call`. Validated at startup. |
| `hostcall_fuel` | string | - | Roughly the most bytes a guest may copy to the host in one call, e.g. `256MiB` (since 2.12.0). Mirrors `wash host --hostcall-fuel`; unset leaves wasmtime's 128 MiB. Unrelated to fuel metering. |

##### `dev.components[]`

Additional components to load alongside your main component. Each entry can also override the workload-wide `environment`, `config`, and `allowedHosts` values for that component (since 2.4.0); the override fields mirror the `localResources` shape on a `WorkloadDeployment`.

| Field | Type | Description |
| --- | --- | --- |
| `name` | string | Name identifier for the component |
| `file` | string | Path to the component Wasm file |
| `environment` | object | Environment variables (`wasi:cli/env`) merged over `workload.environment`. This component wins on key conflicts. |
| `config` | map | Opaque key-value config merged over `workload.config`. This component wins on key conflicts. |
| `allowedHosts` | array | Outbound HTTP allowlist. When set, **replaces** `workload.allowedHosts` for this component (`[]` denies all egress); when omitted the workload list applies. |
| `poolSize` | integer | Maximum warm instances the host keeps for this component. Unset, `0`, or negative instantiates fresh on every call. |
| `maxConcurrency` | integer | Calls one warm instance serves at the same time (default `1`; only meaningful alongside `poolSize`). |
| `maxInvocations` | integer | Retires a warm instance after it admits this many calls (default: unlimited reuse). |
| `reclaimWindowSeconds` | integer | Lets an idle instance pool shrink: each window, warm instances beyond what peak load needed are retired (since 2.9.0). Unset means never reclaimed. |
| `reclaimMinInstances` | integer | Floor on reclaim; sweeps never shrink the pool below this count (since 2.9.0). A value at or above `poolSize` disables reclaim entirely, since a sweep could never find a surplus to retire. |

Workload-wide `workload.environment`, `workload.config`, and `workload.allowedHosts` are the base layer for every component in a dev workload, including sidecars from `dev.components[]` and the service from `dev.service_file` (since 2.4.0; earlier releases applied them only to the main component).

`workload.allowedHosts` governs outbound HTTP **and** `wasi:sockets` connections. `wash dev` supplies an allow-all default when the project declares none at all — including when the `workload:` section is absent entirely, which in 2.11.0 resolved to deny-all instead (fixed in 2.12.0). An explicit `allowedHosts: []` stays deny-all, and `wash dev` logs a line when the effective policy admits every host. The allow-all is a `wash dev` default only; `wash host` reading the same file gets deny-all. More than one component in the same workload may export the same interface (for example, two `wasmcloud:messaging` handlers). A sibling importing a multi-exported interface names its provider with an `(implements <component-name>)` label (since 2.10.0); unlabeled imports of it are refused.

##### `dev.volumes[]`

Volume mounts for filesystem access from within the Wasm component.

| Field | Type | Description |
| --- | --- | --- |
| `host_path` | string | Path on the host filesystem |
| `guest_path` | string | Path as seen from within the Wasm component |

##### `dev.secrets[]`

A component that will run against a credential-brokering host does not hold its API tokens: it sends a *placeholder* and the host swaps in the real value on the way out. `dev.secrets` reproduces that locally (since 2.13.0), so the component can be written the way it will be deployed and no real credential is ever inside the sandbox.

Each entry puts a placeholder in one of the component's environment variables and tells `wash dev` where the value lives and where it may be sent:

yaml

```yaml
dev:
  secrets:
    - env: API_TOKEN
      fromFile: .secrets/acme-token
      destinations:
        - https://api.acme.example
      routes:
        - GET /v1
```

The component reads `API_TOKEN` and sends it as a bearer token as usual; what it actually sends is the placeholder, and only a request to `https://api.acme.example` with a `GET` under `/v1` gets the real token written in. Anything else — another host, another method, another path — goes out with the placeholder, which is the point: a leak carries nothing.

| Field | Type | Description |
| --- | --- | --- |
| `env` | string | The component environment variable that receives the placeholder. Required, and unique across entries |
| `fromEnv` | string | A variable in the `wash dev` process's own environment holding the value, read once at session start. Exactly one of `fromEnv` and `fromFile` |
| `fromFile` | string | A file holding the value. A relative path resolves against the project directory and must stay inside it; an absolute path, or one starting `~/`, may point anywhere the `wash dev` process can read. Read at start and re-read every second, so it can rotate in place. Must be a regular file of at most 64 KiB, mode `0600` or `0400` on Unix; trailing whitespace is dropped. A failed refresh revokes the value, and a stalled one expires the last good read after five seconds. A `dev.volumes` entry cannot expose this path |
| `destinations` | array | Exact hosts the secret may be sent to, each with a port defaulting to 443: `https://api.github.com`, `api.github.com`, or `api.example.com:8443`. The `https://` prefix is optional, but any other scheme is refused, as are paths and wildcards. Host **and** port must match, so a dev service on `:8443` needs the port written out. Required |
| `header` | string | The header whose whole value is the placeholder. With neither `header` nor `query`, or with `header: authorization` in any case, the placeholder is a bearer token in `authorization` |
| `query` | string | The query parameter whose whole value is the placeholder. Mutually exclusive with `header` |
| `routes` | array | Routes it may be sent on, as `/path` or `METHOD /path`. Empty allows any route |
| `placeholderPrefix` | string | Prepended to the placeholder, for SDKs that validate a key's shape before sending it |

A route may name only `GET`, `HEAD`, `POST`, `PUT`, `PATCH`, `DELETE` or `OPTIONS`, compared case-sensitively. An extension method such as `PROPFIND` cannot be named in `dev.secrets` at all, and `TRACE`, `CONNECT`, `TRACK` and `DEBUG` are always refused. Requests that carry no placeholder are not subject to any of this.

Two more constraints will stop a session rather than warn: the secret's value must be at least 16 bytes, and `env` must not collide with a variable the workload or a component already sets.

> **`dev.*` keys are snake_case, `dev.secrets[]` fields are camelCase**
>
> The `dev` section takes snake_case keys (`tls_ca_path`, `tls_reload_interval`), while fields inside a `dev.secrets[]` entry are camelCase (`fromFile`, `placeholderPrefix`), with snake_case accepted as an alias. The `dev` section does not reject unknown keys, so a camelCase slip like `dev.tlsCaPath` is silently ignored rather than reported.

> **A dev session has one caller**
>
> Every component and service in the session may send every secret — `wash dev` scopes a secret by destination and route only, not by component. A deployed host scopes by workload as well.

#### `dev` example

yaml

```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

| Option | Type | Default | Description |
| --- | --- | --- | --- |
| `registries` | array | wasm.pkg registry | Registries for WIT package fetching |
| `skip_fetch` | boolean | `false` | Skip fetching WIT dependencies |
| `wit_dir` | string | `./wit` | Directory where WIT files are stored |
| `sources` | map | `{}` | Source overrides for WIT dependencies (target → source mapping). Accepts HTTP, Git, and OCI references; absolute local paths as of wasmCloud 2.8.0. A key may be a bare namespace as of 2.12.0, covering every package of it in use; before that a namespace-only key failed every fetch and build |

#### `wit.registries[]`

Registry configuration for fetching WIT packages.

| Field | Type | Description |
| --- | --- | --- |
| `url` | string | Registry URL endpoint |
| `token` | string | Optional authentication token |

#### `wit` example

yaml

```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"
```

Last updated on **Dec 3, 2026** by **Eric Gregory**
