Member-only story
How to Replacing iTerm2’s Password Manager in VS Code
Here is the fast track to setting up a secure, native, and searchable password picker directly inside VS Code using macOS Keychain.
Step 1: Save Secrets to macOS Keychain
Run these commands in your terminal to save your passwords securely. The -U flag updates the password if the item already exists.
security add-generic-password -a "$USER" -s "dev-pass" -w "dev123" -U
security add-generic-password -a "$USER" -s "db-pass" -w "database789" -U
security add-generic-password -a "$USER" -s "git-pass" -w "token_xyz" -UStep 2: Configure the Searchable Dropdown
Open the Command Palette (Cmd ⌘ + Shift + P), select Preferences: Open User Tasks, and paste this JSON. This creates a hidden task that copies the selected keychain password to your clipboard.
{
"version": "2.0.0",
"tasks": [
{
"label": "Get Saved Password",
"type": "shell",
"command": "security find-generic-password -s '${input:passwordChoice}' -w | pbcopy",
"presentation": {
"reveal": "never",
"echo": false,
"focus": false,
"panel": "dedicated",
"showReuseMessage": false,
"close": true
}
}
]…