Run secret scanning before sharing your project code
A credential can end up in source code, registry settings, agent instructions or configuration files. Review a matching string before deciding it's a real secret.
npm install --save-dev @sitecmd/cli
npx sitecmd audit .
The CLI runs on your computer or in your CI, and your code stays there.
What it finds on a demo project
The CLI looks for values that resemble credentials in source, AI and MCP config and agent instruction files, tokens written into .npmrc, .env files that .gitignore doesn't cover, and names that suggest secrets in browser-public variables. It reads the files in your checkout, not your Git history.
SiteCMD CLI 2.0.0
Demo project: Secrets in code and config
npx sitecmd audit .
SiteCMD Code Scan - .
Checked: November 9, 2026
Framework: Express
Issues: 6 total | critical 0 | high 5 | medium 1 | low 0
High (5)
- [Dependencies · supply-chain] AI or MCP config may contain a hardcoded credential - .claude/settings.json:3
- [AI Setup · ai-scaffolding] Credential-shaped literal in .mcp.json - .mcp.json:6
- [Dependencies · supply-chain] Project .npmrc contains a literal registry auth value - .npmrc:1
- [Security · security] Source file contains a credential-shaped literal - src/index.js:4
- [Security · security] Possible sensitive credential uses a client-public environment name - web/client.js:1
Medium (1)
- [Security · security] .gitignore does not cover environment files present in the project - .gitignore
Your code passes? Now watch your site.
Add .env to .gitignore and untrack a committed copy
Keep local credential files out of future commits. An ignore rule doesn't remove a file Git already tracks, so check that separately. GitHub's sensitive-data guidance explains the cleanup decisions.
Review NEXT_PUBLIC environment variables for sensitive values
Next.js can replace a direct reference to a NEXT_PUBLIC_ variable with its build-time value in browser JavaScript. Make sure that value is meant to be public. Next.js documents the substitution.
Frequently asked questions
Should I remove .env from Git history before rotating a secret?
Revoke or rotate an exposed credential first. Then decide whether you still need to rewrite history; doing so can affect existing clones and collaboration.
Review package credentials and agent instruction files
Website security
Catch leaked API keys and exposed files before someone uses them against you.
npm supply chain security
Watch for look-alike package names, weak lockfiles and missing release delays.
AGENTS.md
Keep one clear, secret-free set of instructions for coding agents.
How API keys end up in your client bundle
Why secrets reach public JavaScript bundles, how to grep a built bundle for them, and what to do in the right order after one has already shipped.