PluginWorks in Claude CodeCurrent
Fastly agent toolkit
Fastly development tools and platform skills
0
Try it
See what this would do for you. No sign-up needed.
Install in Claude Code
Run these in Claude Code, in order. The first adds the marketplace, the second installs the plugin.
Step 1
/plugin marketplace add anthropics/claude-plugins-official
Step 2
/plugin install fastly-agent-toolkit@claude-plugins-official
Review commands before running them. Promptu never runs code on your machine or pushes changes to your repo.
What's inside
10 skills
- falco
- fastlike
- fastly-cli
- fastly-fiddle
- fastly-ngwaf
- fastly-reference-architectures
- fastly-stats
- fastly
- viceroy
- xvcl
Security scan
Passed
Promptu's text scan of the files it could read didn't match any known risky patterns. It doesn't run the plugin, and a clean scan doesn't mean the plugin is safe.
Automated pattern check of 17 file(s) found nothing risky. Not a full audit.
Details
# Fastly Agent Toolkit
A collection of skills for AI coding agents to work with the Fastly platform and edge computing tools.
- [Fastly Agent Toolkit](#fastly-agent-toolkit)
- [Agent Plugins](#agent-plugins)
- [Available skills](#available-skills)
- [Runtime requirements](#runtime-requirements)
- [Support and privacy](#support-and-privacy)
- [Usage](#usage)
- [Manual copy](#manual-copy)
- [Claude Code](#claude-code)
- [Codex](#codex)
- [Swival](#swival)
- [Qwen Code](#qwen-code)
- [Gemini CLI](#gemini-cli)
- [Using the `skills` CLI](#using-the-skills-cli)
- [Skill format](#skill-format)
- [Contributing new skills](#contributing-new-skills)
## Agent Plugins
This repository is a portable [Agent Plugin](https://agent-plugins.org/specification).
Clients load the root [`plugin.json`](plugin.json) manifest and discover the skills in `skills/`.
## Available skills
- `fastly`: Working with the Fastly platform, including services, caching, VCL, WAF, TLS, DDoS protection, purging, and API usage.
- `fastly-cli`: Using the [Fastly CLI](https://www.fastly.com/documentation/reference/cli/) to manage services, compute apps, logging, WAF, TLS, key-value stores, and stats.
- `fastly-fiddle`: Testing VCL against real Fastly edge infrastructure with [Fastly Fiddle](https://fiddle.fastly.dev/), covering assertion-based tests, the Fiddle HTTP API, shareable bug reproductions, and CI integration.
- `fastly-stats`: Fastly traffic numbers via the CLI or raw HTTP, covering the Historical Stats, Real-Time analytics, and Origin/Domain Inspector APIs, and owning the unit, window, and aggregation conventions that decide whether a reported figure is right.
- `fastly-ngwaf`: Auditing Next-Gen WAF workspaces for missing or disabled protection rules and checking whether attack traffic is being blocked.
- `fastly-reference-architectures`: Curated GitHub repositories demonstrating working reference architectures on Fastly, from single Compute applications to systems combining multiple Fastly products.
- `falco`: VCL development with [Falco](https://github.com/ysugimoto/falco), covering linting, testing, simulation, formatting, REPL, and Terraform integration.
- `fastlike`: Running Fastly Compute locally with [Fastlike](https://github.com/avidal/fastlike), covering backend configuration, builds, and testing.
- `viceroy`: Running Fastly Compute locally with [Viceroy](https://github.com/fastly/Viceroy), covering serving, configuration, testing, and SDK adaptation.
- `xvcl`: The [XVCL](https://dip-proto.github.io/xvcl/) VCL transpiler, covering syntax extensions, subroutines, header manipulation, and caching logic.
Each skill lives under `skills/` with a `SKILL.md` entrypoint and a `references/` directory containing detailed topic files.
**Important:** SKILL.md files reference companion files in their `references/` directory. Make sure your agent is allowed to read from these directories, otherwise it won't be able to follow the references and will miss important context.
## Runtime requirements
These skills are intended for coding environments that can read project files and run commands.
Install the tools for the workflows you use; installing the plugin does not install its developer tools or connect a Fastly account.
<details>
<summary>Workflow-specific requirements</summary>
| Workflow | Requirements |
| ----------------------------------------- | ------------------------------------------------------------------------------------------ |
| Fastly CLI and traffic statistics | Fastly CLI and locally configured authentication; `curl` and `jq` for raw API examples |
| NGWAF assessment script | Bash, `curl`, `jq`, and a locally configured `FASTLY_API_KEY` with access to the workspace |
| VCL linting, unit tests, and simulation | Falco; installation requires Homebrew or Go |
| XVCL compilation | uv with `uvx` and access to the XVCL package; Falco for the local checks |
| Local Compute development | Fastlike or Viceroy, plus the build tools and WASM targets required by the application |
| Fastly Fiddle tests | Bash, `curl` 7.76 or newer, `jq`, and network access to Fastly Fiddle |
| Documentation and reference architectures | A browser or HTTP client; Git when cloning examples or tool sources |
Each skill describes its prerequisites and installation options.
Package installation and source builds may need network access.
Bundled scripts and examples are resolved from the installed skill directory, while your project files stay relative to your project's working directory.
</details>
Set up Fastly authentication yourself using the CLI's interactive login or local configuration.
Do not paste API keys into a conversation, include them in project files, or share command output that reveals them.
Choose credentials with only the permissions needed for the task.
## Support and privacy
For questions about these skills or to report a bug, open an issue in the [GitHub issue tracker](https://github.com/fastly/fastly-agent-toolkit/issues).
Report security issues privately through the process in [SECURITY.md](SECURITY.md).
Read [Privacy and data handling](PRIVACY.md) for details about local credentials, account data, and public Fiddle uploads.
Fastly's [privacy policy](https://www.fastly.com/privacy) and [terms of service](https://www.fastly.com/terms) describe the applicable Fastly policies and service terms.
The skills are available under the [MIT license](LICENSE).
## Usage
Pick the skills relevant to your project. You probably don't need all of them.
### Manual copy
If your agent supports the `.agents/skills/` convention, this is the most portable option. Agents that use this location include Amp, Cline, Codex, Cursor, Gemini CLI, GitHub Copilot, Kimi Code, OpenCode, Replit Agent, Swival, and Warp.
Install into the current project:
```bash
mkdir -p .agents/skills
cp -R ./skills/{falco,viceroy} .agents/skills/
```
Install globally (for agents that support `~/.agents/skills/`):
```bash
mkdir -p ~/.agents/skills
cp -R ./skills/{falco,viceroy} ~/.agents/skills/
```
If your agent doesn't support `.agents/skills/`, expand the agent-specific instructions below.
Agent-specific installation
### [Claude Code](https://code.claude.com/docs/en/overview)
Install the bundled skills as a plugin:
```bash
claude plugin install fastly-agent-toolkit@claude-plugins-official
claude plugin list
```
### [Codex](https://github.com/openai/codex)
Install the bundled skills as a plugin:
```bash
codex plugin marketplace add https://github.com/fastly/fastly-agent-toolkit.git
codex plugin add fastly-agent-toolkit@fastly-agent-toolkit
```
### [Swival](https://swival.dev/)
Stage the collection in your library first, then add the skills you want:
```bash
swival skills add --global https://github.com/fastly/fastly-agent-toolkit # stage into ~/.config/swival/library
swival skills add fastly-agent-toolkit # install the collection into this project
swival skills add --global fastly-agent-toolkit # or activate it in every project
```
Prefer only a couple of skills? Activate them by name instead of the whole collection: `swival skills add falco`, `swival skills add viceroy`.
### [Qwen Code](https://qwenlm.github.io/qwen-code-docs/en/users/overview/)
Qwen Code requires the experimental skills feature. Enable it by adding to `.qwen/settings.json`:
```json
{
"tools": {
"experimental": {
"skills": true
}
}
}
```
Then copy skills to the project directory:
```bash
mkdir -p .qwen/skills
cp -R ./skills/{falco,viceroy} .qwen/skills/
```
### [Gemini CLI](https://geminicli.com/)
Gemini CLI supports `.agents/skills/` as shown above. You can also link the whole repository using Gemini's extension workflow:
```bash
gemini extensions link .
```
Swap `{falco,viceroy}` for whatever combination you need. For VCL work, `falco` and `xvcl` are the most useful. For Fastly Compute, grab `fastly-cli` and either `viceroy` or `fastlike`.
### Using the `skills` CLI
The [`skills`](https://github.com/vercel-labs/skills) CLI installs skills into the standard `.agents/skills/` directory and automatically symlinks them into agent-specific directories. It supports most agents out of the box.
Install into the current project:
```bash
bunx skills add github:fastly/fastly-agent-toolkit --skill falco --skill viceroy
# or with node:
npx skills add github:fastly/fastly-agent-toolkit --skill falco --skill viceroy
```
Install globally (available across all projects via `~/.agents/skills/`):
```bash
bunx skills add -g github:fastly/fastly-agent-toolkit --skill falco --skill viceroy
```
## Skill format
Each skill lives in its own directory as a `SKILL.md` file with YAML frontmatter following the [Agent Skills spec](https://agentskills.io/specification).
The skills are validated with [`skillscheck`](https://github.com/Swival/skillscheck).
## Contributing new skills
See [CONTRIBUTING.md](CONTRIBUTING.md).
## skills/falco/SKILL.md
---
name: falco
description: "Lints, tests, simulates, and formats Fastly VCL code using the falco tool. Also serves as the authoritative VCL reference via the falco Go source, which implements Fastly's full VCL dialect. Use when validating VCL syntax, running VCL linting, testing VCL locally, simulating VCL request handling, formatting VCL files, writing VCL unit tests with assertions, debugging VCL logic errors, looking up VCL function signatures or variable scopes, understanding VCL subroutine behavior, or running `falco lint`/`falco simulate`/`falco test`/`falco fmt`. Also applies when working with VCL syntax errors, type mismatches in VCL, choosing which VCL subroutine to use, or setting up a local VCL development and testing environment."
---
## Trigger and scope
Trigger on: VCL files, .vcl extensions, XVCL files, .xvcl extensions, falco CLI, VCL unit tests, VCL linting/simulation/formatting, VCL REPL, beresp/bereq/req.http variables, subroutine scopes, backend/ACL/director/table declarations, edge dictionaries, validating VCL in Terraform plans, or running/testing XVCL scripts locally.
Do NOT use for: generic non-Fastly VCL, Fastly Compute/WASM, Fastly API/dashboard ops, CDN comparison, cache purging, or authoring Terraform resources.
# Falco — VCL Development Tool & Reference
Falco is a Fastly VCL development tool for linting, testing, simulating, and formatting VCL code. Equally important, **the falco source code is the most complete machine-readable specification of Fastly's VCL dialect** — its parser, interpreter, and type system document every variable, function, type, and scope rule in VCL.
**Official VCL documentation**: https://www.fastly.com/documentation/guides/full-site-delivery/fastly-vcl/about-fastly-vcl/
**Falco documentation**: https://github.com/ysugimoto/falco
## Using Falco Source as VCL Reference
If you need to understand how VCL works — what variables exist, which scopes they're available in, what functions are built-in, how types coerce — the falco source code is your best reference. It's a complete Go implementation of Fastly's VCL 2.x and is more precise than prose documentation.
**If the falco source is not available locally**, recommend cloning it:
```bash
git clone https://github.com/ysugimoto/falco.git ~/src/falco
```
Once available locally, read the source files directly to answer VCL questions. See [understanding-vcl-from-source.md](references/understanding-vcl-from-source.md) for a detailed guide on which files to read for different VCL topics.
## Install
```bash
# Homebrew
brew install falco
# From source (requires Go 1.25+)
go install github.com/ysugimoto/falco/cmd/falco@latest
# Or clone and build
git clone https://github.com/ysugimoto/falco.git
cd falco
make darwin_arm64 # or darwin_amd64, linux_amd64, linux_arm64
```
## Commands
| Command | Description |
| ----------------- | -------------------------------- |
| `falco [lint]` | Lint VCL files (default command) |
| `falco test` | Run VCL unit tests |
| `falco simulate` | Start local simulator server |
| `falco fmt` | Format VCL files |
| `falco stats` | Show VCL code statistics |
| `falco console` | Interactive VCL REPL |
| `falco terraform` | Lint VCL from Terraform plans |
| `falco dap` | Debug Adapter Protocol server |
## Common flags (all commands)
| Flag | Description |
| -------------------- | -------------------------------- |
| `-I, --include_path` | Add include path for VCL imports |
| `-h, --help` | Show help |
| `-V, --version` | Show version |
| `-r, --remote` | Fetch snippets from Fastly API |
| `--refresh` | Refresh remote snippet cache |
## Quick reference
**Lint before deployment:**
```bash
falco -vv -I ./vcl ./vcl/main.vcl
```
**Run tests:**
```bash
falco test -I ./vcl ./vcl/main.vcl
```
**Development with watch mode:**
```bash
falco test -w -I ./vcl ./vcl/main.vcl
```
**Run VCL locally** (this is how you "run" or "test locally" — use `simulate`, not just `lint`):
```bash
falco simulate -I ./vcl ./vcl/main.vcl
# Default port is 3124. Test with: curl http://localhost:3124/path
# Use -p to override: falco simulate -p 8080 ./vcl/main.vcl
```
**Format all VCL:**
```bash
falco fmt -w ./vcl/**/*.vcl
```
**Terraform integration:**
```bash
terraform show -json planned.out | falco terraform -vv
```
## Common VCL Issues
Falco catches these, but understanding them prevents wasted lint-fix cycles:
- **Type mismatch**: `set req.http.X-API = true` — HTTP headers are STRING, not BOOL. Use `"true"`.
- **Missing time suffix**: `set beresp.ttl = 86400` — RTIME values need `s` suffix: `86400s`.
- **Wrong scope**: `beresp.*` only exists in `vcl_fetch`. In `vcl_deliver`, use `resp.*`.
- **Deprecated**: `req.request` → use `req.method`. Falco accepts both, but always change to `req.method` when fixing VCL.
- **Synthetic strings**: `synthetic "text"` needs long-string syntax: `synthetic {"text"}`.
- **Backend naming**: Use `F_` prefix: `backend F_origin { ... }`, not `backend origin`.
- **No modulo operator**: VCL has no `%`. Use `substr()` on a hash or `randomint()` for splitting.
- **`req.url.path` is read-only in tests**: Use `set req.url = "/path"` in test subroutines, not `set req.url.path`.
- **Vary placement**: Vary must be set in `vcl_fetch`, not just `vcl_deliver`. Setting Vary after the object enters the cache is too late — the cache key won't include the Vary dimensions.
## Configuration
Create `.falco.yaml` in project root for persistent settings:
```yaml
include_paths:
- ./vcl
- ./includes
linter:
verbose: "warning"
rules:
rule-name: ERROR # or WARNING, INFO, IGNORE
testing:
timeout: 10 # minutes (default: 10)
filter: "*.test.vcl"
simulator:
port: 3124
format:
indent_width: 2
line_width: 120
```
## Environment variables
| Variable | Description |
| ------------------- | ------------------------- |
| `FASTLY_SERVICE_ID` | Service ID for Fastly API |
| `FASTLY_API_KEY` | API key for Fastly API |
Required when using `-r, --remote` flag.
Configure API credentials locally, outside chat.
Never ask for an API key in a conversation or print its value.
## References
| Topic | File | Use when... |
| ------------------------ | ------------------------------------------------------------------------------- | ------------------------------------------------------------- |
| **VCL from Source** | [understanding-vcl-from-source.md](references/understanding-vcl-from-source.md) | Understanding VCL semantics by reading falco's implementation |
| Testing VCL | [testing-vcl.md](references/testing-vcl.md) | Running test suites, coverage, watch mode for TDD |
| Formatting VCL | [formatting-vcl.md](references/formatting-vcl.md) | Formatting VCL for consistent style |
| Linting VCL | [linting-vcl.md](references/linting-vcl.md) | Checking VCL for errors before deployment |
| Simulating VCL | [simulating-vcl.md](references/simulating-vcl.md) | Testing VCL against HTTP requests locally |
| Terraform VCL | [terraform-vcl.md](references/terraform-vcl.md) | Validating VCL from Terraform plans |
| VCL Console | [vcl-console.md](references/vcl-console.md) | Experimenting with VCL expressions interactively |
| VCL Statistics | [vcl-statistics.md](references/vcl-statistics.md) | Analyzing VCL project size and complexity |
## Source Code as VCL Reference (Quick Lookup)
When you have access to the falco source code locally (default: `~/src/falco`), use these paths to answer specific VCL questions:
| Question | Read This File | Why |
| --------------------------------------------- | ------------------------------------------------- | ------------------------------------------------------------ |
| "What variables can I use in `vcl_recv`?" | `interpreter/variable/` | Every `req.*`, `beresp.*`, `client.*` variable with scopes |
| "What built-in functions exist?" | `interpreter/function/` | All 390+ functions with type signatures and scope rules |
| "What are the VCL types?" | `interpreter/value/` | STRING, INTEGER, FLOAT, BOOL, TIME, RTIME, IP, BACKEND |
| "What's the request lifecycle?" | `interpreter/context/` | The 9 scopes: recv, hash, hit, miss, pass, fetch, error, deliver, log |
| "Is this valid VCL syntax?" | `token/token.go`, `lexer/lexer.go` | Every keyword, operator, literal type |
| "How does this VCL statement work?" | `interpreter/statement.go` | How set, unset, return, restart, etc. execute |
| "What are common VCL mistakes?" | `linter/`, `docs/rules.md` | 50+ linting rules with explanations |
| "How do directors work?" | `interpreter/director.go` | Random, fallback, hash, client, chash director types |
For a comprehensive guide, see [understanding-vcl-from-source.md](references/understanding-vcl-from-source.md).
## skills/fastlike/SKILL.md
---
name: fastlike
description: "Runs Fastly Compute WASM binaries locally and serves as the authoritative reference for Compute platform internals. The fastlike source code is highly readable and covers the host ABI, caching and purging APIs, KV/config/secret store interfaces, rate limiting with counters and penalty boxes, ACL lookups, the full request lifecycle, backend fetch semantics, and a built-in per-request profiler with hostcall spans, backend waterfalls, native CPU samples, and optional deep metrics (body bytes, cache outcomes, header summaries, wasm heap curve). Use when working with Compute runtime internals or host calls, understanding how edge data stores behave at runtime, profiling local Compute apps, or testing WASM binaries locally. Prefer this skill over Viceroy for any non-Rust Compute work — its source code is easier to understand as a Fastly Compute API reference."
---
## Trigger and scope
Trigger on: Fastly Compute, Compute@Edge, WASM on Fastly, fastlike, XQD ABI, Compute request lifecycle, 508 loop detection, backend subrequests, body streaming, profiling a local Compute app, embedding a Fastly Compute runtime in Go code, or any question about how Compute platform primitives work internally (caching, KV stores, edge rate limiting, ACLs, geolocation, secret stores, config stores, dictionaries, logging, dynamic backends, request collapsing, async I/O).
Do NOT use for: Fastly VCL (use falco), Fastly CLI/API (use fastly-cli or fastly), Viceroy, CDN comparison, WAF, Terraform, cache purging via API, or Fastly logging/stats configuration.
# Fastlike — Local Compute Runtime & Reference
Fastlike is a Go implementation of the Fastly Compute ABI. It runs compiled WebAssembly programs locally, implementing the same 249+ host functions that Fastly's production Compute platform provides: backends, dictionaries, KV stores, caching, geolocation, rate limiting, ACLs, secret stores, and more.
Equally important, **the fastlike source code is the most complete programmatic specification of how Fastly Compute works** — its ABI implementations document every platform primitive, request lifecycle detail, and data structure as executable code.
**Fastlike documentation**: https://github.com/avidal/fastlike
## Source Code as Compute Reference
When you have access to the fastlike source code locally (default: `~/src/fastlike`), use these paths to answer specific Compute questions:
| Question | Read This File | Why |
| ----------------------------------------------------------- | ---------------------------------------------------- | --------------------------------------------------------------- |
| "How does the request lifecycle work?" | `instance.go`, `xqd_http_downstream.go` | Per-request setup, execution, downstream handling |
| "What ABI functions exist for X?" | `xqd_*.go` files | Each file implements a group of related ABI functions |
| "How do backend subrequests work?" | `xqd_backend.go`, `backend.go` | Request sending, dynamic backends, timeouts |
| "How does caching work?" | `xqd_cache.go`, `xqd_http_cache.go`, `cache.go` | Cache operations, Vary, surrogate keys, request collapsing |
| "How does KV store work?" | `xqd_kv_store.go`, `kv_store.go` | CRUD operations, pagination, generation-based concurrency |
| "How does rate limiting work?" | `xqd_erl.go`, `erl.go` | Rate counters, penalty boxes, threshold checks |
| "How do ACLs work?" | `xqd_acl.go`, `acl.go` | CIDR-based IP filtering, most-specific match |
| "What configuration options exist?" | `options.go` | Every `With*` functional option for the runtime |
| "What error codes can operations return?" | `constants.go` | All XQD status codes and error types |
| "How does the profiler work / what does a trace look like?" | `profile.go`, `profile_json.go`, `docs/profiling.md` | Trace data model, JSON wire format, deep-mode metrics, encoders |
For a comprehensive guide, see [understanding-compute-from-source.md](references/understanding-compute-from-source.md).
## Install from Source
Requires Go 1.24+.
```bash
# Clone and build
git clone https://github.com/avidal/fastlike.git ~/src/fastlike
cd ~/src/fastlike
make build # Creates bin/fastlike
# Or install to GOPATH/bin
make install
# Or install directly
go install fastlike.dev/cmd/fastlike@latest
```
## Quick Start
The `bin/fastlike` examples use a source build.
Use its absolute path from your project directory, or `fastlike` for an installed binary.
```bash
# Minimal: WASM + single backend. The wasm path is positional.
bin/fastlike -backend localhost:8000 app.wasm
```
Flags can appear on either side of the wasm path.
On macOS, avoid binding to port 5000 — the AirTunes/AirPlay Receiver listens there by default and will steal the connection. Pick another port (e.g. `-bind localhost:8000`) or disable the AirPlay Receiver in System Settings.
## Fastlike vs Viceroy
| Feature | Fastlike | Viceroy |
| -------------- | ---------------------------- | ----------------------------------------- |
| Language | Go | Rust |
| Geolocation | Custom JSON file (`-geo`) | Built-in defaults |
| Hot reload | SIGHUP (`-reload`) | Restart required |
| Install | `go install` or `make build` | `cargo install` or `fastly compute serve` |
| Local backends | `-backend name=host:port` | `[local_server.backends]` in fastly.toml |
**When to use Fastlike**: Non-Rust Compute apps, want custom geo data, need hot reload, debugging.
**When to use Viceroy**: Rust Compute apps with cargo-nextest, Component Model projects, using `fastly compute serve`.
## Common Configurations
**With named backends:**
```bash
bin/fastlike \
-backend api=api.example.com:8080 \
-backend cache=redis:6379 \
-backend localhost:8000 \
app.wasm
```
**Development mode with hot-reload:**
```bash
bin/fastlike -backend localhost:8000 -reload -v 2 app.wasm
```
Send `SIGHUP` to reload the WASM without restarting.
**With the built-in profiler:**
```bash
bin/fastlike -backend localhost:8000 -profile-ui localhost:6060 app.wasm
```
Open `http://localhost:6060/` for the trace index. Each request lands as `/r/{id}` (HTML) or `/r/{id}.json` (canonical native JSON; also `.chrome.json`, `.firefox.json`, `.pprof`). Add `-profile deep` for body byte / cache outcome / header / wasm heap metrics. Non-loopback `-profile-ui` requires `-profile-auth TOKEN` (or explicit `-profile-insecure-ui`). See [profiling.md](references/profiling.md).
**Full configuration:**
```bash
bin/fastlike \
-bind 0.0.0.0:5000 \
-backend localhost:8000 \
-dictionary config=./config.json \
-kv store=./data.json \
-config-store settings=./settings.json \
-secret-store secrets=./secrets.json \
-acl blocklist=./acl.json \
-logger output=./logs.txt \
-geo ./geodata.json \
-compliance-region us-eu \
-v 2 \
-reload \
app.wasm
```
## Required Arguments
| Argument | Description |
| ------------------------------ | ---------------------------------------------------------- |
| `<wasm-file>` | Positional path to the WebAssembly program (required) |
| `-backend VALUE` or `-b VALUE` | Backend server (required, repeatable) |
## Optional Flags
| Flag | Default | Description |
| ------------------------------- | ---------------- | --------------------------------------------------------------------------------------------------------------------------- |
| `-bind ADDR` | `localhost:8000` | Server bind address |
| `-reload` | false | Enable SIGHUP hot-reload |
| `-v INT` | 0 | Verbosity (0-2) |
| `-dictionary NAME=FILE` or `-d` | - | Load dictionary from JSON |
| `-kv NAME[=FILE]` | - | KV store (empty or from JSON) |
| `-config-store NAME=FILE` | - | Config store from JSON |
| `-secret-store NAME=FILE` | - | Secret store from JSON |
| `-acl NAME=FILE` | - | ACL from JSON |
| `-logger NAME[=FILE]` | - | Log endpoint (file or stdout) |
| `-geo FILE` | - | Geolocation JSON file |
| `-compliance-region REGION` | - | Compliance region (none, us-eu, us) |
| `-profile MODE` | `trace` | `off`, `trace`, `native`, `combined`, `deep`. See [profiling.md](references/profiling.md). |
| `-profile-ui ADDR` | - | Bind the profile UI listener on ADDR (separate socket from `-bind`). |
| `-profile-auth TOKEN` | - | Bearer token required on UI requests. Mandatory for non-loopback `-profile-ui` unless `-profile-insecure-ui` is set. |
| `-profile-insecure-ui` | false | Permit a non-loopback `-profile-ui` without `-profile-auth` (use only behind external auth). |
| `-profile-retain N` | 256 | LRU size for completed traces. |
| `-profile-backend-cap N` | 512 | Per-request cap on recorded backend calls. |
| `-profile-async-grace DUR` | 100ms | How long finalize waits for in-flight async backends. Pass `0` to disable. |
| `-profile-dir PATH` | cwd | Directory for `wasm-symbols-{pid}.json` and per-process profile artifacts. |
## References
| Topic | File | Use when... |
| ----------------------- | --------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------- |
| **Compute from Source** | [understanding-compute-from-source.md](references/understanding-compute-from-source.md) | Understanding Compute internals by reading fastlike's implementation |
| **Profiling** | [profiling.md](references/profiling.md) | Per-request hostcall + backend traces, deep metrics, native JSON schema, pprof export |
| Backends | [backends.md](references/backends.md) | Setting up named backends, catch-all backends, microservices routing |
| Config | [config.md](references/config.md) | Creating JSON config files for dictionaries, KV stores, secrets, ACLs, geolocation |
| Build | [build.md](references/build.md) | Building Fastlike from source, running linters, make targets |
| Test | [test.md](references/test.md) | Running Go tests, Fastly Compute ABI spec tests |
| ABI | [abi.md](references/abi.md) | Fastly Compute ABI internals, implementing new ABI functions, handle system |
## skills/fastly-cli/SKILL.md
---
name: fastly-cli
description: "Executes Fastly CLI commands for managing CDN services, Compute deploys, and edge infrastructure. Use when running `fastly` CLI commands, creating or managing Fastly services from the terminal, deploying Fastly Compute applications, managing backends/domains/VCL snippets via command line, purging cache, configuring log streaming, setting up TLS certificates, managing KV/config/secret stores, checking service stats, authenticating with Fastly SSO, or working with fastly.toml. Also applies when working with Fastly service IDs in CLI context, or with `fastly service`, `fastly compute`, `fastly auth`, or any Fastly CLI subcommand. Covers service CRUD, version management, autocloning, and troubleshooting common CLI errors."
---
## Trigger and scope
CRITICAL: many subcommands have unintuitive paths (e.g. `fastly domain create` fails with 403, correct is `fastly service domain create`; logging is under `fastly service logging`; alerts under `fastly service alert`; rate limits under `fastly service rate-limit`).
Covers: services, backends, domains, VCL snippets, cache purging, Compute/WASM deploys, log streaming (S3/Datadog/Splunk/Kafka/25+ providers), NGWAF/WAF, TLS/mTLS, KV/config/secret stores, stats, alerts, rate limiting, ACLs, and auth tokens.
# Fastly CLI Overview
## Prerequisites
Requires the `fastly` CLI; API operations also need network access to Fastly.
For installation, see <https://www.fastly.com/documentation/reference/cli/>.
JSON examples also need `jq`; origin checks use `curl` and `openssl`.
Compute builds need the project's language toolchain and dependencies.
Use credentials already configured in the user's local CLI or environment.
If authentication is missing, have the user complete `fastly auth login --sso` locally or configure `FASTLY_API_TOKEN` outside chat.
Never ask for an API key in chat, print a token, or enable shell tracing on authenticated commands.
## References
| Topic | File | Use when... |
| -------------- | ----------------------------------------------- | ---------------------------------------------------------------------------------------- |
| Authentication | [auth.md](references/auth.md) | Login, stored tokens, service auth, CI/CD auth setup |
| Compute | [compute.md](references/compute.md) | Building/deploying edge applications, local dev server |
| Services | [services.md](references/services.md) | Service CRUD, backends, domains, ACLs, dictionaries, VCL, purging, rate limiting |
| Logging | [logging.md](references/logging.md) | Log streaming to S3, GCS, Datadog, Splunk, Kafka, 25+ providers |
| NGWAF | [ngwaf.md](references/ngwaf.md) | Next-Gen WAF workspaces, IP/country lists, rules, signals, thresholds, alerts |
| Notifications | [notifications.md](references/notifications.md) | Slack/PagerDuty/webhook integrations, audit log event mappings |
| Stats | [stats.md](references/stats.md) | Which `fastly stats` subcommand takes which flag, and where the two flag sets diverge |
| Stores | [stores.md](references/stores.md) | KV Stores, Config Stores, Secret Stores, resource links |
| TLS | [tls.md](references/tls.md) | Platform TLS, Let's Encrypt subscriptions, custom certs, mutual TLS |
For endpoint choice, unit and window conventions and worked queries, use the **fastly-stats** skill.
## Command Structure
```
fastly <command> <subcommand> [flags]
```
### Top-Level Commands
| Category | Commands |
| ------------ | --------------------------------------------------------------------------------------- |
| **Compute** | `compute` - Build and deploy edge applications |
| **Services** | `service` - Manage CDN services, logging, backends, VCL, ACLs, purging |
| **Security** | `ngwaf` - Web application firewall |
| **TLS** | `tls-subscription`, `tls-custom`, `tls-platform`, `tls-config` - Certificate management |
| **Storage** | `kv-store`, `config-store`, `secret-store` - Edge data stores |
| **Auth** | `auth` - Login, stored tokens, active token output, revocation; `auth-token` (deprecated) |
| **Info** | `stats`, `ip-list`, `pops`, `whoami` - Information queries |
| **Notify** | `integration` - Notification destinations; `audit-log event-mapping` - Event triggers |
| **Other** | `dashboard`, `domain`, `dns`, `apisecurity`, `products`, `object-storage`, `tools` |
## Global Flags
Available on most commands:
```bash
# Service targeting
--service-id SERVICE_ID # Target service by ID
--service-name NAME # Target service by name
-s SERVICE_ID # Short form
# Version targeting (version-scoped commands like `fastly service domain/backend/...`)
# NOTE: `fastly domain create` does NOT accept --version (it uses a different API)
--version VERSION # Specific version number
--version active # Currently active version
--version latest # Most recent version
--version staged # Currently staged version
# Authentication
--token TOKEN # API token or stored token name (use 'default' for default)
# Output (--json is per-command, not global)
--verbose # Detailed output
--quiet # Minimal output
# Automation
--accept-defaults # Accept default values
--auto-yes # Skip confirmations
--non-interactive # No prompts
```
## Key Patterns
- Target by ID (`-s SERVICE_ID`) or name (`--service-name NAME`)
- Version targeting: `--version active`, `--version latest`, `--version staged`, or `--version N`
- Use `--autoclone` to auto-clone locked versions
- Use `--json` for scripted output, `--non-interactive --accept-defaults` for CI/CD
- JSON field names vary by command; inspect output before writing `jq` selectors.
- `ActiveVersion` shape varies; prefer `--version active`, or

