---
title: fastly compute build
summary: Build a Compute package locally
url: https://www.fastly.com/documentation/reference/cli/compute/build
---

Build a Compute package locally

## Flags

| Flag | Description | Required | Default |
|------|-------------|----------|----------|
| `--dir` | Project directory to build (default: current directory) | 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 | - |
| `--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-name` | Package name | 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 a JavaScript Compute package using Yarn instead of NPM

In the `fastly.toml` manifest define a new `[scripts]` table and within it define a `build` key with your Yarn instructions. For example, `build = "yarn install && yarn build"`.

```bash
fastly compute build
```

