Install: brew install fastly/tap/fastly
Upgrade: brew upgrade fastly
Install:
scoop bucket add fastly-cli https://github.com/fastly/scoop-cli.git
scoop install fastly
Upgrade: scoop update fastly
Install and upgrade:
- Download the
.deb
file from the releases page sudo apt install ./fastly_*_linux_amd64.deb
install the downloaded file
Install and upgrade:
- Download the
.rpm
file from the releases page sudo dnf install fastly_*_linux_amd64.rpm
install the downloaded file
Install and upgrade:
- Download the
.rpm
file from the releases page sudo yum localinstall fastly_*_linux_amd64.rpm
install the downloaded file
Install and upgrade:
- Download the
.rpm
file from the releases page sudo zypper in fastly_*_linux_amd64.rpm
install the downloaded file
Download the latest release from the releases page.
Unarchive the binary and place it in your $PATH. You can verify the integrity
of the binary using the SHA256 checksums file fastly_x.x.x_SHA256SUMS
provided
alongside the release.
Verify it works by running fastly version
.
$ fastly version
Fastly CLI version vX.Y.Z (abc0001)
Built with go version go1.13.1 linux/amd64
The Fastly CLI will notify you if a new version is available, and can update
itself via fastly update
.
The Fastly CLI interacts with the Fastly API via an API token. You'll need to create an API token for yourself, and then provide it to the Fastly CLI in one of three ways:
- Stored in a config file by running
fastly configure
- Explicitly via the
--token, -t
flag - Implicitly via the
FASTLY_API_TOKE B215 N
environment variable
To see an overview of all commands, simply run fastly
with no arguments.
Succinct help about any command or subcommand is available via the -h, --help
flag. Verbose help about any command or subcommand is available via the help
argument, e.g. fastly help service
.
The CLI can generate completions for all commands, subcommands and flags.
By specifying --completion-bash
as the first argument, the CLI will show possible subcommands. By ending your argv with --
, hints for flags will be shown.
To install the completions source them in your bash_profile
(or equivalent):
eval "$(fastly --completion-script-bash)"
Or for ZSH in your zshrc
:
eval "$(fastly --completion-script-zsh)"
The Fastly CLI requires Go 1.13 or above. Clone this repo
to any path and type make
to run all of the tests and generate a development
build locally.
git clone git@github.com:fastly/cli
cd cli
make
./fastly version
The make
task requires the following executables to exist in your $PATH
:
If you have none of them installed, or don't mind them being upgraded automatically, you can run make dependencies
to install them.
To run the test suite:
make test
Note that by default the tests are run using go test
with the following configuration:
-race ./{cmd,pkg}/...
To run a specific test use the -run
flag (exposed by go test
) and also provide the path to the directory where the test files reside (replace ...
and <path>
with appropriate values):
make test TESTARGS="-run <...> <path>"
Example:
make test TESTARGS="-run TestBackendCreate ./pkg/backend/..."
Some integration tests aren't run outside of the CI environment, to enable these tests locally you'll need to set a specific environment variable relevant to the test.
The available environment variables are:
TEST_COMPUTE_INIT
: runsTestInit
.TEST_COMPUTE_BUILD
: runsTestBuildRust
andTestBuildAssemblyScript
.TEST_COMPUTE_BUILD_RUST
: runsTestBuildRust
.TEST_COMPUTE_BUILD_ASSEMBLYSCRIPT
: runsTestBuildAssemblyScript
.
Example:
TEST_COMPUTE_BUILD_RUST=1 make test TESTARGS="-run TestBuildRust/fastly_crate_prerelease ./pkg/compute/..."
When running the tests locally, if you don't have the relevant language ecosystems set-up properly then the tests will fail to run and you'll need to review the code to see what the remediation steps are, as that output doesn't get shown when running the test suite.
Refer to CONTRIBUTING.md
If you encounter any non-security-related bug or unexpected behavior, please file an issue using the bug report template.
Please see our SECURITY.md for guidance on reporting security-related issues.