Skip to Content
RcmadeDocs
Ray SecretsReferenceCLI ReferenceWorkspace

ray push

Upload local secrets from .env files to the Ray Secrets backend

Upload local secrets from .env files to the Ray Secrets backend

Synopsis

ray push [options]

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
-f, --file <path>stringPath to the source or destination .env file (defaults to .env in current directory)
-l, --localbooleanTarget local override file (.env.local) instead of default canonical .env file
--dry-runbooleanSimulate command execution and preview changes without modifying remote vault or local filesystem
--overwritebooleanForce overwrite of existing secrets or local files without interactive confirmation prompts
--prunebooleanDelete secrets in the remote environment vault that are not present in the local file being pushed
-o, --overridebooleanSave or update secrets as personal developer overrides without modifying shared team values
-b, --base(-t, --team)booleanFetch canonical team environment secrets, ignoring personal workstation overrides (recommended for CI/CD)
-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)
-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)

Common Examples

1. Upload local .env secrets to default environment

Parses the local .env file and uploads new or modified secrets to the remote vault.

ray push

2. Upload secrets to a target environment

Uploads local variables specifically into the staging vault environment.

ray push --env staging

3. Upload personal overrides from .env.local

Uploads secrets as personal developer overrides, ensuring team baseline values remain unchanged.

ray push --file .env.local --override

4. Prune obsolete remote secrets missing from local file

Synchronizes vault state by deleting any remote keys that no longer exist in the local .env file.

ray push --overwrite --prune

5. Dry-run preview of planned vault modifications

Displays a formatted difference table (+ ADD, ~ UPDATE, - PRUNE) without modifying remote secrets.

ray push --dry-run

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.