Rayfin

Secret

rayfin secret set and secret list manage secrets on a deployed Rayfin item — masked interactive input, names/timestamps only, no bulk .env import.

rayfin secret manages secrets on the Rayfin item you've already deployed with rayfin up — API keys, connection strings, and other values your backend needs but that must never reach client code. See Secrets for the broader workflow and security model; this page is the command reference.

Note

rayfin secret is only registered when services.functions.enabled: true in rayfin.yml (or RAYFIN_FEATURE_FLAGS includes functions) — the same gate as rayfin functions.

Both subcommands require a prior deploy — they resolve the target endpoint from rayfin/.deployments.json and fail with "No remote endpoint configured" if you haven't run rayfin up yet. If you aren't signed in, both launch an interactive login automatically, the same as rayfin up.

Neither subcommand declares its own --json/--verbose/-y (unlike most other commands in this CLI) — pass the global flags on the root invocation instead, before secret: npx rayfin --json secret list, not npx rayfin secret list --json.

secret set

npx rayfin secret set <name>

Prompts for the secret's value with masked input (like a password prompt), so the value never appears in your shell history, in process arguments, or in --json output.

ArgumentDescription
<name>The name of the secret to set.

Warning

secret set has no non-interactive mode. There is no flag to pass the value directly, and it refuses to run without an interactive terminal or when CI=true is set — it exits with an error rather than hanging. There is currently no CLI-driven way to set a secret from an automated CI/CD pipeline; set each value once from an interactive session.

On success:

Setting secret...
✅ Secret "API_KEY" set successfully (updated: 8/23/2026, 6:39:10 AM)

With rayfin --json secret set <name>, the result is:

{
  "status": "success",
  "name": "API_KEY",
  "createdAt": "2026-08-23T06:39:10.803Z",
  "updatedAt": "2026-08-23T06:39:10.803Z"
}

secret list

npx rayfin secret list

Lists every secret configured on the deployment — names and timestamps only. Secret values are never returned by this or any other command; once set, a secret can only be overwritten with secret set, never read back.

Unlike secret set, secret list has no interactive-only restriction — it works fine in CI as long as you're authenticated (for example via the RAYFIN_TOKEN ambient-token variable; see Login) and pass --json.

Note

Without --json, plain-text output is only printed when stdin is an interactive terminal. A non-interactive, non-JSON invocation (for example piped output in a script) produces no output at all — pass rayfin --json secret list when scripting.

On success (interactive terminal, no --json):

📋 Secrets (2):

  Name:         API_KEY
  Created:      8/23/2026, 6:39:10 AM
  Last Updated: 8/23/2026, 6:39:10 AM

  Name:         DATABASE_PASSWORD
  Created:      8/23/2026, 6:40:02 AM
  Last Updated: 8/23/2026, 6:40:02 AM

With rayfin --json secret list, the result is:

{
  "status": "success",
  "count": 2,
  "secrets": [
    {
      "name": "API_KEY",
      "createdAt": "2026-08-23T06:39:10.803Z",
      "updatedAt": "2026-08-23T06:39:10.803Z"
    },
    {
      "name": "DATABASE_PASSWORD",
      "createdAt": "2026-08-23T06:40:02.100Z",
      "updatedAt": "2026-08-23T06:40:02.100Z"
    }
  ]
}
PromptSet and verify a secret on a deployed Rayfin item
My Rayfin project is already deployed with `npx rayfin up`. Run `npx rayfin secret set STRIPE_API_KEY`, enter the value when prompted, then run `npx rayfin --json secret list` to confirm it was set. Never print or log the secret value itself — only report the name and timestamps.
Something wrong on this page?Report an issueEdit this page

On this page