npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@healerlab/codeguard-cli

v1.0.3

Published

CLI to setup CodeGuard rules

Downloads

336

Readme

🛡️ CodeGuard CLI

A command-line tool to easily set up CodeGuard security rules for your AI coding assistants (Cursor, Claude, VSCode with Copilot).

📋 Table of Contents

✨ Features

  • 🚀 Quick Setup - Set up CodeGuard security rules in seconds
  • 🎯 Multi-Platform Support - Works with Cursor, Claude, and VSCode with Copilot
  • 🔒 Secure by Default - Built with security best practices
  • 📦 Zero Configuration - No config files needed
  • 🛡️ Path Traversal Protection - Secure file operations
  • 📝 Smart File Handling - Automatically creates copies if files already exist

📦 Installation

Global Installation (Recommended)

npm install -g @healerlab/codeguard-cli

Local Installation

npm install @healerlab/codeguard-cli

Using npx (No Installation Required)

npx @healerlab/codeguard-cli

🚀 Usage

Basic Usage

  1. Navigate to your project directory:

    cd /path/to/your/project
  2. Run the CLI:

    codeguard-cli

    Or if installed locally:

    npx codeguard-cli
  3. Select your AI assistant:

    • Cursor - Sets up rules in .cursor/ directory
    • Claude - Sets up rules in .claude/ directory
    • VSCode with Copilot - Sets up rules in .github/ directory
  4. Done! CodeGuard rules are now set up in your project.

Example

$ cd my-awesome-project
$ codeguard-cli

Welcome to CodeGuard CLI Setup!

? Which AI Assistant do you want to setup CodeGuard for? (Use arrow keys)
❯ Cursor
  Claude
  VSCode with Copilot

Setting up rules for Cursor...

Created codeguard-backend.mdc
Created codeguard-core.mdc
Created codeguard-frontend.mdc
Created codeguard-devops.mdc
Created codeguard-mobile.mdc
Created codeguard-embedded.mdc
Created codeguard-frameworks.mdc
Created codeguard-commands.mdc
Created guard-audit.md
Created guard-fix.md
Created guard-test.md

Setup completed successfully! 🚀

🛡️ What is CodeGuard?

CodeGuard is a comprehensive security framework that helps AI coding assistants generate secure code by default. It includes:

Security Protocols

  • Backend Security - SQL Injection prevention, IDOR protection, authentication best practices, SSRF prevention
  • Frontend Security - XSS prevention, CSP headers, secure storage, clickjacking protection
  • Mobile Security - Secure storage (Keychain/Keystore), SSL pinning, biometric authentication, OWASP MASVS compliance
  • DevOps Security - Container security, Kubernetes hardening, CI/CD security, supply chain protection
  • Core Security - Secrets detection, PII protection, cryptography standards, logging best practices
  • Embedded/C/C++ Security - Buffer overflow prevention, unsafe function replacement, compiler hardening flags
  • Framework Security - Django, Rails, Laravel, Node.js, .NET, Java specific security rules

Security Rule Files

| File | Description | Coverage | |------|-------------|----------| | codeguard-backend.mdc | Backend security protocols | SQL Injection, IDOR, SSRF, Authentication, Deserialization | | codeguard-core.mdc | Core security fundamentals | Secrets detection, PII protection, Cryptography standards | | codeguard-frontend.mdc | Frontend security | XSS prevention, CSP, Secure storage, Clickjacking | | codeguard-devops.mdc | DevOps & Infrastructure | Docker security, Kubernetes, CI/CD, Supply chain | | codeguard-mobile.mdc | Mobile app security | iOS Keychain, Android Keystore, SSL Pinning, OWASP MASVS | | codeguard-embedded.mdc | Embedded/C/C++ security | Buffer overflow prevention, Unsafe functions, Compiler flags | | codeguard-frameworks.mdc | Framework-specific rules | Django, Rails, Laravel, Node.js, .NET, Java | | codeguard-commands.mdc | Interactive commands guide | /guard-audit, /guard-fix, /guard-test usage |

Interactive Commands

  • /guard-audit - Perform security audit on your code
  • /guard-fix - Auto-repair security vulnerabilities
  • /guard-test - Generate security penetration tests

🔒 Security

This CLI tool is built with security best practices:

  • Path Traversal Protection - All file operations validate paths
  • Input Validation - Directory and file paths are validated before operations
  • Error Handling - Secure error messages prevent information disclosure
  • Permission Checks - Validates write permissions before file operations

Security Features

  • Path resolution and validation
  • Directory existence and permission checks
  • Secure file copying with path traversal prevention
  • Environment-based error logging

📋 Requirements

  • Node.js >= 14.0.0
  • npm >= 6.0.0

🔧 Troubleshooting

Permission Denied Error

If you encounter permission errors:

# Check directory permissions
ls -la /path/to/your/project

# Ensure you have write permissions
chmod u+w /path/to/your/project

File Already Exists

If configuration files already exist, the CLI will automatically create copies with _COPY suffix:

File existing. Created copy codeguard-backend_COPY.mdc

Installation Issues

If you have issues installing globally:

# Use sudo on Linux/Mac (if needed)
sudo npm install -g @healerlab/codeguard-cli

# Or install locally
npm install @healerlab/codeguard-cli

Node.js Version

Ensure you're using Node.js 14 or higher:

node --version  # Should be >= 14.0.0

📁 Project Structure

After running the CLI, your project will have:

your-project/
├── .cursor/              # For Cursor AI
│   ├── rules/
│   │   ├── codeguard-backend.mdc      # Backend security (SQLi, IDOR, Auth)
│   │   ├── codeguard-core.mdc         # Core security (Secrets, PII, Crypto)
│   │   ├── codeguard-frontend.mdc     # Frontend security (XSS, CSP)
│   │   ├── codeguard-devops.mdc       # DevOps security (Docker, K8s, CI/CD)
│   │   ├── codeguard-mobile.mdc       # Mobile security (iOS, Android)
│   │   ├── codeguard-embedded.mdc     # Embedded/C/C++ security
│   │   ├── codeguard-frameworks.mdc   # Framework-specific security
│   │   └── codeguard-commands.mdc     # Interactive commands documentation
│   └── commands/
│       ├── guard-audit.md             # Security audit command
│       ├── guard-fix.md                # Auto-fix vulnerabilities command
│       └── guard-test.md              # Security testing command
├── .claude/              # For Claude AI
│   ├── CLAUDE.md                      # Claude-specific instructions
│   └── rules/
│       ├── codeguard-backend.mdc
│       ├── codeguard-core.mdc
│       ├── codeguard-frontend.mdc
│       ├── codeguard-devops.mdc
│       ├── codeguard-mobile.mdc
│       ├── codeguard-embedded.mdc
│       ├── codeguard-frameworks.mdc
│       └── codeguard-commands.mdc
└── .github/              # For VSCode with Copilot
    ├── copilot-instructions.md        # Copilot-specific instructions
    └── rules/
        ├── codeguard-backend.md
        ├── codeguard-core.md
        ├── codeguard-frontend.md
        ├── codeguard-devops.md
        ├── codeguard-mobile.md
        ├── codeguard-embedded.md
        ├── codeguard-frameworks.md
        └── codeguard-commands.md

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

📄 License

This project is licensed under the ISC License.

🙏 Acknowledgments

  • Built with security best practices
  • Inspired by OWASP Top 10 and security frameworks
  • Designed for modern AI coding assistants

📞 Support

For issues, questions, or contributions, please open an issue on the GitHub repository.


Made with 🛡️ by Healer