capy run and set SECRETS_BLOB + PROJECT_KEY in their env var UI.
The pattern
npm start (or equivalent). With SECRETS_BLOB and PROJECT_KEY both set, capy run decrypts the blob at boot and spawns node server.js with the plaintext values in process.env. It doesn’t read .env in this mode. The child runs until killed; capy run forwards SIGTERM, SIGINT, and SIGHUP to it and exits with its exit code.
Any runtime works - just swap the inner command:
- Python:
capy run -- python app.py - Go:
capy run -- ./my-binary - Ruby:
capy run -- bundle exec rails server
- Set both variables or neither. With only one of the two,
capy runrefuses to guess which mode you meant and exits 1. - Config vars the platform sets itself win. The decrypted values are merged underneath the existing
process.env, so aDATABASE_URLyou also set in Railway’s, Render’s, or Heroku’s own store overrides the one Capy delivered.
Railway
- Install: add
@capysc/clias a dep (bun add @capysc/cli). Railway will install it during the build step. - Start command: either use the
startscript inpackage.json(Railway runsnpm startby default) or set a custom start command in Railway’s service settings:capy run -- <your cmd>. - Env vars: set
SECRETS_BLOBandPROJECT_KEYin Variables (Railway dashboard). - Deploy: push to the connected git branch.
Render
- Install:
@capysc/clias a dep. - Start command: in Render’s service settings → Start Command, set
capy run -- <your cmd>. - Env vars: Environment tab → add
SECRETS_BLOBandPROJECT_KEY. - Deploy: push, Render picks up the new build.
Heroku
@capysc/cli needs to be in dependencies (not devDependencies) so Heroku installs it for the runtime dyno.
Per-environment secrets
Each platform has a separate env var store per service / environment.capy deploy mints from whatever .env holds when you run it, which is the secret branch you currently have checked out - so switch branches first, then mint one pair per environment:
- Railway: create a new Capy deploy token for each Railway environment (Production, Staging, etc.)
- Render: same - each service instance gets its own token
- Heroku: each Heroku pipeline stage gets its own config vars
Revocation
capy deploy list shows your active tokens; pass the token id to capy deploy revoke to disable it. Revoking a token prevents future deployments from using it. If the values themselves may be exposed, change them at their source - capy rotate covers the credentials you set up with capy connect - then mint a fresh deploy token.