ray unlink
Remove the Ray workspace link from the current directory
Remove the Ray workspace link from the current directory
Synopsis
ray unlink [options]Flags & Options
| Flag / Option | Type | Description |
|---|---|---|
-y, --yes(--force) | boolean | Automatically answer yes to all confirmation prompts (ideal for automated CI/CD scripts) |
-a, --all | boolean | Purge all local configuration state, including .ray/local.json, workspace metadata, and offline cache |
--parent | boolean | Operate on the nearest parent ancestor workspace instead of initializing a nested workspace |
Common Examples
1. Interactive directory unlinking
Unbinds current directory from Ray Secrets by deleting .ray/workspace.json after user confirmation.
ray unlink2. Non-interactive unlinking for automation scripts
Bypasses the confirmation prompt using -y for headless cleanup in automation scripts.
ray unlink --yes3. Deep purge of workspace link, local overrides, and cache
Removes .ray/workspace.json, purges .ray/local.json, and clears the offline decrypted cache.
ray unlink --yes --all4. Unlink nearest parent ancestor workspace
Resolves and unlinks the nearest parent workspace from within a nested subdirectory.
ray unlink --parentExit 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.