Installation
Node projects
If you are using SST as a part of your Node project, we recommend installing it locally.Global install
If you are not using Node, you can install the CLI globally.Package managers
The CLI currently supports macOS, Linux, and WSL. Windows support is in beta.
macOS
The CLI is available via a Homebrew Tap, and as downloadable binary in the releases.brew upgrade sst, before the update.
Linux
The CLI is available as downloadable binaries in the releases. Download the.deb or .rpm and install with sudo dpkg -i and sudo rpm -i.
For Arch Linux, it’s available in the aur.
Usage
Once installed you can run the commands using:Global flags
The CLI takes a few global flags that apply to all commands.--stage
Set the stage the CLI is running on.
Changing the stage will redeploy your app to a new stage with new resources. The old resources will still be around in the old stage.
SST_STAGE environment variable:
.env file or in the CLI session.
If the stage is not passed in, then the CLI will:
- Use the username on the local machine.
- If the username is
root,admin,prod,dev,production, then it will prompt for a stage name.
- If the username is
- Store this in the
.sst/stagefile and reads from it in the future.
--verbose
Prints extra information to the log files in the .sst/ directory.
--print-logs flag.
--print-logs
Print the logs to the screen. These are logs that are written to the .sst/ directory.
SST_PRINT_LOGS environment variable:
--config
Optionally, pass in a path to the SST config file. This defaults to sst.config.ts in the current directory.
--help
Prints help for the given command.
Environment variables
You can access any environment variables set in the CLI in yoursst.config.ts file. For example, running:
ENV_VAR through process.env.ENV_VAR.
Commands
The CLI provides the following commands:sst init- Initialize a new projectsst dev- Run in development modesst deploy- Deploy your applicationsst add- Add a new providersst install- Install all the providerssst secret- Manage secretssst shell- Run a command with linked resourcessst remove- Remove your applicationsst refresh- Refresh the local app statesst unlock- Clear any locks on the app statesst upgrade- Upgrade the CLI