Skip to main content
The Relic extension for VS Code and Cursor routes the code you run through relic run, so secrets reach your program without a .env file on disk. It is not a secret browser: it never reads, shows, stores, or logs secret values. It only works with secret names, and every process that needs values is started by the relic CLI, which decrypts on your device.

Prerequisites

  • The Relic CLI, installed and logged in with relic login.
  • A project linked with relic init, so your workspace contains a relic.toml.
The extension activates when the workspace contains a relic.toml. In a monorepo with several relic.toml files, the extension uses the one closest to the file you’re editing.

Install

Install Relic from the VS Code Marketplace, or from Open VSX in Cursor. To install a local build, run Extensions: Install from VSIX… and pick the .vsix file.
The extension requires a trusted workspace, because it runs the relic CLI and your project’s commands.

Select an environment

The status bar shows the Relic environment that runs, tasks, debugging, and diagnostics use. Click it, or run Relic: Select Environment, to choose from the environments of the linked project. The choice is saved per workspace and per project. If the project has a single environment, or one named development, dev, or local, the extension selects it automatically. The status bar also tells you when something needs attention:

Run commands

Relic: Run with Secrets asks for a command and runs it in a terminal:
The command after -- is passed to your shell as you typed it.

Tasks

Every package.json script in the project appears under Tasks: Run Task → relic. Each one runs through relic run with the package manager your project uses (detected from packageManager or the lockfile). You can also define Relic tasks in .vscode/tasks.json:

Relic shell

Pick Relic Shell from the terminal profile dropdown, or run Relic: Open Shell with Secrets, to open a shell with secrets loaded through relic shell -e <environment>. If your CLI doesn’t include relic shell, the extension opens a regular terminal with a reminder to prefix commands with relic run -e <environment> --. Upgrade the CLI with relic upgrade to get a shell with secrets loaded.

Debugging

Run Relic: Debug Current File with Secrets (also in the editor’s run menu) to debug the active JavaScript, TypeScript, or Python file. Or add "relic": true to a configuration in .vscode/launch.json:
relic accepts true or an object with environment, folder, and scope. VS Code may underline relic as an unknown property; you can ignore that warning.

How it works

On macOS and Linux, relic run starts your program with a minimal environment (PATH, HOME, and a few others) plus your secrets. Debuggers usually hook into programs through environment variables like NODE_OPTIONS, which would be removed, so the extension connects over a local inspector port instead: Entries in the configuration’s env are re-applied after the secrets, so they still reach your program and take precedence over a secret with the same name.

Limitations

  • Node.js child processes (workers, cluster, child_process) are not debugged automatically, because the debugger attaches to a single port.
  • For Node.js, runtimeExecutable must be node or tsx. To debug something started by a package manager script, point the configuration at the entry file instead.
  • Bun and Python run in a terminal named Relic debug. If the program fails before the debugger attaches (for example, you’re logged out), the error is shown there.
  • Python on Windows, and remote, WSL, and container workspaces, are untested.

Missing-secret warnings

The extension highlights environment variables your code reads that aren’t secrets in the selected environment: Quick fixes open the Relic TUI so you can add the secret, copy the name, or ignore the variable for the workspace. Warnings refresh when the TUI closes, or when you run Relic: Refresh Environments and Secret Names. Names come from relic secrets --json, which returns names and scopes only. Common runtime variables such as NODE_ENV, PATH, and PORT are ignored by default.

Settings

Security

Last modified on October 12, 2026