Skip to Content
RcmadeDocs
Ray SecretsReferenceCLI ReferenceWorkspace

ray sync

Bi-directionally synchronize your local .env secrets with the server

Bi-directionally synchronize your local .env secrets with the server

Synopsis

ray sync [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
-b, --base(-t, --team)booleanFetch canonical team environment secrets, ignoring personal workstation overrides (recommended for CI/CD)
-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
-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. Interactive bi-directional synchronization

Reconciles remote secrets with local .env files, prompting how to resolve missing keys and conflicts.

ray sync

2. Synchronize with target environment

Explicitly synchronizes local .env variables with the staging vault instead of the workspace default.

ray sync --env staging

3. Synchronize team baseline secrets only

Isolates canonical team secrets, ignoring any personal developer overrides in .ray/local.json.

ray sync --base

4. Synchronize personal overrides to .env.local

Targets .env.local to manage personal developer overrides without modifying the shared .env file.

ray sync --local

5. Dry-run preview of planned synchronization changes

Inspects remote changes and previews planned pushes and deletions without modifying any local files or remote vault state.

ray sync --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.