Azion CLI
Install the Azion CLI to set up, build, and deploy projects and manage Azion Platform resources from your terminal.
A command-line interface (CLI) for a cloud platform is a program you run in a terminal. You act on your account with typed commands instead of a web interface, and a token saved on your machine authorizes each command. Because every action is a command, the same steps run by hand, in a script, or in a CI/CD pipeline.
Azion CLI puts the Azion Platform behind one terminal command, azion, an open-source binary written in Go. It has two command families. Project commands set up the project in the current folder, run it locally, and build and deploy it. Resource commands create, list, describe, update, and delete one platform resource at a time, with the form azion <verb> <noun>. Use the Azion CLI to deploy a site or a function, test it locally, manage resources as code, or automate deploys in CI/CD pipelines.
A build runs in Azion Bundler, an open-source framework adapter. azion build and azion deploy run the bundler with the preset of the project, and the bundler adapts the output of a web framework to run on the Azion Platform. For how the two command families reach the platform, refer to How Azion CLI works.
You can also manage the same resources through the Azion API or with the Azion Terraform Provider.
Get started Browse the commandsHow the CLI works with your account
The Azion CLI is a client: the resources it creates and changes live in your account, and every command reaches them through the Azion API.
- You run
azionin a terminal. The CLI authorizes each command with the personal token that it saved on your machine at login. - A project command, such as
azion deploy, runs inside the project folder and reads theazion/azion.jsonfile and theazion.configfile there. - The CLI, a Go binary, calls the Azion API.
- The API creates or updates the resources of your account, such as an application and a workload. After a deploy, the CLI writes the ID of each resource into
azion/azion.json.
For the build, the project files, and the profiles in detail, refer to How Azion CLI works.
Project deploy
One command deploys a project. From the folder of a static site, azion deploy deploys it:
The command uploads the source files, and the build runs on Azion. The output ends with the domain that serves the site:
Uploading source filessends the project to Azion, so the build needs no toolchain on your machine. With--local, the build runs on your machine instead.- The Azion Console link opens Deploy Log, which shows the progress of the remote build.
- The last lines give the URL of the workload, a
map.azionedge.netdomain. - The command writes the ID of each resource it created into
azion/azion.json, so the next deploy updates the same resources.
The first deploy can take several minutes to answer from every location; later deploys take about two minutes. For every flag of the command, refer to Azion CLI deploy.
Install the CLI
The install script is the recommended way to install the Azion CLI. It puts the azion binary on your path:
The Azion CLI is also published for package managers. Homebrew, Chocolatey, and Windows Package Manager download the package for you. For RPM, dpkg, APK, and APT, first download the package for your system from the releases page, then install the downloaded file. Each tab shows the command that installs the CLI and the command that updates it:
Install the azion formula:
Update it to the latest version:
azion version confirms the install:
The command prints the version of the CLI:
The CLI then needs a personal token to act on your account. To save one, refer to Azion CLI login.
What the CLI covers
The Azion CLI covers the life of a project, the resources of an account, and the configuration of the CLI itself:
- Project commands:
azion initcreates a project from a template, andazion linksets up an existing folder.azion devruns the project on a local development server, andazion buildandazion deploybuild and deploy it.azion syncwrites the remote resources back into the project files,azion unlinkdetaches the folder, andazion rollbackserves an earlier deploy of a static site again. - Resource commands:
azion <verb> <noun>manages applications, functions, workloads, connectors, firewalls, DNS zones, certificates, storage buckets, and tokens, across 28 nouns. Resource commands lists each noun and the verbs it takes.azion clonecopies an application under a new name, andazion configmanages resources from manifest files. - Project configuration: azion.config.js declares the build settings of a project and the resources it needs on Azion, as code.
- Account and settings:
azion login,azion logout, andazion whoamimanage the session.azion profilesswitches between accounts, andazion resetreturns the stored settings to their defaults. The flags every command accepts are on Global options. - Cache:
azion purgeremoves cached objects before their TTL ends, andazion warmuprequests the pages of a site so that they are cached before visitors ask for them. - Logs:
azion logsprints the console logs of your functions and the HTTP event logs of your applications. - Frameworks: projects built with Next.js, React, Vue, Angular, Astro, and other frameworks deploy through Azion Bundler. Azion CLI guides and tutorials carries one guide per framework, and Frameworks compatibility describes how each framework runs on Azion Runtime. To deploy a repository from Azion Console instead of the terminal, refer to Import a project from GitHub.
- Help: Troubleshoot Azion CLI lists the errors a command can return and how to fix each one, and the Glossary defines the terms of the CLI.