Skip to Content
RcmadeDocs
Ray SecretsReferenceCLI ReferenceSecrets

ray delete

Delete one or more secrets from an environment

Delete one or more secrets from an environment

Synopsis

ray delete [options] [keys...]

Positional Arguments

ArgumentRequiredDescription
[keys...]OptionalOne or more secret key names to delete from the environment vault (e.g. TEMP_TOKEN).

Flags & Options

Flag / OptionTypeDescription
-p, --project <id_or_name>stringTarget project ID or slug to link or query, bypassing interactive selection
-e, --env <name>(--environment <name>)stringTarget environment name (e.g. development, staging, production) to read or modify
-s, --scope <path>stringSubdirectory path or workspace scope to target instead of auto-detecting from the working directory (e.g. apps/web or packages/backend)
-o, --overridebooleanSave or update secrets as personal developer overrides without modifying shared team values
-y, --yes(--force)booleanAutomatically answer yes to all confirmation prompts (ideal for automated CI/CD scripts)
--sync-localbooleanSynchronize the updated secret value into the corresponding local .env file on disk
--dry-runbooleanSimulate command execution and preview changes without modifying remote vault or local filesystem
-q, --quietbooleanSilence banners, progress spinners, and status output; only print process output and critical errors
--cibooleanOptimize execution for headless CI/CD runners (disables spinners, prompts, colors, and update checks)
--jsonbooleanFormat command output as structured JSON for scripting, automation, and piping

Common Examples

1. Delete a single secret key with confirmation prompt

Prompts for confirmation before permanently deleting the secret from the remote vault.

ray delete TEMP_KEY

2. Delete multiple secret keys in a single invocation

Deletes a batch of secrets from the target environment in one command.

ray delete OLD_KEY_1 OLD_KEY_2

3. Non-interactive deletion for CI/CD automation

Bypasses the confirmation prompt for automated scripts and headless runners.

ray delete STALE_TOKEN --yes

4. Clear personal developer override, restoring shared team value

Removes your personal override, immediately restoring the shared team base secret.

ray delete DATABASE_URL --override

5. Delete secret from remote vault and purge from local .env file

Deletes the secret remotely and synchronizes the change to local disk files.

ray delete DEPRECATED_SECRET --sync-local

Exit Codes

CodeMeaningRecommended Action
0Success. The command completed with no errors.None required.
1Runtime or execution failure. A child process returned non-zero status or a general error occurred.Inspect process output or run with --verbose.
2Authentication failed. Token is missing, expired, or invalid.Run `ray login` or update `RAY_TOKEN`.
3Configuration or binding error. Project or environment context was not found.Run `ray init` or specify `--project` and `--env`.
4Network or API failure. Failed to reach the Ray Secrets vault.Check internet connection or run `ray doctor`.

Ready to eliminate plaintext secrets?

Create a workspace to organize environments, invite your team, and generate scoped Service Tokens for CI/CD.