Keychain token
Nine production Claude Code skills and one command pack: repo security scanning, LLM-output validators, agent-fleet guardrails, credential hygiene. Deterministic cores, agentic edges.
npx -y skills add arkaigrowth/agent-skills --skill keychain-tokenAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
2 things to look at
- 17 days oldThe repository was created 17 days ago. New is not bad, but a brand new repository carrying a familiar-sounding name is the shape a typosquat arrives in, and there has been no time for anyone else to find a problem with it.
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Store, name, retrieve, and rotate API tokens/secrets in the macOS Keychain safely. Use whenever the user gets a new API token/key/secret, asks how to store or name a credential, needs the paste-to-keychain one-liner, or asks to read a stored token into a script. Covers the consumer-scope-purpose naming convention, fish and bash variants, and the never-echo rules.
SKILL.md
4.3 KB, as published. Nobody here has run it
Keychain token storage
One canonical pattern for getting a secret from a clipboard into the macOS login Keychain without it touching shell history, scrollback, or an agent's context, plus a naming scheme that lets you find it again a year later.
macOS only: this relies on the security command and the login Keychain.
Naming convention (decide BEFORE storing)
<consumer>-<scope>-<purpose>, naming the token for the MACHINE that uses it,
never the human who made it. Test: reading only the name, you know what breaks
if you revoke it.
| Piece | Examples |
|---|---|
| consumer | gha (GitHub Actions), codex, claude, n8n, cron |
| scope | acme-prod, acme-billing, internal |
| purpose | deploy, readonly, api, webhook |
Examples: gha-acme-prod-deploy, cron-acme-billing-readonly.
Use the SAME string for the Keychain service (-s) and label (-l).
Store (interactive paste, nothing echoed)
Fill in: NAME (per convention), ACCOUNT (owning identity or org, e.g.
acme, [email protected]), KIND (human-readable type, e.g. "Vercel API
token").
fish:
read -s -P "Paste NAME token: " TOK; and security add-generic-password -U -a ACCOUNT -s NAME -l NAME -D "KIND" -w "$TOK"; and set -e TOK
bash/zsh:
read -rs -p "Paste NAME token: " TOK && security add-generic-password -U -a ACCOUNT -s NAME -l NAME -D "KIND" -w "$TOK"; unset TOK
Notes: -U updates in place if the entry exists (this is also the rotation
command); read -s keeps the paste out of the terminal and history; the
trailing set -e/unset clears the env var immediately.
Alternative with no shell variable at all (Keychain prompts you):
security add-generic-password -U -a ACCOUNT -s NAME -l NAME -D "KIND" -w
Retrieve (in scripts)
TOK=$(security find-generic-password -s NAME -w)
Prefer lookup by service (-s). If an entry was renamed in the Keychain
Access GUI, only its LABEL changed, so fall back to -l NAME.
Verify it stored (without printing the secret)
security find-generic-password -s NAME | grep -E '"svce"|"acct"|"labl"'
Helper scripts
scripts/kc-store and scripts/kc-get wrap the two commands above with a
defined exit-code contract, so scripts and CI can branch on failure instead of
parsing text. The secret goes in on stdin (kc-store) and comes out on stdout
(kc-get); neither is ever a command-line argument to the wrapper.
printf '%s' "$TOKEN" | scripts/kc-store gha-acme-prod-deploy acme "Vercel API token"
TOKEN=$(scripts/kc-get gha-acme-prod-deploy)
See README.md for the full exit-code table.
Auth browser launches (provenance note)
When a stored token belongs to an OAuth or consent flow, do not blindly
open the consent URL from an automated session. With several agent sessions
running at once, an unlabeled auth tab is hard to trace back to the process
that spawned it. Announce in the terminal which session and purpose is opening
a tab before triggering it, or route the URL through your own click-to-confirm
launcher so a human approves each one. Browser launches made internally by a
binary cannot be intercepted; for those, announce before triggering.
Rules (non-negotiable)
- NEVER echo, print, or log the secret; never pass it as a visible CLI arg
in a command an agent composes. Agents: have the USER run the store
command; scripts read via
find-generic-password(orkc-get) at runtime. - No
set -xanywhere near these commands. - One entry per token. Rotation = same command with
-U, new value. - Person-named tokens are banned for CI/automation.
- When a token is revoked upstream, delete the entry:
security delete-generic-password -s NAME.
Drift control
If you symlink this skill into more than one agent home (for example a Claude Code skills directory and a Codex skills directory), keep ONE canonical copy and point the others at it with directory symlinks. Edit only the canonical copy so the variants never drift apart.