---
title: fastly compute publish
summary: Build and deploy a Compute package to a Fastly service
url: https://www.fastly.com/documentation/reference/cli/compute/publish
---

Build and deploy a Compute package to a Fastly service

## Flags

| Flag | Description | Required | Default |
|------|-------------|----------|----------|
| `--comment` | Human-readable comment | No | - |
| `--dir` | Project directory to build (default: current directory) | No | - |
| `--domain` | The name of the domain associated to the package | No | - |
| `--env` | The manifest environment config to use (e.g. 'stage' will attempt to read 'fastly.stage.toml') | No | - |
| `--include-source` | Include source code in built package | No | - |
| `--no-default-domain` | Skip default domain creation | No | - |
| `--language` | Language type | No | - |
| `--metadata-disable` | Disable Wasm binary metadata annotations | No | - |
| `--metadata-filter-envvars` | Redact specified environment variables from [scripts.env_vars] using comma-separated list | No | - |
| `--metadata-show` | Inspect the Wasm binary metadata | No | - |
| `--package` | Path to a package tar.gz | No | - |
| `--package-name` | Package name | No | - |
| `--service-id` | Service ID (falls back to FASTLY_SERVICE_ID, then fastly.toml) | No | - |
| `--service-name` | The name of the service | No | - |
| `--status-check-code` | Set the expected status response for the service availability check to the root path | No | - |
| `--status-check-off` | Disable the service availability check | No | - |
| `--status-check-path` | Specify the URL path for the service availability check | No | / |
| `--status-check-timeout` | Set a timeout (in seconds) for the service availability check | No | 120 |
| `--version` | 'latest', 'active', 'staged', or the number of a specific Fastly service version | No | - |
| `--timeout` | Timeout, in seconds, for the build compilation step | No | - |

## Global options

| Flag | Description | Required | Default |
|------|-------------|----------|----------|
| `--help` | Show context-sensitive help. | No | - |
| `--accept-defaults` | Accept default options for all interactive prompts apart from Yes/No confirmations | No | - |
| `--auto-yes` | Answer yes automatically to all Yes/No confirmations. This may suppress security warnings | No | - |
| `--debug-mode` | Print API request and response details (NOTE: can disrupt the normal CLI flow output formatting) | No | - |
| `--non-interactive` | Do not prompt for user input - suitable for CI processes. Equivalent to --accept-defaults and --auto-yes | No | - |
| `--quiet` | Silence all output except direct command output. This won't prevent interactive prompts (see: --accept-defaults, --auto-yes, --non-interactive) | No | - |
| `--token` | Fastly API token, or name of a stored auth token (use 'default' for the default token). Falls back to FASTLY_API_TOKEN env var | No | - |
| `--verbose` | Verbose logging | No | - |

## Examples

### Build and deploy a Compute package to a Fastly service

The <kbd>fastly compute publish</kbd> command is a convenience wrapper around the existing build and deploy commands. All flags present on the <kbd>fastly compute build</kbd> and <kbd>fastly compute deploy</kbd> commands are available to use here.

```bash
fastly compute publish --accept-defaults
```

