secret-injector
Skill1 starsChanged 4 months agoMITView on GitHub
Generate and validate an Arr-stack compose project's .env file — ensure every API key/secret required by docker-compose.yml is present, well-formed, and never logged or committed. Use when the user is setting up a stack fresh, rotating an API key, adding a new service that needs a secret, or asking "why isn't my API key being picked up". Trigger phrases: "generate the .env", "check for missing secrets", "rotate the radarr api key", "validate my env file", "is a secret leaking anywhere".
- Reads credentials
In this repository7 other files it gives its agents.
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 36
Run from the repo root (where .env and docker-compose.yml live), or pass --env-file/--compose-file.
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Secret Injector
Manages .env for a compose stack without ever printing secret values to stdout,
logs, or committing them. This skill only ever prints key names and pass/fail status —
never the value — and refuses to write a value it wasn't explicitly given (it does not
invent, guess, or default a secret).
What it does
- Required-key audit — diffs the keys actually referenced in
docker-compose.yml(${VAR}/${VAR:-default}syntax) against what's present in.env, and reports which are missing. Does not report values, only names. - Format validation — light sanity checks per known key pattern (every *arr app's
API key is 32-char lowercase hex) without needing the true value to be "correct"
beyond shape. Add more patterns to
injector.py::KEY_PATTERNSfor other secrets this project cares about checking. - Injection — writes a new key=value pair to
.env, given the value on stdin (never as a CLI argument, since CLI args land in shell history andpsoutput). - Leak scan — greps the working tree (excluding
.env/.git) for any value currently in.env, to catch an accidentally hardcoded secret before a commit.
Usage
python3 injector.py audit # missing keys vs docker-compose.yml
python3 injector.py validate # format-check keys already present
echo -n "abc123..." | python3 injector.py set RADARR_API_KEY # write a value from stdin only
python3 injector.py leak-scan # scan repo for any .env value appearing elsewhereRun from the repo root (where .env and docker-compose.yml live), or pass
--env-file/--compose-file.
Safety rules
- Never accept a secret value as a bare CLI argument —
setonly reads from stdin, specifically to avoid the value landing in shell history orps auxoutput. - Never print a secret value in any command's output, including error messages — only key names and boolean/status results.
seton an existing key requires--force; without it the script refuses to silently overwrite a live credential (rotation should be a deliberate, visible action).leak-scanoutput redacts the matched value itself, showing only the file/line where a match was found — enough to locate and fix it without re-printing the secret.- This skill never commits
.envand never suggests doing so;.envmust stay in.gitignore. If asked to "just commit the env file", refuse and explain why.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

