MCPcopy Index your code
hub / github.com/Azure/static-web-apps-cli

github.com/Azure/static-web-apps-cli @v2.0.9

Chat with this repo
repository ↗ · DeepWiki ↗ · release v2.0.9 ↗ · + Follow
1,013 symbols 2,582 edges 438 files 53 documented · 5% 3 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Azure Static Web Apps CLI

NPM version Node version CI status Contributions welcome

logo

The Static Web Apps CLI, also known as SWA CLI, serves as a local development tool for Azure Static Web Apps. It can:

  • Serve static app assets, or proxy to your app dev server
  • Serve API requests, or proxy to APIs running in Azure Functions Core Tools
  • Emulate authentication and authorization
  • Emulate Static Web Apps configuration, including routing and ACL roles
  • Deploy your app to Azure Static Web Apps

Important Notes

If you have suggestions or you encounter issues, please report them or help us fix them. Your contributions are very much appreciated. 🙏

The CLI emulates commonly used capabilities of the Azure Static Web Apps cloud service. Some differences are expected. Always deploy and test your apps in Azure to confirm behavior.

Quickstart

Installing the CLI with npm, yarn or pnpm:

  • To install the CLI in your project, use:

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

You can also install the SWA CLI globally using npm install -g @azure/static-web-apps-cli.

Basic usage

  • Open a SWA app folder at the root (outside any /api or /app folders):

bash cd my-awesome-swa-app

  • The best way to get started is to run the swa command alone and follow the interactive prompts: bash 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.

  • 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

Using npx:

  • Open a SWA app folder at the root (outside any /api or /app folders):
cd my-awesome-swa-app
  • Create a configuration for your project:
npx @azure/static-web-apps-cli init
  • Start the emulator:
npx @azure/static-web-apps-cli start
  • Access your SWA app from http://localhost:4280

See all available commands and options.

Want to help?

Want to file a bug, contribute some code, or improve the documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues in the list: community-help.

Extension points exported contracts — how you extend this code

KeychainCredentialsStore (Interface)
(no doc) [4 implementers]
src/core/swa-cli-persistence-plugin/impl/credentials-store.ts
ProcessEnv (Interface)
(no doc)
src/swa.d.ts
CommandInfo (Interface)
(no doc)
src/cli/commands/start/start.ts
Chainable (Interface)
(no doc)
e2e/samples/ssr/remix/cypress/support/commands.ts
Encryption (Interface)
(no doc) [1 implementers]
src/core/swa-cli-persistence-plugin/impl/crypto.ts
StaticSiteClientEnv (Interface)
(no doc)
src/swa.d.ts
ActionData (Interface)
(no doc)
e2e/samples/ssr/remix/app/routes/join.tsx
PEMOptions (Interface)
(no doc)
src/core/ssl.ts

Core symbols most depended-on inside this repo

add
called by 49
e2e/samples/app/mdbook/theme/highlight.js
convertToNativePaths
called by 40
src/test.helpers.ts
isFunction
called by 40
e2e/samples/app/slate/source/javascripts/lib/_jquery.js
jQuery
called by 39
e2e/samples/app/slate/source/javascripts/lib/_jquery.js
exec
called by 37
e2e/samples/app/mdbook/theme/highlight.js
r
called by 31
e2e/samples/app/mdbook/theme/highlight.js
response
called by 30
src/core/utils/net.ts
resolve
called by 24
e2e/samples/app/slate/source/javascripts/lib/_jquery.js

Shape

Function 668
Method 185
Class 123
Interface 37

Languages

TypeScript92%
C++4%
C#2%
Python1%
Ruby1%
Kotlin1%

Modules by API surface

e2e/samples/app/slate/source/javascripts/lib/_jquery.js112 symbols
e2e/samples/app/mdbook/theme/highlight.js71 symbols
src/core/swa-cli-persistence-plugin/impl/credentials-store.ts31 symbols
src/core/frameworks/detect.ts24 symbols
e2e/samples/app/flutter/windows/runner/win32_window.cpp21 symbols
src/core/utils/cookie.ts17 symbols
src/core/func-core-tools.ts17 symbols
e2e/samples/app/mdbook/theme/book.js17 symbols
e2e/samples/app/sapper/scripts/setupTypeScript.js13 symbols
src/core/account.ts12 symbols
e2e/samples/app/pelican/tasks.py12 symbols
src/core/utils/net.ts11 symbols

For agents

$ claude mcp add static-web-apps-cli \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact