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 / Option | Type | Description |
|---|---|---|
-t, --token <token> | string | Authentication token (PAT or Service Token) to authenticate without interactive login prompts |
--api-url <url> | string | Custom Ray API server URL for self-hosted instances or local development |
--skip-init | boolean | Skip 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 login2. 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_0000003. 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.corp4. Authenticate without triggering post-login directory setup
Saves authentication credentials globally without prompting to link the current working directory.
ray login --skip-initExit 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.