/homelab-core:homelab-secretsfrom homelab-core
How to store and use homelab credentials securely via the OS-native secret store (macOS Keychain, Windows Credential Vault, Linux libsecret/pass) instead of plaintext env vars, dotfiles, or committed files — and how to handle SSH auth (keys over passwords, ssh-agent, passphrases in the keychain). Load this whenever a task needs a token, password, or SSH credential: setting one up, retrieving one to run a command or MCP server, or advising the user where to keep it. Pairs with homelab-ssh and homelab-safety.
Ships in homelab-core. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Homelab work needs credentials — Proxmox API tokens, NPM/Dockhand/Portainer passwords, SSH keys. None of
them should live in plaintext in the repo, in shell profiles (.zshrc/.bashrc), in committed .env
files, or pasted into the chat. Keep them in the OS-native secret store and inject them at the moment a
command or server needs them.
--password abc) — it leaks into shell history and ps. Use the
secret store, env injection, or stdin..gitignore blocks .env/keys; keep it that way.--privsep and only the
roles a task needs — see proxmox:proxmox-api), and rotate/delete when no longer needed.homelab-secret helper (ships with this plugin)Use it to store and retrieve credentials in the OS store without touching plaintext files.
scripts/homelab-secret (Keychain, or libsecret/pass).scripts/homelab-secret.ps1 (Credential Vault).Put it on your PATH once (e.g. symlink the unix script into ~/.local/bin/homelab-secret). Secrets are
namespaced under the service homelab-assist, and the KEY you choose should match the environment
variable the consumer expects (so retrieval is mechanical):
| Consumer | Keys to store |
|---|---|
npm MCP server (docker plugin) | NPM_PASSWORD (and optionally NPM_EMAIL, NPM_URL) |
Proxmox API / pve-api.sh | PVE_TOKEN_SECRET (+ PVE_TOKEN_ID, PVE_HOST) |
| Dockhand MCP | DOCKHAND_PASSWORD |
| Portainer MCP | PORTAINER_API_KEY |
Commands:
homelab-secret set NPM_PASSWORD # prompts hidden, stores in the OS vault
homelab-secret has NPM_PASSWORD # exit 0 if present (no output)
homelab-secret get NPM_PASSWORD # prints to stdout — pipe directly, never to chat
homelab-secret run NPM_PASSWORD -- npm-mcp # exports the key(s) into the child env, then execs
homelab-secret delete NPM_PASSWORD
(Windows: homelab-secret.ps1 set NPM_PASSWORD, etc.)
PVE_TOKEN_SECRET="$(homelab-secret get PVE_TOKEN_SECRET)" \
plugins/proxmox/scripts/pve-api.sh GET /version
or, cleaner, homelab-secret run PVE_TOKEN_SECRET -- pve-api.sh GET /version.npm server's launcher will auto-resolve missing NPM_* values from the
store if homelab-secret is on your PATH (so you never have to export them in a dotfile). For reused
community servers (Dockhand/Portainer), wrap the launch in homelab-secret run <KEY> -- <server> or set the
vars in the session that starts Claude Code from the store.export NPM_PASSWORD="$(homelab-secret get NPM_PASSWORD)" in the current
shell only — never persist it to a profile file.When you (the agent) retrieve a secret to run something, do it in a single command that pipes/injects the value into the consumer. Do not display the retrieved value back to the user.
SSH is the highest-power credential — handle it well (this complements homelab-ssh):
sshpass
with inline passwords entirely.ssh-add --apple-use-keychain ~/.ssh/id_ed25519 stores the passphrase in Keychain; add
AddKeysToAgent yes and UseKeychain yes to ~/.ssh/config.ssh-add with ssh-agent (often via the desktop keyring); or keychain.ssh-agent service (Get-Service ssh-agent; ssh-add).~/.ssh/config for per-host HostName/User/IdentityFile/Port so commands carry no inline
credentials and you target the right host by alias.| OS | Store | Set | Get |
|---|---|---|---|
| macOS | Keychain (security) | security add-generic-password -U -s homelab-assist -a KEY -w | security find-generic-password -s homelab-assist -a KEY -w |
| Windows | Credential Vault (WinRT PasswordVault) | via homelab-secret.ps1 set | via homelab-secret.ps1 get |
| Linux (desktop) | libsecret / GNOME Keyring (secret-tool) | secret-tool store service homelab-assist account KEY | secret-tool lookup service homelab-assist account KEY |
| Linux (headless) | pass (GPG) | pass insert homelab-assist/KEY | pass show homelab-assist/KEY |
Cross-platform alternative if you prefer one tool everywhere: the PowerShell
Microsoft.PowerShell.SecretManagement module (with SecretStore) runs on Windows/macOS/Linux.
Don't fall back to plaintext. Options, best first: install pass (GPG-encrypted, ideal for servers); use
age/sops to keep an encrypted secrets file decrypted only at runtime; or, at minimum, an .env file
chmod 600 and git-ignored — and tell the user it's the weakest option. Never commit it.
What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
5 skills in this plugin
/homelab-overviewOrientation for the homelab-assist plugin suite — what plugins and skills exist (Proxmox, Docker), how they relate, and how to route a homelab request to the right skill. Load this when the user makes a broad homelab request, when you're unsure which homelab skill applies, or when a task spans both Proxmox and Docker./homelab-researchHow to research version-correct, canonical answers for homelab software (Proxmox, Docker, Dockhand, Portainer, nginx-proxy-manager, etc.) without being misled by stale search results. Load this whenever you are not fully confident about a configuration, command, API field, or behavior before acting on a homelab system./homelab-safetyThe change-approval and SSH-confirmation policy for ALL homelab operations (Proxmox, Docker, and any other infrastructure). Load and apply this before performing any action that changes a homelab system or that requires SSH/host access. Other homelab skills defer to this policy./homelab-sshThe execution discipline and guardrails for doing ANYTHING over SSH on a homelab host (Proxmox nodes, Docker hosts, NAS, etc.). SSH is root-level power with no undo, so load this whenever a task will run shell commands or edit files on a host over SSH. Covers host-identity confirmation, read-before-write, backup/rollback, validate-before-apply, the never-without-confirmation dangerous-command list, lockout avoidance, scripting hygiene, and secret handling. Works together with homelab-safety (which governs approval) — this skill governs how the SSH work is actually carried out.npx claudepluginhub redth/homelab-assist --plugin homelab-core