Azion CLI link
Azion CLI command that sets up an existing project folder for Azion with a preset, with every flag, its type, and its default.
The Azion CLI link command sets up the project in the current directory so that the CLI can build, run, and deploy it as an Application. It writes the azion/azion.json file and an azion.config file for the preset you choose, and it can add entries to .gitignore and a GitHub Actions workflow. The command creates no resource on Azion: every ID in azion/azion.json stays 0 until the first deploy. The options every command accepts, such as --format, --out, and -y, are on Global options.
Usage
Run azion link from the root folder of the project:
| Flag | Short | Type | Default | Description |
|---|---|---|---|---|
--auto | — | — | — | Runs the whole command without stopping for a question. It adds the .gitignore entries and the GitHub Actions workflow, and it does not build or deploy the project. |
--config-dir | — | string | "azion" | Relative path to the folder that holds your azion.json and args.json files. |
--local | — | — | — | Runs the build and the deploy on your machine when you deploy the project from this command. |
--name | — | string | — | Name of the application. Without it, the command suggests a random name and asks you to accept it or type another. |
--package-manager | — | string | — | Package manager to use, such as npm, yarn, or pnpm. |
--preset | — | string | — | Preset the project builds with, such as html or next. The names are the ones Azion CLI presets lists. Without it, the command opens a picker with the same names. |
--remote | — | string | — | URL of a Git repository to clone and link to an application. |
--skip-framework-build | — | — | — | Skips the framework build that runs before azion build. |
--sync | — | — | — | Synchronizes the local azion.json file with the remote resources when you deploy the project from this command. |
For a static HTML site, use the html preset. A project linked with html serves the files in its www folder, so move your files into www before you build or deploy. Files at the root of the project are not uploaded.
To run the command from a script, pass --name, --preset, and --auto. The command then asks no question.
Examples
Each example shows the command and the output it prints.
Link a static site without questions
This command links a static HTML site named my-site and asks no question:
The command writes the project files and reminds you to build the project:
The command adds .edge/, .vulcan, and .open-next to .gitignore, writes azion.config.cjs, and writes azion/azion.json with no resource IDs:
The workflow in .github/workflows/azion-deploy.yml runs azion build and azion deploy --local when you start it by hand in GitHub. It reads a personal token from the AZION_PERSONAL_TOKEN secret of the repository.
Link a project with questions
This command links the same kind of site and asks a question at each step:
The command asks you to confirm the folder, then opens the preset picker. This example answers yes to .gitignore, no to the workflow, yes to the build, and no to the dependencies, the local development server, and the deploy:
Without --name, the command asks for the name after the folder question and suggests a random one: