cli

module
v0.15.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 29, 2020 License: Apache-2.0

README

Fastly CLI logo

Fastly CLI

A CLI for interacting with the Fastly platform.

Latest release Apache 2.0 License Go Report Card

Installation

macOS

Homebrew

Install: brew install fastly/tap/fastly

Upgrade: brew upgrade fastly

Windows

scoop

Install:

scoop bucket add fastly-cli https://github.com/fastly/scoop-cli.git
scoop install fastly

Upgrade: scoop update fastly

Linux

Debian/Ubuntu Linux

Install and upgrade:

  1. Download the .deb file from the releases page
  2. sudo apt install ./fastly_*_linux_amd64.deb install the downloaded file
Fedora Linux

Install and upgrade:

  1. Download the .rpm file from the releases page
  2. sudo dnf install fastly_*_linux_amd64.rpm install the downloaded file
Centos Linux

Install and upgrade:

  1. Download the .rpm file from the releases page
  2. sudo yum localinstall fastly_*_linux_amd64.rpm install the downloaded file
openSUSE/SUSE Linux

Install and upgrade:

  1. Download the .rpm file from the releases page
  2. sudo zypper in fastly_*_linux_amd64.rpm install the downloaded file

From a prebuilt binary

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.

Usage

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:

  1. Stored in a config file by running fastly configure
  2. Explicitly via the --token, -t flag
  3. Implicitly via the FASTLY_API_TOKEN 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.

Bash/ZSH shell completion

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.

Configuring your shell

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)"

Development

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.

Contributing

We're happy to receive feature requests and PRs. If your change is nontrivial, please open an issue to discuss the idea and implementation strategy before submitting a PR.

Issues

If you encounter any non-security-related bug or unexpected behavior, please file an issue using the bug report template.

Security issues

Please see our SECURITY.md for guidance on reporting security-related issues.

License

Apache 2.0.

Directories

