/agents-cli:secrets [create|add|list|view|import|export|rotate|generate]from agents-cli
Manage named bundles of environment variables backed by the OS keychain (macOS Keychain, Linux libsecret, Windows Credential Manager). Create bundles, add secrets, generate passwords, and inject them into agent runs.
Ships in agents-cli. 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.
Store credentials in the OS keychain and inject them into agent runs. The engine is the standalone secrets CLI (@phnx-labs/secrets-cli); call it directly. agents secrets was removed, and agi-cli does not ship the engine. agents-cli's part is agents run --secrets <bundle>, which injects a bundle into the agent it launches.
agents clis install secrets
# or: npm i -g @phnx-labs/[email protected]
# or: agents setup secrets
No extra environment variables. After install, secrets --version prints 0.1.8 (the pin in cli/src/lib/secrets-cli.ts).
The macOS broker is secrets _agent-run, not agents daemon. Socket: $SECRETS_HOME/.cache/helpers/secrets-agent/.
Store credentials in your OS keychain and inject them into agent runs. Nothing touches disk in plaintext — not even the bundle metadata.
| Platform | Backend | Install |
|---|---|---|
| macOS | Keychain | Built-in |
| Linux (desktop) | GNOME Keyring (libsecret) | sudo apt install libsecret-tools |
| Linux (headless/server) | Use env: refs | See below |
| Windows | Credential Manager (primary) + encrypted-file fallback | Built-in |
Desktop Linux: GNOME Keyring (or another Secret Service provider) must be running. Most desktop environments start it automatically.
Headless Windows (service accounts, SSH with no interactive logon): Credential Manager needs a logon session; without one it fails with ERROR_NO_SUCH_LOGON_SESSION (1312) and secrets transparently route to the AES-256-GCM encrypted-file store. Set AGENTS_SECRETS_PASSPHRASE so that store has an off-disk key — otherwise a machine-local key is provisioned next to the ciphertext.
Headless Linux (SSH, CI, containers): No keyring daemon available. Use env: refs to pass secrets via environment:
# Create bundle with env refs
secrets create prod
secrets add prod DB_PASSWORD --env DB_PASSWORD
# Pass at runtime
DB_PASSWORD=xxx agents run claude "..." --secrets prod
1Password is already supported (import --from 1password:<vault>, export --to-1password) — see below. AWS Secrets Manager and HashiCorp Vault providers remain planned.
Environment variables in .zshrc: The agent inherits your entire environment. You can't scope what it sees — it gets everything, including keys for services it doesn't need. And they're plaintext on disk.
1Password / iCloud Passwords: Designed for humans, not agents. They require interactive authentication (biometrics, master password). An agent can't programmatically fetch or store credentials without you approving each access. And they can't write — if an agent generates a new API key, it can't save it back.
secrets: Scoped bundles (agent only sees what you pass), OS keychain-backed (encrypted at rest), and agent-friendly (agents can read and write programmatically).
Create a bundle, add your keys, then pass the bundle when running agents:
secrets create prod
secrets add prod STRIPE_API_KEY # prompts for value
secrets add prod DATABASE_URL
agents run claude "deploy the api" --secrets prod
The secrets inject as environment variables at runtime.
Pipe it via stdin so it never appears in shell history:
echo "$NEW_API_KEY" | secrets add prod STRIPE_KEY --value-stdin
secrets generate --copy # copies to clipboard, prints nothing
Move a bundle between machines with push/pull — it's encrypted, uploaded to
api.phoenix.so, and decrypted back into the local keychain/file store on the
other end:
# On one machine:
secrets create work
secrets add work SOME_KEY
secrets push work
# On another machine:
secrets pull work # work now exists locally too
A bundle created with --synced instead stores it in an age-encrypted local
file ($SECRETS_HOME/vault.age) that you sync yourself (e.g. via a synced
folder) rather than through api.phoenix.so.
Add metadata when storing secrets:
secrets add prod STRIPE_KEY --type api-key --expires 2027-12-31 --note "Live key, rotate annually"
The list command shows secrets expiring in the next 30 days. Expired secrets show in red.
For browser logins, name the bundle after the domain — x.com, linkedin.com, reddit.com — and group keys by account handle. One bundle per site, any number of accounts inside. Every account carries a --note saying when to use it:
secrets create x.com --description "X/Twitter accounts. Read key notes to pick the right one."
secrets add x.com ZEFFMUKS_USERNAME --value zeffmuks \
--note "Personal account. Casual engagement, memes."
secrets add x.com ZEFFMUKS_PASSWORD --type password \
--note "Password for @zeffmuks"
secrets add x.com SOCIAL_GETRUSH_USERNAME --value [email protected] \
--note "Official Rush brand account. Product marketing, announcements, replies as Rush."
secrets add x.com SOCIAL_GETRUSH_PASSWORD --type password \
--note "Password for [email protected]"
Key naming: uppercase the handle, replace non-alphanumerics with _, suffix with _USERNAME / _PASSWORD (plus _TOTP_SECRET if the account has 2FA).
To pick an account, run secrets view x.com — notes print in the clear while values stay masked, so you can read the key names and choose the right account without seeing any value. Then inject just that pair into the command that needs it — never print it:
secrets view x.com # read notes, choose the account
secrets exec x.com --keys SOCIAL_GETRUSH_USERNAME,SOCIAL_GETRUSH_PASSWORD -- ./login-helper
secrets import prod --from .env.prod
Every key goes into Keychain. The same --from axis imports from other
sources: --from 1password:<vault> (needs the op CLI) and --from icloud.
secrets list can't see it"Bundles from the pre-biometry era live in the iCloud Keychain and are invisible to every modern query. Recover them (macOS):
secrets import --from icloud # interactive multi-select
secrets import <bundle> --from icloud # one specific bundle
secrets import --from icloud --purge # also delete the iCloud copies
Secrets can be dynamic references, not just static values:
secrets add prod AWS_TOKEN --exec "aws sts get-session-token --query Credentials.SessionToken"
secrets add prod CERT --file /path/to/cert.pem
secrets add prod LOG_LEVEL --env LOG_LEVEL
(Exec refs require creating the bundle with --allow-exec.)
macOS prompts Touch ID per bundle, per process, so running several agents at once (agents teams, parallel agents run --secrets) re-prompts once each. There's no OS setting to quiet it — but the secrets-agent does (macOS only):
secrets unlock prod # one Touch ID; held ~7 days (default)
agents teams start my-feature # every teammate reads prod silently
secrets status # what's held, and when it locks
secrets lock # wipe it; next read re-prompts
unlock reads the bundle once and keeps the resolved values in a local broker behind a user-only socket; later runs read from memory with no prompt. The hold ends on its TTL (default 7 days, --ttl 30m to shorten), when you lock, or when the machine sleeps / you log out. A bare screen-lock does NOT drop the hold (it's already gated by the login session). Nothing is written to disk.
On a locked keychain bundle:
| You run | Touch ID? |
|---|---|
secrets list, secrets view (no --reveal) | never — metadata / masked values only |
secrets view --reveal, secrets exec at your terminal, outside an agent session | one sheet, then reveals / runs (a deliberate human reveal/run) |
secrets get <item>, secrets export (--to-file / --to-1password) | never — automation primitives; fail fast to secrets unlock instead. export with no destination flag refuses outright and names exec / view --reveal; the raw-item get <item> stays available everywhere (shell hooks inside agent sessions depend on it — a single ad-hoc token is the accepted narrower residual) |
secrets unlock | one sheet — the deliberate unlock |
anything an agent launches (AGENTS_RUNTIME) or any no-TTY context | never — resolves broker-only, fails fast if not held |
| anything on an already-unlocked bundle | never — served from the broker |
So a sheet only ever appears for a deliberate human action (unlock, or a view --reveal / exec you type) on a locked bundle. get/export stay silent so they never block a script mid-pipeline — export now also refuses without a real destination (--host / --to-1password / --to-file), so it never prints a bundle to stdout.
For a machine running lots of agents, run secrets start once to bring the broker up ahead of time, so a cold-started broker can't get starved under load. secrets status shows what's held and when it locks.
You usually don't need unlock at all — a bundle's default prompt policy is
hold (ask once per hold window, secrets.agent.holdMs — 7d by default), so the
FIRST read of a run already populates the broker and every read after that in
the same window is silent:
secrets policy prod # show the current policy
secrets policy prod always # switch to "ask every time" instead
always re-prompts on every read — reach for it on a high-value bundle where
every access should be confirmed. never is silent with NO biometry ACL at
all (--i-understand required to create one) — never put a high-value secret
there. While a bundle is held, any process running as you can read it from the
socket without a prompt; that's the trade-off, so keep hold windows short and
lock when you step away.
Every create / import / export / view / access / unlock is recorded value-free (bundle name, event kind, count, agent — never a value) through one chokepoint, and surfaced three ways:
secrets view stripe.com # usage summary + held state + per-agent
secrets list --sort uses # most-accessed bundles first
secrets list --sort used # most-recently-used first
secrets activity stripe.com # recent event timeline (last 90 days)
secrets view prints e.g. usage: accessed 42× (last 2h ago) · exported 3× (last 1d ago). The full audit trail is agents events --module secrets. Disable recording
with AGENTS_NO_USAGE_TRACK=1.
Name it after what it holds, so an agent can guess it without listing — a website by its
domain with the real suffix (stripe.com, openai.ai, github.com), a desktop app by
its binary suffix (slack.app, photoshop.exe). Always pass --description; an
undescribed bundle prints a "No description found" nudge in list / view / create.
secrets create stripe.com --description "Stripe live + test API keys"
Run secrets --help — there's more: viewing/revealing values, rotating secrets with preserved metadata, exporting to shell, organizing by environment or service.
What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub phnx-labs/agi-cli --plugin agents-cli8 skills in this plugin
/agents-cliRun and manage many AI coding agents (Claude Code, Codex, Cursor, Gemini/Antigravity, Grok, Kimi, OpenCode, Droid, …) from one CLI — the `agents` command. Use this to run multiple coding agents in parallel, manage multiple Claude Code accounts, keep working when I hit my usage limit, resume a session on another machine, or pin the agent CLI version. Triggers on: run multiple coding agents in parallel, manage multiple Claude Code accounts, I hit my usage limit, resume a session on another machine, pin the agent CLI version./browserDrive a browser via CDP — navigate, click, type, screenshot. Profiles persist login state across sessions, so agents log in once and stay authenticated. Triggers on: 'automate a website', 'browser automation', 'click', 'screenshot', 'scrape', 'log in', 'fill form'./devicesRegister and connect to your machines over Tailscale SSH with agents-cli. Use this skill to sync devices from the tailnet, list them, open a shell on another machine, or see agent sessions running across your whole fleet./runExecute a single agent headlessly or interactively. Supports plan/edit/auto/skip modes, secrets bundle injection, version pinning, fallback chains, balanced rotation, profile dispatch (Kimi/DeepSeek/etc.), and workflow dispatch by name. Triggers on: 'run claude', 'run codex', 'agents run', 'dispatch an agent', 'headless agent', 'one-off agent task'./sessionsSearch, browse, and read agent conversation transcripts across Claude, Codex, Gemini, and OpenCode. Use this skill to find previous sessions, recover context, or inspect what agents have done./teamsOrganize AI coding agents into teams that collaborate on a shared task. Create teams, add teammates, start them, monitor progress, and collect results. Use this skill when you need parallel agent execution. For single-agent dispatch, use `agents run` instead.Other plugins' skills for the same job