Skip to Content
RcmadeDocs
Ray SecretsReferenceCLI Reference

CLI Reference Overview

Complete command manifest, global options, exit codes, and categories for the Ray CLI executable.

The Ray CLI (ray) is a standalone compiled binary that interacts with the Ray Secrets cryptographic vault and injects credentials directly into runtime process memory without leaving plaintext on disk.

Command Invocation Syntax

ray <command> [options] [-- <args...>]

All command-specific options and common execution flags must be specified after the target command:

  • <command>: The Ray Secrets command to execute (e.g. run, pull, sync, login).
  • [options]: Command-specific flags (e.g. --env (--environment <name>), --mount) and common execution flags (e.g. --quiet, --strict, --offline, --ci).
  • [-- <args...>]: Double-hyphen delimiter isolating child process arguments from Ray CLI flags when executing commands through ray run.

For root-level diagnostic inspection:

ray --help
ray --version

Interactive Mode (Terminal UI)

When invoked without arguments in an interactive terminal (TTY), Ray CLI automatically launches a context-aware Terminal UI (TUI):

ray

The interactive menu dynamically inspects your local environment and provides:

  • Context-Aware Dynamic Filtering: Automatically probes authentication status (~/.config/ray/config.json) and project linkage (.ray/workspace.json). It hides commands that are not applicable to your current state (e.g., hides ray login when already authenticated; reveals workspace actions when a project link is detected).
  • Fuzzy Autocomplete: Type to filter commands instantly or use arrow keys (↑ / ↓) to navigate and press Enter to execute.
  • Interactive Option Wizards: When running subcommands such as ray init, ray pull, ray push, ray set, or ray completion without flags, the CLI interactively prompts for required options (e.g., selecting environments, workspace names, or target shells).
  • CI/CD & Headless Safety: When running inside non-interactive environments (CI pipelines, automated scripts, or standard input redirects), Ray CLI automatically disables prompts and falls back to standard help output to prevent hanging pipelines.

Global & Common Flags

The following flags are accepted across commands:

Flag / OptionTypeDescription
-q, --quietbooleanSilence banners, progress spinners, and status output; only print process output and critical errors
--strict(--exit-code)booleanAbort execution immediately with an exit code if any required secret is missing, empty, or drifting
--offlinebooleanRun using encrypted local disk cache without connecting to the remote Ray Secrets API server
--cibooleanOptimize execution for headless CI/CD runners (disables spinners, prompts, colors, and update checks)
--revealbooleanDisplay plaintext secret values in the terminal table instead of masking characters
-l, --localbooleanTarget local override file (.env.local) instead of default canonical .env file
--jsonbooleanFormat command output as structured JSON for scripting, automation, and piping
-h, --helpbooleanDisplay help and usage information for any command
-V, --versionbooleanDisplay the installed CLI version

Commands by Category

Workspace

Commands to link, synchronize, and configure local project repositories.

CommandDescription
ray initLink current directory to a Ray Secrets project
ray workspace createCreate a new Ray Secrets workspace
ray syncBi-directionally synchronize your local .env secrets with the server
ray env createCreate a new environment via the Ray Console
ray pullDownload decrypted secrets for an environment and save them to a file or stdout
ray pushUpload local secrets from .env files to the Ray Secrets backend
ray unlinkRemove the Ray workspace link from the current directory
ray workspace unlinkRemove the Ray workspace link from the current directory

Secrets

Commands to inject, retrieve, compare, and modify vault secrets.

CommandDescription
ray listDisplay all secret keys for an environment in a clean, masked table
ray setSet or update secret key-value pairs in an environment
ray getFetch and display or extract a secret value by key
ray deleteDelete one or more secrets from an environment
ray diffCompare secret keys and values across environments to detect configuration drift
ray runInject secrets directly into a command environment without writing files

Projects

Commands to inspect and create projects across workspaces.

CommandDescription
ray projectsList and inspect projects in a workspace
ray project listList and inspect projects in a workspace
ray project createCreate a new project in a workspace

Authentication

Commands to authenticate, verify identity, and manage developer sessions.

CommandDescription
ray whoamiShow your current authentication status and user information
ray logoutRemove your stored credentials from this machine
ray loginAuthenticate with Ray Secrets via a Personal Access Token

System

Commands to inspect system health, audit configurations, and generate shell completions.

CommandDescription
ray completionAutomated setup for shell autocompletion
ray doctorRun a pragmatic security and health audit on your repository, secrets, and configuration

Deterministic Exit Codes

Ray CLI exits with standard process exit codes to simplify shell scripting and CI/CD automation:

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.