Website

The Static Web Apps (SWA) CLI is an open-source commandline tool that streamlines local development and deployment for Azure Static Web Apps.

Installing the CLI

See: @azure/static-web-apps-cli .

  1. To install this globally, use:
npm install -g @azure/static-web-apps-cli
Note

You can also install the SWA CLI inside a project (instead of globally) as a development dependency using:

npm install -D @azure/static-web-apps-cli

Validate the install

Installing the package will make the swa command available on your development machine. To validate your install, you can check the installed version with:

swa --version# Should print out the version number

Basic usage

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

swa

It will generate a configuration for you, then build your project and ask if you want to deploy it to Azure.

See swa for more details.

Extended usage

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

Run using npx

The npx command (aka "npm exec") lets you run an arbitrary command from a local or remote npm package. If the command was not installed globally on the device, this installs it for you in a central cache - making it a useful option if you want to use different versions of the same command on the local device.

You can run any Static Web Apps CLI commands directly using npx. For example:

npx @azure/static-web-apps-cli --version

Or use this command to start the emulator:

npx @azure/static-web-apps-cli start


Tags: cloud   azure   tool   presentation  

Last modified 15 March 2026