Use Envault from the CLI
Configure, download and run with Envault values from the RDC CLI.
CLI configuration, download and runtime
Follow RDC CLI login, then run these commands from your application's directory. The API address is configured automatically:
rdc login
rdc secret configureSelect your workspace, application group (the Envault project), and environment. The selection is saved under ~/.rdc/envault/ and associated with the current directory. It contains the directory, workspace, application group and environment selection, never secret values. Commands use the nearest configured directory, including a parent directory. Configure a subdirectory separately to override its selection; sibling directories remain independent. No configuration file is created inside your project. rdc secrets and rdc envault are aliases of rdc secret.
# CI / non-interactive configuration
rdc secret configure --workspace <workspace-uuid> --group backend --environment develop
# Run directly with secrets as child-process environment variables; no .env file is created
rdc secret runtime -- npm run dev
rdc secret runtime --environment production -- node server.js
# Download to .env (mode 0600 on POSIX); existing output is preserved by default
rdc secret download
rdc secret download --format json --output secrets.json
rdc secret download --force
rdc secret download --format json --stdoutGroup downloads include Workspace defaults, all connected Shared environments and Application values, and resolve ${shared.group.environment.KEY} references. Application values take precedence over Workspace defaults. Only Application environments can be downloaded; direct Shared or Workspace downloads are not supported. runtime inherits local environment variables, then overlays the resolved Envault values. It excludes the reserved RDC_TOKEN variable from the child environment, including an Envault value with that name. The command after -- is executed directly without shell evaluation. Use an explicit shell when shell syntax is needed. Child output and exit codes are preserved; interruption is forwarded to the child. Programs started this way can access and print their environment, so their output is under that program's control.
CLI selection requires envault.collections.read; downloading or running with values requires envault.secrets.access at workspace scope. Workspace General Viewer and Envault Secret Accessor provide value access. Project permissions alone do not grant workspace secret access. Access is checked again before values are returned. Downloads are limited to 1,000 source keys and 4 MiB of plaintext. No offline secret cache is maintained. Missing references, invalid scope, permission revocation or a service error prevent output and runtime execution. Dotenv serialization preserves literal values and refuses values it cannot represent losslessly; use JSON for those values. Dotenv files are data files, not shell scripts to source. Keep exported secrets out of version control. On Windows, file access is governed by directory ACLs; POSIX mode 0600 is not a Windows ACL guarantee.
CLI troubleshooting
| Symptom | Action |
|---|---|
| No directory selection | Run rdc secret configure from the application directory. Subdirectories inherit the closest configured parent. |
| Workspace or group not listed | Check the account with rdc whoami and request the appropriate workspace role. |
| Download or runtime returns permission denied | Ask a workspace administrator for secret-value access; Project Admin alone is insufficient. |
| Token expired or was revoked | Run rdc logout, then rdc login. Directory selections remain available. |
| Output file already exists | Choose a different --output path, or use --force only when you intend to replace it. |
| Cannot represent a value in dotenv | Retry with --format json, or use runtime without a file. |
| Shared reference cannot be resolved | Correct the reference or its source in Console; the CLI will not run the child command after a failed fetch. |
| Environment requires your approval | Run the command in an interactive terminal and approve it in the browser. CI jobs cannot use protected environments. |
| Approval is invalid, expired or already used | Run the command again to request a new approval. |
See CLI command reference for shell completions and flags.