Getting Started
Quickstart
Store and retrieve your first API key in under 2 minutes.
Quickstart
This guide walks you through storing and retrieving your first API key with the CLI.
Prerequisites
- Install the CLI
- Authenticate with your account
1. Create a project
Projects group related keys together (e.g., one project per app or service):
storemyapi projects create --name "my-saas-app"✓ Project created
ID: proj_a1b2c3d4
Name: my-saas-app2. Store a key
Add an API key to your project:
storemyapi keys set STRIPE_SECRET_KEY "sk_live_abc123..." \
--project my-saas-app \
--env production✓ Key stored (encrypted)
Name: STRIPE_SECRET_KEY
Project: my-saas-app
Environment: productionThe value is encrypted with AES-256 before being stored. The CLI never logs the raw value.
3. Retrieve a key
storemyapi keys get STRIPE_SECRET_KEY --project my-saas-appsk_live_abc123...The output is plain text so you can pipe it directly:
# Copy to clipboard (macOS)
storemyapi keys get STRIPE_SECRET_KEY --project my-saas-app | pbcopy
# Use in a command
curl -H "Authorization: Bearer $(storemyapi keys get STRIPE_SECRET_KEY -p my-saas-app)" \
https://api.stripe.com/v1/charges4. Pull all keys as .env
Export all keys for an environment as a .env file:
storemyapi env pull --project my-saas-app --env production > .env# Generated by storemyapi — production
# Do not commit this file
STRIPE_SECRET_KEY=sk_live_abc123...
DATABASE_URL=postgres://user:pass@host/db
RESEND_API_KEY=re_abc123...5. Inject into a process
Run a command with all your keys injected as environment variables:
storemyapi env run --project my-saas-app --env development -- npm run devThis starts npm run dev with all your development keys available as process.env.* without writing any .env file to disk.
What's next?
- CLI Keys Reference — Full list of key management commands
- Environment Export — Advanced
.envworkflows - CI/CD Integration — Use storemyapi in your pipelines