fastly compute init
Initialize a new Compute package locally.
Syntax
$ fastly compute init
Options
Key | Required? | Default | Description |
---|---|---|---|
--author | No | Author(s) of the package | |
--directory | No | Destination to write the new package, defaulting to the current directory | |
--from | No | Local project directory, or Git repository URL, or URL referencing a .zip/.tar.gz file, containing a package template, or an existing service ID created from a starter kit | |
--language | No | Language of the package |
Global options
Key | Required? | Default | Description |
---|---|---|---|
--help | No | Show context-sensitive help. | |
--accept-defaults | No | Accept default options for all interactive prompts apart from Yes/No confirmations | |
--auto-yes | No | Answer yes automatically to all Yes/No confirmations. This may suppress security warnings | |
--debug-mode | No | Print API request and response details (NOTE: can disrupt the normal CLI flow output formatting) | |
--enable-sso | No | Enable Single-Sign On (SSO) for current profile execution (see also: 'fastly sso') | |
--non-interactive | No | Do not prompt for user input - suitable for CI processes. Equivalent to --accept-defaults and --auto-yes | |
--profile | No | Switch account profile for single command execution (see also: 'fastly profile switch') | |
--quiet | No | Silence all output except direct command output. This won't prevent interactive prompts (see: --accept-defaults, --auto-yes, --non-interactive) | |
--token | No | Fastly API token (or via FASTLY_API_TOKEN) | |
--verbose | No | Verbose logging |
Examples
Initialize a new Compute package locally
To initialize a new Compute package you must select a supported language. The language can be provided using the optional --language
flag, which supports tab completion hints, or the flag can be omitted and you'll be prompted interactively. The --name
flag can also be omitted, which will result in the CLI prompting you interactively.
$ fastly compute init --name example --language rust
Initialize a new Compute package locally using a remote package template
Any Compute examples can be used as a source template for your new package.
$ fastly compute init --from=https://fiddle.fastly.dev/fiddle/0220c0d2
Initialize a new Compute package locally in a different directory
We recommend that you change to the new project directory after running this command, before executing further CLI commands.
$ fastly compute init --directory ./example