Set up a service's credentials (PyPI, Stripe, an API, a host…): the token in Bitwarden if the machine has `secrets`, else `.<service>/token` (chmod 600), its scope in `.<service>/config`, one command pasting it unseen. Use when a task needs an API key or token, or the user wants to give one.
4 stars
0 votes
0 copies
0 views
Added November 7, 2026
developmentshellgitapi
Works with
claude code
terminal
api
Security analysis
B75/100
criticalSends environment variables or credentials to an external URL
Installs into .claude/skills of the current project.
Sponsors
SSkills DirectorySkills Directory
Know which skills are safe — weekly.
SSkills DirectorySkills Directory
Is that skill safe to install?
Are you the author of Token?
Add the live security badge to your README. It updates with every re-scan.
[](https://www.skillsdirectory.com/skills/antoine-tena-token-5026855e)
---
name: token
description: Set up a service's credentials (PyPI, Stripe, an API, a host…): the token in Bitwarden if the machine has `secrets`, else `.<service>/token` (chmod 600), its scope in `.<service>/config`, one command pasting it unseen. Use when a task needs an API key or token, or the user wants to give one.
argument-hint: "<service> [what the token is for]"
---
Service: the first word of `$ARGUMENTS` (lowercase, e.g. `pypi`); the rest says what the token
is for. The user always pastes the secret themselves: never ask them to type it in the
conversation, never read it back, never print it, never commit it.
1. At the repo root (`git rev-parse --show-toplevel` of the main tree, not of a worktree), create
`.<service>/` and add `.<service>/` to `.git/info/exclude` if it is not there; check with
`git check-ignore -q .<service>/config`.
2. Write `.<service>/config`: `key=value` lines, with comments that say what the token is for,
the scope to choose when creating it (as narrow as possible) and where it is used (a GitHub
secret, an env variable…) and how to read it (`# Secrets : secrets get <repo>/.<service>/token`
when the machine has `secrets`). Keep an existing `config`: complete it, don't overwrite it.
3. Give the direct link of the page that creates the token (e.g.
https://pypi.org/manage/account/token/), the scope to pick, then this command, to run in
their own terminal (not with Claude Code's `!`: it waits for keyboard input):
read -rs -p "<Service> token: " t && printf '%s' "$t" > <root>/.<service>/token && chmod 600 <root>/.<service>/token && unset t && echo " ok"
Nothing shows while pasting: the token stays hidden and out of the shell history. When the
machine has the `secrets` command (`command -v secrets`), append
`&& cd <root> && secrets push .<service>/token && rm .<service>/token`: Bitwarden keeps the
only copy.
4. When they say it is done: check that it exists without displaying it - in Bitwarden
(`secrets list` names it), else the file is not empty and is `600` (`stat -c %a`). Then use it
only inside the command that needs it: `$(secrets get <repo>/.<service>/token)`, else
`$(cat <root>/.<service>/token)`; `gh secret set <NAME>` reads either on its standard input.