$npx -y skills add fastly/fastly-agent-toolkit --skill viceroyRuns Fastly Compute WASM applications locally with Viceroy, specifically for Rust and Component Model projects. Use when starting a local Fastly Compute dev server with Viceroy, configuring fastly.toml for local backend overrides and store definitions, running Rust unit tests wit
| 1 | # Viceroy — Local Fastly Compute Runtime |
| 2 | |
| 3 | Viceroy is Fastly's official local testing environment for Compute applications. It emulates the Fastly Compute platform, allowing you to develop and test WASM services locally. |
| 4 | |
| 5 | **Viceroy documentation**: https://github.com/fastly/Viceroy |
| 6 | |
| 7 | ## Common Gotchas |
| 8 | |
| 9 | - **Dictionaries and ConfigStores are both supported** but configured differently in `fastly.toml`. Dictionaries go under `[local_server.dictionaries]` as inline key-value maps or JSON files. ConfigStores go under `[local_server.config_stores]`. |
| 10 | - **`fastly.toml` must have a `[local_server]` section.** Without it, Viceroy won't know about your backends, stores, or other local overrides. Every backend your app calls must be listed under `[local_server.backends]`. |
| 11 | - **Default port is 7676**, not 5000 (which is Fastlike's default). Access your app at `http://127.0.0.1:7676`. |
| 12 | - **Backends should point to local servers** when developing locally. Avoid proxying to remote production origins to prevent accidentally leaking request data. |
| 13 | |
| 14 | ## Quick Start |
| 15 | |
| 16 | ```bash |
| 17 | # Install Viceroy |
| 18 | cargo install --locked viceroy |
| 19 | |
| 20 | # Build your Compute app |
| 21 | fastly compute build |
| 22 | |
| 23 | # Start local server (default: 127.0.0.1:7676) |
| 24 | viceroy -C fastly.toml bin/main.wasm |
| 25 | |
| 26 | # Or use the Fastly CLI wrapper |
| 27 | fastly compute serve |
| 28 | ``` |
| 29 | |
| 30 | ## References |
| 31 | |
| 32 | | Topic | File | Use when... | |
| 33 | | ------ | --------------------------------------------------------------- | ------------------------------------------------------------------------------ | |
| 34 | | Serve | [fastly-compute-serve.md](references/fastly-compute-serve.md) | Starting local dev server, profiling, advanced server options | |
| 35 | | Config | [fastly-compute-config.md](references/fastly-compute-config.md) | Configuring fastly.toml backends, stores, geolocation, device detection, ACLs | |
| 36 | | Test | [fastly-compute-test.md](references/fastly-compute-test.md) | Running Rust unit tests with cargo-nextest, writing tests for Compute services | |
| 37 | | Adapt | [fastly-compute-adapt.md](references/fastly-compute-adapt.md) | Converting core WASM modules to Component Model, custom build pipelines | |