Step-by-Step Guides
These guides show the recommended workflow for common use cases in Stash.
Guide 1: Getting Started (Create Project and Upload Secrets)
Use this flow when starting a new project and you want to configure it and upload initial variables from your terminal.
- Log in to the CLI: Authenticate with your Stash credentials (enter your 2FA code if enabled).
stash login
- Create the project: Create the container for your project. Default environments
dev,staging, andprodwill be initialized automatically.stash projects create my-new-project
- Create a custom environment (Optional): If you need an additional environment, for example a testing one.
stash projects add-env qa --project my-new-project
- Link the CLI to the project: Configure the default project and environment in your local folder so you don't have to specify them every time.
stash config set --project my-new-project --env dev
- Upload your initial environment variables: Upload your local secrets (e.g., from a local
.envfile), encrypting them in Stash.stash push --file .env
Guide 2: Work on an Existing Project (Clone / Download and Run)
Use this flow if you've just joined an existing project or need to develop locally while injecting secrets without saving them to disk.
- Log in to the CLI: Authenticate so the CLI has read permissions.
stash login
- List and find your project: Identify the name or ID of the existing project in your account.
stash projects list
- Link your local CLI: Configure the project and working environment (e.g.,
dev).stash config set --project existing-project-name --env dev
- Option A: Download secrets to disk (if your framework requires it): Generate your local
.env.devfile.stash pull
- Option B (Recommended): Run directly in memory (No files on disk): Run your application while injecting secrets temporarily and securely into the child process RAM.
stash run -- npm run dev
Guide 3: Manage and Sync Secrets
Use these tools to manage and keep your team's secrets up to date.
- List secrets for the current project: Show a list of your secret keys for auditing.
stash secrets list
- Reveal values in the Web Dashboard:
For safety, secrets are encrypted and hidden. In the Stash web dashboard, click the Eye Icon next to any secret to temporarily reveal its value on screen. - Bulk update variables: If you modify your local
.envfile and want to sync changes to the cloud (adding new variables and updating existing ones).stash push --file .env