relic import moves existing secrets into a Relic environment in one command. Values are read into memory, encrypted on your device with the project key, and uploaded as ciphertext. Relic never writes plaintext to temporary files and never prints values. The plan and summary show secret names only.
Prerequisites
- Sign in with
relic loginand unlock your master password in the TUI at least once. - Select a project with
relic init,--project, orRELIC_PROJECT_ID. - The target environment, and folder if you use
-f, must already exist. Create them in the TUI.
Usage
source defaults to .env in the current directory.
To import a file whose name matches a provider, prefix it with
./, for example ./doppler.
The Import Plan
Before anything is uploaded, Relic compares the source with the target environment and prints a plan:- New secrets are created.
- Existing with different values are only written if you choose to overwrite them.
- Unchanged secrets already hold the same value, scope, and type, so they are not rewritten.
- Skipped entries could not be read from the source. Each one lists the reason.
- Invalid entries break Relic’s naming rules and are not imported.
Handling Existing Secrets
In a terminal, Relic asks whether to overwrite the existing secrets, keep them, or cancel. With no conflicts, it asks you to confirm the import. Use--dry-run to see the plan without being prompted.
When stdin or stdout is not a terminal (scripts, CI, or piping into relic import -), there is no prompt. New secrets are imported directly. If any existing secret would change, the import stops unless you pass --overwrite or --skip-existing.
Scopes
Each imported secret gets its scope from, in order:- The
scopefield of a JSON entry --scope- The existing secret’s scope, when overwriting
shared
Dotenv Files
The dotenv parser supports:#comments, and inline comments after unquoted values (KEY=value # comment)export KEY=value- Single, double, and backtick quotes, including values that span multiple lines
\n,\r,\t,\", and\\escapes inside double quotes. Single and backtick quotes are literal.- Empty values (
KEY=)
KEY=value are reported in the plan by line number.
JSON
JSON files can use the TUI bulk import format:Doppler
Install the Doppler CLI and sign in. Relic runsdoppler secrets download --no-file --format json and reads the output from stdout.
Doppler’s own
DOPPLER_PROJECT, DOPPLER_CONFIG, and DOPPLER_ENVIRONMENT keys are skipped.
Infisical
Install the Infisical CLI and sign in. Relic runsinfisical export --format=json.
If a key has both a shared value and a personal override, Relic imports the shared value.
Vercel
Relic reads environment variables for one target through the Vercel REST API.
The token comes from
VERCEL_TOKEN, or from the Vercel CLI’s login if you have run vercel login.
The following variables are skipped and listed by name:
- Sensitive variables. Vercel never returns their values, so add them to Relic manually.
- Preview variables scoped to a single Git branch
- Vercel system variables
1Password
Install the 1Password CLI and sign in. Relic runsop item get <item> --format json and imports each field of the item, using the field label as the key.
Name the fields after your environment variables, such as
DATABASE_URL. Labels with spaces or dashes are reported as invalid. Empty fields and the notes field are skipped.
After Importing
Once your secrets are in Relic, run your app with them injected instead of reading a local file:--delete-source. Relic asks for confirmation first, or requires --yes when there is no terminal. It refuses to delete the file if any entry was skipped, invalid, or kept at its existing value, so nothing in the file is lost.
secret.created and secret.updated events, the same events the TUI bulk import editor records.