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 throughray run.
For root-level diagnostic inspection:
ray --help
ray --versionInteractive Mode (Terminal UI)
When invoked without arguments in an interactive terminal (TTY), Ray CLI automatically launches a context-aware Terminal UI (TUI):
rayThe 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., hidesray loginwhen 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 pressEnterto execute. - Interactive Option Wizards: When running subcommands such as
ray init,ray pull,ray push,ray set, orray completionwithout 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 / Option | Type | Description |
|---|---|---|
-q, --quiet | boolean | Silence banners, progress spinners, and status output; only print process output and critical errors |
--strict(--exit-code) | boolean | Abort execution immediately with an exit code if any required secret is missing, empty, or drifting |
--offline | boolean | Run using encrypted local disk cache without connecting to the remote Ray Secrets API server |
--ci | boolean | Optimize execution for headless CI/CD runners (disables spinners, prompts, colors, and update checks) |
--reveal | boolean | Display plaintext secret values in the terminal table instead of masking characters |
-l, --local | boolean | Target local override file (.env.local) instead of default canonical .env file |
--json | boolean | Format command output as structured JSON for scripting, automation, and piping |
-h, --help | boolean | Display help and usage information for any command |
-V, --version | boolean | Display the installed CLI version |
Commands by Category
Workspace
Commands to link, synchronize, and configure local project repositories.
| Command | Description |
|---|---|
ray init | Link current directory to a Ray Secrets project |
ray workspace create | Create a new Ray Secrets workspace |
ray sync | Bi-directionally synchronize your local .env secrets with the server |
ray env create | Create a new environment via the Ray Console |
ray pull | Download decrypted secrets for an environment and save them to a file or stdout |
ray push | Upload local secrets from .env files to the Ray Secrets backend |
ray unlink | Remove the Ray workspace link from the current directory |
ray workspace unlink | Remove the Ray workspace link from the current directory |
Secrets
Commands to inject, retrieve, compare, and modify vault secrets.
| Command | Description |
|---|---|
ray list | Display all secret keys for an environment in a clean, masked table |
ray set | Set or update secret key-value pairs in an environment |
ray get | Fetch and display or extract a secret value by key |
ray delete | Delete one or more secrets from an environment |
ray diff | Compare secret keys and values across environments to detect configuration drift |
ray run | Inject secrets directly into a command environment without writing files |
Projects
Commands to inspect and create projects across workspaces.
| Command | Description |
|---|---|
ray projects | List and inspect projects in a workspace |
ray project list | List and inspect projects in a workspace |
ray project create | Create a new project in a workspace |
Authentication
Commands to authenticate, verify identity, and manage developer sessions.
| Command | Description |
|---|---|
ray whoami | Show your current authentication status and user information |
ray logout | Remove your stored credentials from this machine |
ray login | Authenticate with Ray Secrets via a Personal Access Token |
System
Commands to inspect system health, audit configurations, and generate shell completions.
| Command | Description |
|---|---|
ray completion | Automated setup for shell autocompletion |
ray doctor | Run 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:
| 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.