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

@airuleshub/cli

v3.0.3

Published

Install AI rules from airuleshub.com into your AI agent config files

Downloads

865

Readme

@airuleshub/cli

Install AI rules from airuleshub.com directly into your AI agent config files.

npm


Quick Start

# Install a single rule
npx @airuleshub/cli add nextjs-clean-arch

# Install multiple rules at once  ✨ new in v3
npx @airuleshub/cli add nextjs-clean-arch strict-react-typescript-rules postgresql-drizzle-performance-rules

The CLI will:

  1. Fetch the rule(s) from airuleshub.com in a single batch request
  2. Auto-detect your AI agents (Cursor, Claude Code, Windsurf, etc.)
  3. Show an interactive multi-select prompt — once for all rules
  4. Install each rule into the correct config file for each selected agent

Commands

add <slugs...> (recommended)

Agent-aware installation with interactive agent selection. Accepts one or more rule slugs.

npx @airuleshub/cli add <slug> [slug2 slug3 ...] [options]

Options:

| Flag | Description | | --------------------- | ------------------------------------------------------- | | --agent <ids> | Comma-separated agent IDs to install into (skip prompt) | | -y, --yes | Skip all prompts, overwrite automatically (CI mode) | | --dry-run | Preview what would be installed without writing files | | -f, --format <type> | File format: md | json | yaml (default: md) | | --cwd <path> | Working directory (default: current directory) |

Examples:

# Interactive — auto-detects your agents
npx @airuleshub/cli add nextjs-clean-arch

# Multiple rules in one command
npx @airuleshub/cli add nextjs-clean-arch strict-react-typescript-rules

# Target specific agents
npx @airuleshub/cli add nextjs-clean-arch --agent cursor,claude

# Multiple rules into specific agents
npx @airuleshub/cli add rule-a rule-b --agent cursor,claude,windsurf

# CI mode — no prompts, auto-overwrite
npx @airuleshub/cli add nextjs-clean-arch --yes --agent cursor

# Preview only (no files written)
npx @airuleshub/cli add nextjs-clean-arch rule-b --dry-run

install [slugs...] (legacy — backward compatible)

Installs rules into the legacy ./airules directory:

npx @airuleshub/cli install nextjs-clean-arch

Supported Agents

| Agent ID | Display Name | Install Path (single rule) | | ----------- | --------------- | --------------------------------- | | cursor | Cursor | .cursor/.cursorrules | | claude | Claude Code | .claude/CLAUDE.md | | windsurf | Windsurf | .windsurf/windsurfrules.md | | vscode | VS Code Copilot | .vscode/ai-rules.md | | copilot | GitHub Copilot | .github/copilot-instructions.md | | jetbrains | JetBrains AI | .idea/ai-rules.md | | zed | Zed AI | .zed/ai-rules.md | | neovim | Neovim AI | .config/nvim/ai-rules.md | | continue | Continue.dev | .continue/config.json | | gemini | Gemini CLI | .gemini/gemini-rules.md | | codeium | Codeium | .codeium/rules.md | | tabnine | Tabnine | .tabnine/ai-rules.md | | qoder | Qoder | .qoder/rules.md | | roo | Roo Code | .roo/rules.md | | opencode | OpenCode | .opencode/rules.md | | kilocode | Kilo Code | .kilocode/rules.md | | trae | Trae | .trae/rules.md | | adal | Adal | .adal/rules.md | | skills | Agent Skills | .agents/skills/<slug>.md |

Note: When installing multiple rules, each rule gets its own slug-named file per agent (e.g. .cursor/rule-name.md) so rules never overwrite each other.


UX Flow

Agent Auto-Detection

The CLI scans your project for known agent configuration directories:

  • 1 agent detected → Confirms with a single Y/n prompt, then installs
  • Multiple detected → Shows multi-select with detected agents pre-selected
  • None detected → Shows full registry list for manual selection

Agent selection is always asked once, regardless of how many rules you're installing.

Single Rule — File Already Exists

When the target config file already exists you'll see a full prompt:

⚠ File exists: .cursor/.cursorrules

❯ Overwrite
  Backup & Replace        ← saves .cursorrules.bak-YYYYMMDD-HHMM first
  Save as new file        → rule-name.md
  Skip
  Cancel

Multiple Rules — File Already Exists

When installing multiple rules and any slug files already exist, a focused prompt is shown once for all conflicts:

⚠ 4 files already exist:
  • .cursor/rule-a.md
  • .claude/rule-a.md
  • .cursor/rule-b.md
  • .claude/rule-b.md

❯ Overwrite all
  Save all as new files
  Cancel

New File Naming — Automatic Counter

If you choose "Save as new file" / "Save all as new files" and the slug file itself already exists, a counter suffix is appended automatically until a free name is found:

rule-name.md      ← exists
rule-name-1.md    ← exists
rule-name-2.md    ← free ✓  →  written here

Dry Run

Preview exactly what would be written without touching any files:

npx @airuleshub/cli add nextjs-clean-arch rule-b --dry-run
━ nextjs-clean-arch
────────────────────────────────────────────
  Dry Run — No files written
────────────────────────────────────────────
  Would install:
  • Cursor     → .cursor/nextjs-clean-arch.md
  • Claude Code → .claude/nextjs-clean-arch.md

━ rule-b
────────────────────────────────────────────
  Dry Run — No files written
────────────────────────────────────────────
  Would install:
  • Cursor     → .cursor/rule-b.md
  • Claude Code → .claude/rule-b.md

Monorepo Support

When a workspace (pnpm-workspace.yaml or "workspaces" in package.json) is detected, you'll be prompted:

Install rule at:
❯ Current package
  Workspace root

CI / Non-Interactive Mode

Use --yes to skip all prompts:

npx @airuleshub/cli add rule-a rule-b --yes --agent cursor,claude

This will:

  • Skip agent selection (requires --agent or auto-detected agents)
  • Overwrite existing files automatically
  • Exit without any confirmations

Security

  • Slug names are sanitized to prevent path traversal
  • All paths are resolved with path.resolve
  • Cross-platform: supports Windows and Unix

Development

# Install dependencies
npm install

# Run in development mode
npm run dev -- add <slug>

# Build
npm run build

# Run tests
npm test

Changelog

v3.0.0

  • Multi-rule installsadd now accepts multiple slugs in one command
  • Batch API fetch — all slugs fetched in a single request
  • Per-slug files — multiple rules each get their own <slug>.md file per agent (no overwrite collisions)
  • Single overwrite prompt — conflict resolution asked once for all rules combined
  • Simplified conflict prompt for multi-rule mode (Overwrite all / Save all as new files / Cancel)
  • Auto counter suffix — "Save as new file" produces rule-1.md, rule-2.md, … if the base name is taken

v2.0.0

  • Agent-aware add command with interactive multi-select
  • Auto-detection of 19 AI agents
  • Monorepo support
  • Dry-run mode
  • Backup & Replace option

v1.x

  • Legacy install command (writes to ./airules/)

License

ISC © Nikunj Borad