Environment Variables
Sp00ky Cloud provides encrypted environment variable storage that syncs across your team. Each variable supports separate development and production values, so your local dev setup and production deployment stay in sync without .env files.
All values are encrypted at rest using the tenant’s Shared Vault. For details on the encryption model, key hierarchy, and security properties, see the vault documentation.
Quick Start
Initializing the Vault
Before using environment variables, initialize your encryption vault:
You’ll be prompted to:
- Choose a vault passphrase — this protects your encryption keys, pick something strong
- Confirm the passphrase
- Optionally cache it locally in
~/.sp00ky/vault-passphrase
If you skip env init, the vault will be created automatically the first time you run env set.
The first team member to run env init creates the tenant vault. Other members receive vault access through the invitation flow — they set their own passphrase when accepting the invitation. See Shared Vault for details.
Setting Variables
The CLI will interactively ask you:
- Variable name (if not provided as argument)
- Which environment(s) — choose from:
- Both (same value) — use one value for dev and prod
- Development only
- Production only
- Both (different values) — prompts for each separately
- The value — entered with masked input (like a password prompt)
Variable names are automatically uppercased. Running env set on an existing variable updates only the environments you specify — it won’t overwrite the other environment’s value.
Loading Variables
Load environment variables and pipe them into your dev workflow:
The output format is KEY=value, one per line — designed for shell evaluation:
The first time you run env load, you’ll be prompted for your vault passphrase. You can choose to cache it locally so subsequent loads are automatic.
In non-interactive environments (CI/CD), set the SPOOKY_API_KEY environment variable for authentication and cache the vault passphrase in ~/.sp00ky/vault-passphrase during your pipeline setup.
Listing Variables
Example output:
Values are never shown — only names and whether each environment has a value set.
Deleting Variables
Importing from a File
Import variables from an .env file:
Supports standard .env format — one KEY=value per line, comments with #, and quoted values.
Passphrase Management
Changing your passphrase:
Only your copy of the encryption key is re-wrapped. Other members and existing variables are unaffected.
Forgot your passphrase? A team admin can approve a reset so you can set a new one:
See Passphrase Reset for the full flow.
Caching: The CLI can cache your passphrase at ~/.sp00ky/vault-passphrase. To clear it:
CLI Reference
API Reference
All endpoints require authentication via Bearer token or API key.
Vault Endpoints
Initialize Vault
Returns 201 Created on success. Returns 409 Conflict if already initialized.
Vault Status
Change Passphrase
Returns 401 with code invalid_passphrase if the current passphrase is wrong.
Passphrase Reset Endpoints
Request Reset
Returns 201 Created. Sends email notification to all admins. Returns 409 Conflict if a request is already pending.
List Reset Requests (Admin)
Check Own Reset Status
Returns the current member’s active reset request, or 404 if none exists.
Approve Reset (Admin)
Returns 401 with code invalid_passphrase if the admin’s passphrase is wrong. Sends email to the requesting member.
Complete Reset
Returns 404 if no approved reset exists. Passphrase must be at least 8 characters.
Cancel Reset
Returns 204 No Content. Can be called by the requesting member or any admin.
Environment Variable Endpoints
All endpoints are scoped to a project: /v1/projects/{projectID}/envs.
Set Variable
dev_valueandprod_valueare optional — provide one or both- Set
both: truewithdev_valueto use the same value for both environments - Variable names are stored uppercase
- Returns
400with codevault_not_initializedif the vault hasn’t been set up
List Variables
Returns variable names and metadata (no decrypted values):
Load Variables (Decrypt)
environmentaccepts"development"(default) or"production"
- Returns
401with codeinvalid_passphraseif the passphrase is wrong - Returns
400with codevault_not_initializedif the vault hasn’t been set up
Delete Variable
Returns 204 No Content on success, 404 if the variable doesn’t exist.