Skip to Content
RcmadeDocs
Ray SecretsReferenceCLI ReferenceAuthentication

ray login

Authenticate with Ray Secrets via a Personal Access Token

Authenticate with Ray Secrets via a Personal Access Token

Synopsis

ray login [options]

Flags & Options

Flag / OptionTypeDescription
-t, --token <token>stringAuthentication token (PAT or Service Token) to authenticate without interactive login prompts
--api-url <url>stringCustom Ray API server URL for self-hosted instances or local development
--skip-initbooleanSkip automatic workspace initialization prompt immediately following successful authentication

Common Examples

1. Interactive OAuth 2.0 browser login

Launches your system browser for seamless OAuth 2.0 PKCE authentication with automatic local loopback callback.

ray login

2. Non-interactive authentication with Personal Access Token

Authenticates headlessly in CI/CD runners or automated scripts using a pre-generated PAT.

ray login --token ray_pat_example_000000

3. Authenticate against a custom on-premises server

Targets a custom private cloud or on-premises Ray Secrets API endpoint.

ray login --api-url https://secrets.internal.corp

4. Authenticate without triggering post-login directory setup

Saves authentication credentials globally without prompting to link the current working directory.

ray login --skip-init

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.