PromptGuard CLI
The PromptGuard CLI is a production-ready command-line tool that automatically configures your applications to route LLM requests through PromptGuard’s security proxy.Built with Rust + Tree-sitter
Real AST transformations - never breaks your code. Single 5.3MB binary with zero runtime dependencies.
Why Use the CLI?
Zero Code Changes
Automatically modifies SDK initialization - no manual code rewriting required
Safe Transformations
Uses Tree-sitter AST parsing instead of regex. Preserves formatting and never breaks code.
Instant Setup
Configure your entire project in seconds with a single command
Easy Revert
Automatic backups let you revert changes anytime with one command
Quick Example
What It Does
The CLI automatically transforms your code from:Features
- ✅ Real AST Transformations - Tree-sitter based parsing and modification
- ✅ Multi-Language Support - TypeScript, JavaScript, Python
- ✅ 4 LLM Providers - OpenAI, Anthropic, Cohere, HuggingFace
- ✅ Automatic Backups - Safe revert with one command
- ✅ Configuration Management - Enable/disable without deleting config
- ✅ Zero Dependencies - Single static binary, no runtime requirements
Supported Platforms
- macOS ARM64 (M1/M2/M3)
- macOS x86_64 (Intel)
- Linux x86_64
- Linux ARM64
Commands
| Command | Description |
|---|---|
init | Initialize PromptGuard in your project |
scan | Scan for LLM SDK usage (dry-run) |
status | Show current configuration status |
apply | Re-apply transformations |
disable | Temporarily disable (restore originals) |
enable | Re-enable (re-apply transformations) |
revert | Completely remove PromptGuard |
config | View configuration details |
key | Manage API keys |
logs | View activity logs |
test | Test configuration |
update | Check for updates |
Architecture
The CLI follows a clean architecture with proper separation of concerns:Next Steps
Installation
Install the CLI on your system
Quick Start
Get started in 60 seconds
Commands
Complete command reference
Configuration
Advanced configuration options
Open Source
The PromptGuard CLI is open source and built with:- Rust - Fast, safe, and reliable
- Tree-sitter - Industry-standard AST parsing
- Clap - Modern CLI framework
- Cargo - Rust build system