D
devmaxxx/shell-secrets
Catch secrets in shell commands and AI-agent tool calls (Claude Code, Codex) before they run
View on GitHub ↗Link checked 2026-11-12 · HTTP 200 · opens the vendor's own site
Install & config
Client config (built from the install command this repo gives)
{
"mcpServers": {
"devmaxxx-shell-secrets": {
"command": "npx",
"args": ["shell-secrets"]
}
}
}Parsed from the README we fetched on 2026-10-27; we have not executed it.
command/args come from the install command the repository states. When it is ambiguous, the project README wins.
VS Code (.vscode/mcp.json - the key is servers)
{
"servers": {
"devmaxxx-shell-secrets": {
"command": "npx",
"args": ["shell-secrets"]
}
}
}Same server, but VS Code keeps it under <code>servers</code>.
Claude Code (command line)
claude mcp add --transport stdio devmaxxx-shell-secrets -- npx shell-secrets
Claude Code does not read a config file; add the server with this command.
Key names differ by client: Clients & CLI
- Star count
- 2 ★ · devmaxxx/shell-secrets · read from the GitHub search API · (checked 2026-11-13 20:00:50)
- Source
- read directly from its GitHub page · type: open-source project
- Harvest history
- first seen 2026-10-27 · last seen 2026-11-14 · seen 20× · listed by 1 sources
- Score
- score 103 · 2 ★ · 1 sources · repo
- Install
npx shell-secrets
FAQ (answers come from our records)
How do I install it?
The repository provides this install command:
npx shell-secrets. It comes from the repository itself; we cannot guarantee it runs as-is in your client.Who is it for?
We filed it under these tags: 开源项目. The tags come from the entry itself, not a taxonomy we imposed.
Who maintains it?
repository
devmaxxx/shell-secrets;first catalogued 2026-10-27;last seen 2026-11-14。There is no official certification or quality rating here — we record sources and dates only.# shell-secrets
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
Catch a secret in a shell command or an AI-agent tool call before it runs — written to a file, exported, or put in a commit message. Zero dependencies.
Install · Agent hooks · Quick start · Detected secrets · API · Recipes · Compared
Table of contents
Why
Features
Install
Agent hooks
Quick start
Detected secrets
API
findSecrets
findNewSecrets
findSecretsInCommand
onlyWritesTo
findCredentialSlots
Custom and disabled rules
Recipes
Compared with other scanners
Limits
Contributing
License
## Why
Coding agents and CI bots run shell commands, and that is where secrets leak now: echo "$KEY" > config.js, export GITHUBTOKEN=ghp… landing in a transcript, a token pasted into the message file of git commit -F msg.txt. Repository scanners like gitleaks and secretlint catch it after the fact, in files and history. Generic string scanners see the token but not what the command does with it.
findSecretsInCommand reads the command the way the shell would: it reports each secret, the variable it is exported or assigned to, the files the command writes through >, >> or tee, the message files git / gh would publish, and the files curl, scp or nc would send off the machine. It is a plain JavaScript function with no dependencies, so it fits in a pre-tool-use hook. It returns where the secret is and a masked preview, never the secret itself. findSecrets does the same for any plain string — a log line, a prompt, a staged diff.
## Features
Reads shell commands. findSecretsInCommand reports secrets assigned or exported (NAME=secret), the files a command writes through >, >> or tee, the message files git / gh would publish, and the files curl, scp or nc would send off the machine.
Built for agent tool calls. onlyWritesTo answers "does this command only write the secret into an allowed file, such as a gitignored .env?".
Catches credential slots. findCredentialSlots finds the other half of the problem: a command with a stand-in for the user to type a secret into (Authorization: Bearer , export APIKEY=your-key, --client-secret= , postgres://app: @db). The hook blocks one in a Bash call and sends back a reply that hands one to the user.
Zero runtime dependencies. ESM, fully typed, about 12 kB gzipped.
Tuned for precision. Placeholders (ghpxxxx…, , example), variable references (${DBPASSWORD}) and local dev credentials (postgres:postgres@localhost) are not reported, so a hit is worth stopping for. Classic GitHub tokens must carry a valid CRC32 checksum, so made-up ones in docs and tests pass.
Sees through base64. A blob that decodes to text, such as a Kubernetes Secret value or an echo … | base64 -d, is decoded and scanned, nested encodings included; the finding spans the encoded text.
Catches unnamed secrets too. A value under a secret-sounding name (APITOKEN=…, clientsecret: "…", --api-key …) is reported when a statistical test reads it as machine-generated, not a word, identifier, path or UUID.
Safe to log. A finding holds the rule, the offsets and a redacted preview such as ghp. It never holds the value.
Diff-aware. findNewSecrets reports only what an edit adds, not secrets the text already had.
Extensible. Add your own rules or drop built-in ones with a plain array.
Install · Agent hooks · Quick start · Detected secrets · API · Recipes · Compared
Table of contents
Why
Features
Install
Agent hooks
Quick start
Detected secrets
API
findSecrets
findNewSecrets
findSecretsInCommand
onlyWritesTo
findCredentialSlots
Custom and disabled rules
Recipes
Compared with other scanners
Limits
Contributing
License
## Why
Coding agents and CI bots run shell commands, and that is where secrets leak now: echo "$KEY" > config.js, export GITHUBTOKEN=ghp… landing in a transcript, a token pasted into the message file of git commit -F msg.txt. Repository scanners like gitleaks and secretlint catch it after the fact, in files and history. Generic string scanners see the token but not what the command does with it.
findSecretsInCommand reads the command the way the shell would: it reports each secret, the variable it is exported or assigned to, the files the command writes through >, >> or tee, the message files git / gh would publish, and the files curl, scp or nc would send off the machine. It is a plain JavaScript function with no dependencies, so it fits in a pre-tool-use hook. It returns where the secret is and a masked preview, never the secret itself. findSecrets does the same for any plain string — a log line, a prompt, a staged diff.
## Features
Reads shell commands. findSecretsInCommand reports secrets assigned or exported (NAME=secret), the files a command writes through >, >> or tee, the message files git / gh would publish, and the files curl, scp or nc would send off the machine.
Built for agent tool calls. onlyWritesTo answers "does this command only write the secret into an allowed file, such as a gitignored .env?".
Catches credential slots. findCredentialSlots finds the other half of the problem: a command with a stand-in for the user to type a secret into (Authorization: Bearer , export APIKEY=your-key, --client-secret= , postgres://app: @db). The hook blocks one in a Bash call and sends back a reply that hands one to the user.
Zero runtime dependencies. ESM, fully typed, about 12 kB gzipped.
Tuned for precision. Placeholders (ghpxxxx…, , example), variable references (${DBPASSWORD}) and local dev credentials (postgres:postgres@localhost) are not reported, so a hit is worth stopping for. Classic GitHub tokens must carry a valid CRC32 checksum, so made-up ones in docs and tests pass.
Sees through base64. A blob that decodes to text, such as a Kubernetes Secret value or an echo … | base64 -d, is decoded and scanned, nested encodings included; the finding spans the encoded text.
Catches unnamed secrets too. A value under a secret-sounding name (APITOKEN=…, clientsecret: "…", --api-key …) is reported when a statistical test reads it as machine-generated, not a word, identifier, path or UUID.
Safe to log. A finding holds the rule, the offsets and a redacted preview such as ghp. It never holds the value.
Diff-aware. findNewSecrets reports only what an edit adds, not secrets the text already had.
Extensible. Add your own rules or drop built-in ones with a plain array.
Listed badge (optional)
Copy this line into the README if you want the listing mark. Optional, and it does not affect being listed.
[](https://anclum.com/en/s/devmaxxx-shell-secrets/)
- Source
- github · https://github.com/devmaxxx/shell-secrets
- Browse by field
- Open source
- Traction
- 2 ★
- added
- today
More like this
Filed under
Every tag opens the full list for that filter. Counts are the live catalogue figures.