@ghostbuster/cli
v0.1.1
Published
Production-grade CLI for auditing AI prompts. Detects invisible characters, homoglyph attacks, and adversarial Unicode poisoning in your development workflow.
Maintainers
Readme
@promptshield/cli
production-grade CLI for auditing AI prompts. Detects invisible characters, homoglyph attacks, and adversarial Unicode poisoning in your development workflow.
✨ Features
- CI/CD Ready: Exit codes for passing/failing builds based on threat severity.
- Scanning: Detect invisible characters, BIDI overrides, and homoglyphs.
- Sanitization: Automatically strip dangerous characters (where safe).
- Configuration: Support for
.promptshieldrcand.promptignore. - JSON Output: Machine-readable reports for dashboard integration.
📦 Installation
[!TIP] This package (@ghostbuster/cli) is an official alias of @promptshield/cli.
We provide this package to offer shorter import paths and improved discoverability. While both packages provide identical functionality, @promptshield/cli is the primary source of truth.
- Use @ghostbuster/cli if you prefer the shorter name or specific branding or ESM Only.
- Use @promptshield/cli for the most stable long-term reference and standard alignment.
| Feature | @promptshield/cli | @ghostbuster/cli | | --- | --- | --- | | Source Code | ✅ Primary | 🔗 Proxy | | Updates | Immediate | Synchronized (Immediately) | | Bundle Size | 100% | 100% (Zero overhead) | | Format | ESM + CJS | ESM Only | | Maintenance | ✅ Primary | 🔗 Proxy (inherits) | | Security | ✅ Primary | 🔗 Proxy (inherits) |
Security: Security audits are performed on the canonical package; this alias inherits all security patches automatically.
$ pnpm install -g @promptshield/cli
# Project dependency
$ pnpm add -D @promptshield/cli🚀 Usage
Basic Scan
Scan all files in the current directory (respects .gitignore and .promptignore).
$ promptshield scanScan specific files or globs:
$ promptshield scan "prompts/**/*.txt" "src/**/*.ts"Options
| Option | Description |
| :---------------- | :------------------------------------------------------------- |
| --check | Fail (exit code 1) on the first detected threat. Ideal for CI. |
| --json | Output results in JSON format. |
| --strict | Enable stricter sanitization rules. |
| --write | Write fixes to disk (used with fix or sanitize). |
| --config <file> | Path to a specific config file. |
| --init | Generate a default configuration file. |
Commands
scan
Analyzes files for threats without modifying them.
$ promptshield scan --json > report.jsonfix
Applies safe automatic fixes to files.
$ promptshield fix --writesanitize
Aggressively cleans text content (may be destructive for some binary/encoded data).
$ promptshield sanitize --write⚙️ Configuration
Create a promptshield.config.json (or use --init):
{
"minSeverity": "HIGH",
"disableHomoglyphs": false,
"exclude": ["**/node_modules/**", "**/*.min.js"]
}📚 Deep Dives: For comprehensive explanation of commands and config schemas, see the Documentation section.
License
This library is licensed under the MIT open-source license.