Path Synopsis
cmd
pkg
api
Package api provides abstractions for talking to the Fastly API.
Package api provides abstractions for talking to the Fastly API.
app
Package app provides helpers for creating and running the CLI application.
Package app provides helpers for creating and running the CLI application.
backend
Package backend contains commands to inspect and manipulate Fastly service backends.
Package backend contains commands to inspect and manipulate Fastly service backends.
common
Package common contains general-purpose types and helpers.
Package common contains general-purpose types and helpers.
compute
Package compute contains commands to manage Compute@Edge packages.
Package compute contains commands to manage Compute@Edge packages.
config
Package config manages global configuration parameters.
Package config manages global configuration parameters.
configure
Package configure contains commands to inspect and manipulate the CLI global confuguration.
Package configure contains commands to inspect and manipulate the CLI global confuguration.
domain
Package domain contains commands to inspect and manipulate Fastly service domains.
Package domain contains commands to inspect and manipulate Fastly service domains.
healthcheck
Package healthcheck contains commands to inspect and manipulate Fastly service healthchecks.
Package healthcheck contains commands to inspect and manipulate Fastly service healthchecks.
logging
Package logging contains commands to inspect and manipulate Fastly service logging endpoints.
Package logging contains commands to inspect and manipulate Fastly service logging endpoints.
logging/azureblob
Package azureblob contains commands to inspect and manipulate Fastly service Azure Blob Storage logging endpoints.
Package azureblob contains commands to inspect and manipulate Fastly service Azure Blob Storage logging endpoints.
logging/bigquery
Package bigquery contains commands to inspect and manipulate Fastly service BigQuery logging endpoints.
Package bigquery contains commands to inspect and manipulate Fastly service BigQuery logging endpoints.
logging/cloudfiles
Package cloudfiles contains commands to inspect and manipulate Fastly service Cloudfiles logging endpoints.
Package cloudfiles contains commands to inspect and manipulate Fastly service Cloudfiles logging endpoints.
logging/datadog
Package datadog contains commands to inspect and manipulate Fastly service Datadog logging endpoints.
Package datadog contains commands to inspect and manipulate Fastly service Datadog logging endpoints.
logging/digitalocean
Package digitalocean contains commands to inspect and manipulate Fastly service DigitalOcean logging endpoints.
Package digitalocean contains commands to inspect and manipulate Fastly service DigitalOcean logging endpoints.
logging/elasticsearch
Package elasticsearch contains commands to inspect and manipulate Fastly service Elasticsearch logging endpoints.
Package elasticsearch contains commands to inspect and manipulate Fastly service Elasticsearch logging endpoints.
logging/ftp
Package ftp contains commands to inspect and manipulate Fastly service FTP logging endpoints.
Package ftp contains commands to inspect and manipulate Fastly service FTP logging endpoints.
logging/gcs
Package gcs contains commands to inspect and manipulate Fastly service GCS logging endpoints.
Package gcs contains commands to inspect and manipulate Fastly service GCS logging endpoints.
logging/googlepubsub
Package googlepubsub contains commands to inspect and manipulate Fastly service Google Cloud Pub/Sub logging endpoints.
Package googlepubsub contains commands to inspect and manipulate Fastly service Google Cloud Pub/Sub logging endpoints.
logging/heroku
Package heroku contains commands to inspect and manipulate Fastly service Heroku logging endpoints.
Package heroku contains commands to inspect and manipulate Fastly service Heroku logging endpoints.
logging/honeycomb
Package honeycomb contains commands to inspect and manipulate Fastly service Honeycomb logging endpoints.
Package honeycomb contains commands to inspect and manipulate Fastly service Honeycomb logging endpoints.
logging/https
Package https contains commands to inspect and manipulate Fastly service HTTPS logging endpoints.
Package https contains commands to inspect and manipulate Fastly service HTTPS logging endpoints.
logging/kafka
Package kafka contains commands to inspect and manipulate Fastly service Kafka logging endpoints.
Package kafka contains commands to inspect and manipulate Fastly service Kafka logging endpoints.
logging/logentries
Package logentries contains commands to inspect and manipulate Fastly service Logentries logging endpoints.
Package logentries contains commands to inspect and manipulate Fastly service Logentries logging endpoints.
logging/loggly
Package loggly contains commands to inspect and manipulate Fastly service Loggly logging endpoints.
Package loggly contains commands to inspect and manipulate Fastly service Loggly logging endpoints.
logging/logshuttle
Package logshuttle contains commands to inspect and manipulate Fastly service Logshuttle logging endpoints.
Package logshuttle contains commands to inspect and manipulate Fastly service Logshuttle logging endpoints.
logging/openstack
Package openstack contains commands to inspect and manipulate Fastly service OpenStack logging endpoints.
Package openstack contains commands to inspect and manipulate Fastly service OpenStack logging endpoints.
logging/papertrail
Package papertrail contains commands to inspect and manipulate Fastly service Papertrail logging endpoints.
Package papertrail contains commands to inspect and manipulate Fastly service Papertrail logging endpoints.
logging/s3
Package s3 contains commands to inspect and manipulate Fastly service S3 logging endpoints.
Package s3 contains commands to inspect and manipulate Fastly service S3 logging endpoints.
logging/scalyr
Package scalyr contains commands to inspect and manipulate Fastly service Scalyr logging endpoints.
Package scalyr contains commands to inspect and manipulate Fastly service Scalyr logging endpoints.
logging/sftp
Package sftp contains commands to inspect and manipulate Fastly service SFTP logging endpoints.
Package sftp contains commands to inspect and manipulate Fastly service SFTP logging endpoints.
logging/splunk
Package splunk contains commands to inspect and manipulate Fastly service Splunk logging endpoints.
Package splunk contains commands to inspect and manipulate Fastly service Splunk logging endpoints.
logging/sumologic
Package sumologic contains commands to inspect and manipulate Fastly service Sumologic logging endpoints.
Package sumologic contains commands to inspect and manipulate Fastly service Sumologic logging endpoints.
logging/syslog
Package syslog contains commands to inspect and manipulate Fastly service Syslog logging endpoints.
Package syslog contains commands to inspect and manipulate Fastly service Syslog logging endpoints.
mock
Package mock provides mock implementations of various interfaces.
Package mock provides mock implementations of various interfaces.
service
Package service contains commands to inspect and manipulate Fastly services.
Package service contains commands to inspect and manipulate Fastly services.
serviceversion
Package serviceversion contains commands to inspect and manipulate Fastly service versions.
Package serviceversion contains commands to inspect and manipulate Fastly service versions.
testutil
Package testutil provides helpers for unit tests.
Package testutil provides helpers for unit tests.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL