Skip to main content
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 login and unlock your master password in the TUI at least once.
  • Select a project with relic init, --project, or RELIC_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.
Keys must start with a letter or underscore, contain only letters, numbers, and underscores, and be at most 100 characters. Values can be up to 10,000 characters. These are the same rules the TUI bulk import editor uses. If a key appears twice, the first occurrence is imported and the duplicate is reported.

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:
  1. The scope field of a JSON entry
  2. --scope
  3. The existing secret’s scope, when overwriting
  4. 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=)
Lines that are not KEY=value are reported in the plan by line number.

JSON

JSON files can use the TUI bulk import format:
Or a flat object:

Doppler

Install the Doppler CLI and sign in. Relic runs doppler 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 runs infisical 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 runs op 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:
After a dotenv import, Relic reminds you to delete the file so plaintext secrets don’t stay on disk. To delete it as part of the import, pass --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.
Imports are recorded in the project’s audit log as secret.created and secret.updated events, the same events the TUI bulk import editor records.
Last modified on October 12, 2026