This article follows the official documentation. We haven’t tested this tool for a hands-on review.
If a coding agent can run shell commands in a Fastly project, it can use the Fastly CLI to inspect services and package code for Fastly Compute, Fastly’s platform for running WebAssembly programs at the edge. Fastly documents CLI commands for these tasks, but does not describe the CLI as an integration built specifically for coding agents.
Start with a task that only reads data: ask the CLI for details about a service, then ask the agent to summarize them. The CLI sends a request to Fastly’s API, the software interface Fastly provides for requests, and the agent summarizes the response in the local coding session. This gives the agent context without changing the service.
Install and authenticate
Install the CLI by following the instructions for your platform in Fastly’s CLI documentation. The instructions vary by platform, so use the ones for the machine that runs the agent.
The CLI uses a Fastly API token to authenticate requests. Fastly documents FASTLY_API_TOKEN as an environment variable for supplying the token. Set it in the environment where the agent runs or in a secret manager. Do not paste it into the agent prompt or store it in the repository. The token needs access to the Fastly account and service you want to inspect.
Inspect a service
The fastly service describe command retrieves detailed information about a Fastly service. You can give it a service ID, the service’s identifier, or its name. Add --json to get JSON output, a structured format that an agent can parse more consistently than terminal-formatted text. Fastly documents the command and its options in the service describe reference.
Set SERVICE_ID to the ID of a service your token can access, then run:
SERVICE_ID="your_service_id"
fastly service describe --service-id "$SERVICE_ID" --json
your_service_id is a placeholder; replace it with the target service’s actual ID. The command asks Fastly for service information and prints the response as JSON. It does not deploy code or change the service. Fastly’s response determines which fields appear, so ask the agent to report only fields in the output rather than assume a particular field is present.
A focused prompt for this task could be:
Run
fastly service describefor the service ID inSERVICE_IDand summarize the service details returned. Do not run commands that change the service.
The CLI’s global --non-interactive option is intended for continuous integration (CI) and works like --accept-defaults and --auto-yes. Do not add it automatically to an agent command: Fastly notes that --auto-yes may suppress security warnings. The read-only command above does not need this option. The Compute pack documentation describes these global options.
Package Compute code locally
For another task, an agent can use fastly compute pack to package a pre-compiled WebAssembly binary for Fastly Compute. The project’s language toolchain, the tools that compile its code, produces this binary. The command prepares it in a format Fastly supports and requires --wasm-binary to identify the file:
fastly compute pack --wasm-binary ./path/to/program.wasm
./path/to/program.wasm is a placeholder path. Replace it with the path to the binary produced when the project builds. This command packages a local file; it does not deploy the service. The agent should confirm the project’s actual binary path before using the command.
Keep the boundary clear
You can use Fastly’s CLI to inspect services and package files with shell commands, but the available documentation does not describe a mode built specifically for coding agents. Fastly has separately published fastly/edge-mcp, an implementation of the Model Context Protocol for Compute. Fastly describes related Model Hardware Standard work as an early research prototype. This work does not establish a recommended way to use the CLI with an agent.
When you assign an agent a task, say whether it should only inspect service data on Fastly or also prepare local files. Ask it to deploy or make other service changes only as a separate, explicit task. The CLI supports both kinds of work, but service describe is a straightforward starting point because it reads service information without changing it.