Skip to content

Latest commit

 

History

History
247 lines (172 loc) · 6.46 KB

README.md

File metadata and controls

247 lines (172 loc) · 6.46 KB

Azion CLI

MIT License CLI Reference Go Report Card

The Azion CLI (command-line interface) is an open source tool that enables you to manage any Azion service via command line. Through it, you can manage all Azion products, create automations using CI/CD scripts or pipelines, provision multiple services that make up your application with a few commands, and also manage your Azion configurations as code.

The developer friendly way to interact with Azion!

Quick links

Downloading

There are two ways to download and use azioncli The first, is the regular way of cloning this repository and building the project manually. However, azioncli is also available as homebrew, rpm, deb and apk packages.

To use rpm, deb and apk packages, please visit our releases page, and download the desired package.

To download azioncli through Homebrew, use the following:

  • brew install aziontech/tap/azioncli

Building

# Build project, by default it will connect to Production APIs
$ make build

# Cross-Build for multiple platforms and architectures
$ make cross-build

Setup Autocomplete

Please verify if you have autocomplete enabled globally, otherwise the autocomplete for cli will not work

Dependencies zsh

You need to install zsh-autosuggestions

MacOs

brew install zsh-autosuggestions

Linux

git clone https://github.com/zsh-users/zsh-autosuggestions \${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions

Installing autocomplete for azioncli only


MacOs / Linux

Run

echo "autoload -U compinit; compinit" >> ~/.zshrc 

Then run

echo "source <(azioncli completion zsh); compdef _azioncli azioncli" >> ~/.zshrc

If you uninstall azioncli, please edit your ~/.zshrc file and remove the line source <(azioncli completion zsh); compdef _azioncli azioncli

Installing autocomplete globally


MacOs

Run

echo "autoload -U compinit; compinit" >> ~/.zshrc 

Then open your ~/.zshrc file, and add the following content to it

if type brew &>/dev/null
then
  FPATH="$(brew --prefix)/share/zsh/site-functions:${FPATH}"

  autoload -Uz compinit
  compinit
fi

Linux

Open your ~/.zshrc file and add the following content to it

plugins=(zsh-autosuggestions)

If you have other plugins, just add zsh-zutosuggestions to the end.

Whether you chose to activate autocomplete globally or for azioncli only, the steps of each section should only be run once. After that, autocomplete will work every time you open a new terminal.

Dependencies bash

You need to install bash-completion

MacOs

brew install bash-completion

Centos/RHEL 7

yum install bash-completion bash-completion-extras

Debian/Ubuntu

apt-get install bash-completion

Alpine

apk add bash-completion

Installing autocomplete for azioncli only


MacOs / Linux

Run

echo "source <(azioncli completion bash)" >> ~/.bashrc 

If you uninstall azioncli, please edit your ~/.bashrc file and remove the line source <(azioncli completion bash)

Installing autocomplete globally


MacOS

Open your ~/.bashrc file, and add the following content to it

BREW_PREFIX=$(brew --prefix)
[[ -r "${BREW_PREFIX}/etc/profile.d/bash_completion.sh" ]] && . ${BREW_PREFIX}/etc/profile.d/bash_completion.sh

Linux

Run

echo "source /etc/profile.d/bash_completion.sh" >> ~/.bashrc

Whether you chose to activate autocomplete globally or for azioncli only, the steps of each section should only be run once. After that, autocomplete will work every time you open a new terminal.

Dependencies fish

Run the command below once

echo "azioncli completion fish | source" >> ~/.config/fish/config.fish

If you uninstall azioncli, please edit your ~/.config/fish/config.fish file and remove the line azioncli completion fish | source

How to Use

In order to perform network operations it is mandatory to provide an authentication token

You can provide token in two ways.

  • Using azion-cli configure command (this command saves the token in a configuration file for further use): $ azioncli configure -t

OR

  • Using environment variable (in this way the token will be cleared when the terminal is closed): $ export AZIONCLI_TOKEN=

You can just run azioncli and see it's options

$ azioncli
Interact easily with Azion services

USAGE
  azioncli [flags]

API COMMANDS
  edge_functions: Manages your Azion account's Edge Functions
  edge_services: Manages your Azion account's Edge Services

ADDITIONAL COMMANDS
  configure:     Configure parameters and credentials
  help:          Help about any command
  version:       Returns the binary version

FLAGS
  -h, --help      help for azioncli
  -v, --verbose   Makes azioncli verbose during the operation
      --version   version for azioncli

LEARN MORE
  Use 'azioncli <command> <subcommand> --help' for more information about a command

For each subcommand use the -h|--help flag to learn more about it:

$ ./bin/azioncli edge_functions --help
You can create, update, delete, list and describe your Azion account's Edge Functions

USAGE
  azioncli edge_functions [flags]

COMMANDS
  create:     Create a new Edge Function
  delete:     Deletes an Edge Function
  describe:   Describes an Edge Function
  list:       Lists your account's Edge Functions
  update:     Updates an Edge Function

FLAGS
  -h, --help   help for edge_functions

INHERITED FLAGS
  -v, --verbose   Makes azioncli verbose during the operation

LEARN MORE
  Use 'azioncli <command> <subcommand> --help' for more information about a command

License

This project is licensed under the terms of the MIT license.