Skip to main content

swa

Synopsis

swa [command] [options]

Description

This is the commandline utility for streamlining local development for Azure Static Web Apps. Use it to:

  • initialize Azure Static Web Apps project
  • build an Azure Static Web Apps project
  • login to Azure
  • start emulator or bind to dev server
  • deploy project to Azure Static Web Apps

If you don't enter any command and run swa, it will act as a macro command shorcut for swa init, swa build, swa login and swa deploy. The swa init command will only be executed if the swa-cli.config.json does not exist in the current folder.

The best way to get started is to use the swa command and follow the interactive prompts.

Options

Here are global options that you can use with any command supported by the swa CLI:

  • -v, --version: output the version number
  • -V, --verbose [prefix]: enable verbose output. Values are: silly,info,log,silent (default: "log", preset: "log")
  • -c, --config <path>: path to swa-cli.config.json file to use (default: "swa-cli.config.json")
  • -cn, --config-name <name>: name of the configuration to use
  • -g, --print-config: print all resolved options (default: false)
  • -h, --help: display help for command

Commands

Here are the currently supported swa commands. Use swa <command> --help to learn about options and usage for that particular command.

  • login: login into Azure
  • init: initialize a new static web app project
  • start: start the emulator from a directory or bind to a dev server
  • deploy: deploy the current project to Azure Static Web Apps
  • build: build your project

Usage

Configure, build, login and deploy your project to Azure Static Web Apps in one single command:

swa

That's it!

See Also