The Static Web Apps (SWA) CLI is an open-source commandline tool that streamlines local development and deployment for Azure Static Web Apps.
See: @azure/static-web-apps-cli .
npm install -g @azure/static-web-apps-cli
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
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
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.
Here are the currently supported swa commands. Use swa <command> --help to learn about options and usage for that particular command.
login: login into Azureinit: initialize a new static web app projectstart: start the emulator from a directory or bind to a dev serverdeploy: deploy the current project to Azure Static Web Appsbuild: build your projectThe 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
Last modified 15 March 2026