VS Code Extension
Manage your envctl secrets directly from VS Code. Switch environments, view variables, and open terminals with secrets loaded.
Installation
- Open VS Code
- Go to Extensions (Cmd/Ctrl+Shift+X)
- Search for "envctl"
- Click Install
Or install from the command line:
code --install-extension uradical.envctl
Prerequisite
The envctl CLI must be installed and in your PATH. The extension uses the CLI for all operations.
Features
Status Bar
The status bar shows your current project and environment:
myapp/dev
Click the status bar item to quickly switch environments. The status bar is color-coded:
- Green — dev environment
- Yellow — staging environment
- Red — prod environment
Sidebar Panel
The ENVCTL panel in the sidebar shows:
- Current project and environment
- List of variables (values redacted)
- Daemon status
- Sync status
Command Palette
Access envctl commands via the Command Palette (Cmd/Ctrl+Shift+P):
| Command | Description |
|---|---|
envctl: Switch Environment |
Select a different environment |
envctl: List Variables |
Show variables in current environment |
envctl: Copy Variable |
Copy a variable value to clipboard |
envctl: Open Terminal |
Open terminal with secrets loaded |
envctl: Refresh Status |
Refresh the sidebar panel |
envctl: Start Daemon |
Start the envctl daemon |
envctl: Show Logs |
Open audit log in output panel |
Switching Environments
There are several ways to switch environments:
- Status bar: Click the environment name in the status bar
- Command palette: Run "envctl: Switch Environment"
- Sidebar: Click the environment dropdown
When you switch, the extension:
- Updates the status bar
- Refreshes the variable list
- Updates any integrated terminals (if configured)
Opening Terminals with Secrets
Run "envctl: Open Terminal" to open a new terminal with secrets loaded:
- Open Command Palette (Cmd/Ctrl+Shift+P)
- Type "envctl: Open Terminal"
- Enter your passphrase if prompted
- A new terminal opens with secrets in the environment
This is equivalent to running envctl env shell but integrated into VS Code.
Auto-Inject Terminals
Enable automatic secret injection for all new terminals:
// settings.json
{
"envctl.autoInjectTerminal": true
}
Security note
Auto-injection means secrets are loaded into every terminal. Only enable this if you're comfortable with that behavior.
Viewing and Copying Variables
The sidebar shows all variables in your current environment. Values are redacted by default.
To copy a variable value:
- Click the variable in the sidebar
- Click "Copy Value"
- Enter passphrase if prompted
- Value is copied to clipboard
Or use the Command Palette: "envctl: Copy Variable"
Settings
Configure the extension in VS Code settings:
// settings.json
{
// Show status bar indicator
"envctl.showStatusBar": true,
// Auto-inject secrets into new terminals
"envctl.autoInjectTerminal": false,
// Environment color coding
"envctl.environmentColors": {
"dev": "green",
"staging": "yellow",
"prod": "red"
},
// Custom path to envctl binary (if not in PATH)
"envctl.envctlPath": "/usr/local/bin/envctl",
// Status refresh interval (ms)
"envctl.pollIntervalMs": 5000
}
Troubleshooting
"envctl not found"
The extension can't find the envctl binary. Either:
- Install envctl and ensure it's in your PATH
- Set
envctl.envctlPathto the full path
"No identity found"
Run envctl init in a terminal to create your identity.
"Not in a project"
Open a folder that contains an envctl project (has a .envctl/ directory).
Status bar not showing
Check that envctl.showStatusBar is set to true in settings.
Variables not updating
Run "envctl: Refresh Status" from the Command Palette, or check that the daemon is running.
Related
- Getting Started — Install envctl CLI
- Multiple Environments — Managing environments
- VS Code Marketplace
- Extension Source Code — GitHub repository