Service Accounts (Recommended)
Service accounts provide passwordless CI/CD integration. See the Service Accounts guide for full details.1
Create a service account
2
Set the environment variable
3
Run with secrets
GitHub Actions
Use theheycupola/relic GitHub Action to install the prebuilt Relic CLI binary in seconds (no Node.js or Bun setup required):
The
id-token: write permission is required if you configured OIDC on your service account.
Without OIDC, it can be omitted. You can also pin a specific CLI version with version: "0.10.2"
or pass RELIC_SERVICE_TOKEN directly on individual steps instead of with: service-token.Check for Missing Keys Before Deploying
Add arelic check step before the deploy. It fails the job when a key listed in .env.example or read in your source code is missing from the environment. It reads secret names only and never decrypts values.
--compare with --strict so any difference in key names fails the job:
GitLab CI
GitHub Actions OIDC tokens are requested automatically. GitLab CI needs the
id_tokens block
above; the CI_JOB_JWT_V2 variable used by older GitLab versions was removed in GitLab 17.0.Environment Variables in the Command
relic run starts your command with only the secrets plus a minimal set of variables (PATH, HOME, USER, SHELL, TERM, LANG, LC_*, TMPDIR, TZ). CI variables such as CI, NODE_ENV, or GITHUB_* are not passed through by default. Add --inherit-env if your build needs them:
RELIC_SERVICE_TOKEN, RELIC_API_KEY, RELIC_PASSWORD, …) are never passed through, with or without --inherit-env.
Other Providers
Relic works with any CI/CD provider that supports environment variables. The pattern is always the same:- Install Relic (
bun add -g relicornpm install -g relic) - Set
RELIC_SERVICE_TOKENin your pipeline environment - Run
relic run -e <environment> -- <your command>
OIDC Trust Policies
For additional security, add OIDC trust policies to your service accounts. This verifies the CI platform’s identity so the service token only works from trusted environments. See the OIDC Trust Policies guide for details.API Keys (Legacy)
API keys still work but require two environment variables (RELIC_API_KEY + RELIC_PASSWORD) and expose your master password to the CI environment. To use API keys:
Scope Filtering
Use--scope to inject only a subset of secrets:
Folder Filtering
Use--folder to inject secrets from a specific folder:
Leak Scanning
Runrelic guard on pull requests to fail the build when a commit adds a dotenv file or the value of one of your secrets:
Security Considerations
- API keys can be revoked from the web dashboard at any time
- Each API key has scoped permissions (
secrets.read,user.keys.read) - API keys can be scoped to a specific project, restricting access to only that project’s secrets
- All API keys require an expiration date (maximum 365 days)
- API key usage is logged in the audit trail
- The master password is used only for decryption and is never sent to the Relic server