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 / Option | Type | Description |
|---|---|---|
-p, --project <id_or_name> | string | Target project ID or slug to link or query, bypassing interactive selection |
-e, --env <name>(--environment <name>) | string | Target environment name (e.g. development, staging, production) to read or modify |
-f, --file <path> | string | Path to the source or destination .env file (defaults to .env in current directory) |
-l, --local | boolean | Target local override file (.env.local) instead of default canonical .env file |
--dry-run | boolean | Simulate command execution and preview changes without modifying remote vault or local filesystem |
--overwrite | boolean | Force overwrite of existing secrets or local files without interactive confirmation prompts |
--prune | boolean | Delete secrets in the remote environment vault that are not present in the local file being pushed |
-o, --override | boolean | Save or update secrets as personal developer overrides without modifying shared team values |
-b, --base(-t, --team) | boolean | Fetch canonical team environment secrets, ignoring personal workstation overrides (recommended for CI/CD) |
-s, --scope <path> | string | Subdirectory path or workspace scope to target instead of auto-detecting from the working directory (e.g. apps/web or packages/backend) |
-q, --quiet | boolean | Silence banners, progress spinners, and status output; only print process output and critical errors |
--ci | boolean | Optimize 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 push2. Upload secrets to a target environment
Uploads local variables specifically into the staging vault environment.
ray push --env staging3. Upload personal overrides from .env.local
Uploads secrets as personal developer overrides, ensuring team baseline values remain unchanged.
ray push --file .env.local --override4. 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 --prune5. Dry-run preview of planned vault modifications
Displays a formatted difference table (+ ADD, ~ UPDATE, - PRUNE) without modifying remote secrets.
ray push --dry-runExit Codes
| Code | Meaning | Recommended Action |
|---|---|---|
| 0 | Success. The command completed with no errors. | None required. |
| 1 | Runtime or execution failure. A child process returned non-zero status or a general error occurred. | Inspect process output or run with --verbose. |
| 2 | Authentication failed. Token is missing, expired, or invalid. | Run `ray login` or update `RAY_TOKEN`. |
| 3 | Configuration or binding error. Project or environment context was not found. | Run `ray init` or specify `--project` and `--env`. |
| 4 | Network 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.