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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@agentrules/cli

v0.1.0

Published

CLI for installing and publishing AGENT_RULES presets.

Readme

@agentrules/cli

CLI for installing and publishing AGENT_RULES presets.

Installation

# Run directly with npx
npx @agentrules/cli <command>

# Or install globally
npm install -g @agentrules/cli
agentrules <command>

Installing Presets

agentrules add <preset>

Install a preset from the registry.

agentrules add <preset> --platform <platform> [options]

Options:

| Option | Description | |--------|-------------| | -p, --platform <platform> | Target platform: opencode, claude, cursor, codex | | -V, --version <version> | Install a specific version (default: latest) | | -g, --global | Install to global config directory | | --dir <path> | Install to a custom directory | | -r, --registry <alias> | Use a specific registry | | -f, --force | Overwrite existing files (backs up originals to .bak) | | --no-backup | Don't backup files before overwriting (use with --force) | | --dry-run | Preview changes without writing | | --skip-conflicts | Skip files that already exist |

Examples:

# Install a preset for OpenCode
agentrules add agentic-dev-starter --platform opencode

# Install globally
agentrules add agentic-dev-starter --platform opencode --global

# Install a specific version
agentrules add agentic-dev-starter --platform opencode --version 1.0

# Version can also be specified with @ syntax
agentrules add [email protected] --platform opencode

# Preview what would be installed
agentrules add agentic-dev-starter --platform opencode --dry-run

Creating Presets

agentrules init [directory]

Initialize a preset config in a platform directory. The command guides you through the required fields for publishing.

agentrules init [directory] [options]

Options:

| Option | Description | |--------|-------------| | -n, --name <name> | Preset name (default: my-preset) | | -t, --title <title> | Display title | | --description <text> | Preset description | | -p, --platform <platform> | Target platform | | -l, --license <license> | License (e.g., MIT) | | -f, --force | Overwrite existing config | | -y, --yes | Accept defaults, skip prompts |

Examples:

# Initialize in your existing platform directory
cd .opencode
agentrules init

# Initialize in a specific platform directory
agentrules init .claude

# Accept all defaults, skip prompts
agentrules init .opencode --yes

After running init, your preset structure is:

.opencode/
├── agentrules.json       # Preset config (created by init)
├── AGENTS.md             # Your config files (included in bundle)
├── commands/
│   └── review.md
└── .agentrules/          # Optional metadata folder
    ├── README.md         # Shown on registry page
    ├── LICENSE.md        # Full license text
    └── INSTALL.txt       # Shown after install

Preset Config Fields

| Field | Required | Description | |-------|----------|-------------| | name | Yes | URL-safe identifier (lowercase, hyphens) | | title | Yes | Display name | | description | Yes | Short description (max 500 chars) | | license | Yes | SPDX license identifier (e.g., MIT) | | platform | Yes | Target platform: opencode, claude, cursor, codex | | version | No | Major version (default: 1) | | tags | Yes | 1-10 tags for discoverability | | features | No | Up to 5 key features to highlight | | ignore | No | Additional patterns to exclude from bundle |

Auto-Excluded Files

These files are automatically excluded from bundles:

  • node_modules/, .git/, .DS_Store
  • Lock files: package-lock.json, bun.lockb, pnpm-lock.yaml, *.lock

Use the ignore field for additional exclusions:

{
  "ignore": ["*.log", "test-fixtures", "*.tmp"]
}

agentrules validate [path]

Validate a preset configuration before publishing.

# Validate current directory
agentrules validate

# Validate a specific path
agentrules validate .opencode

Publishing Presets

Publish your preset to agentrules.directory to reach developers and get a profile showcasing your presets.

agentrules login

Authenticate with the registry. Opens a browser for OAuth.

agentrules logout

Log out and clear stored credentials.

agentrules whoami

Show the currently authenticated user.

agentrules publish [path]

Publish a preset to the registry. Requires authentication.

agentrules publish [path] [options]

Options:

| Option | Description | |--------|-------------| | -v, --version <major> | Major version to publish (default: 1) | | --dry-run | Preview without publishing |

Examples:

# Publish current directory
agentrules publish

# Publish a specific preset
agentrules publish ./my-preset

# Publish to major version 2
agentrules publish --version 2

# Preview what would be published
agentrules publish --dry-run

Versioning: Presets use MAJOR.MINOR versioning. You set the major version, and the registry auto-increments the minor version on each publish.

agentrules unpublish <preset>

Remove a specific version of a preset from the registry. Requires authentication.

agentrules unpublish <preset> [options]

Options:

| Option | Description | |--------|-------------| | -p, --platform <platform> | Target platform (if not in preset string) | | -V, --version <version> | Version to unpublish (if not in preset string) |

Examples:

# With flags
agentrules unpublish my-preset --platform opencode --version 1.0

# Version can be specified with @ syntax
agentrules unpublish [email protected] --platform opencode

Note: Unpublished versions cannot be republished with the same version number.


Registry Management

agentrules registry list

List configured registries.

agentrules registry add <alias> <url>

Add a registry.

agentrules registry add my-registry https://example.com/registry
agentrules registry add my-registry https://example.com/registry --default

agentrules registry remove <alias>

Remove a registry.

agentrules registry use <alias>

Set the default registry.

agentrules registry build

Build registry artifacts from preset directories. For self-hosted registries.

agentrules registry build -i <input> -o <output> [options]

Options:

| Option | Description | |--------|-------------| | -i, --input <path> | Directory containing preset folders | | -o, --out <path> | Output directory for registry artifacts | | -b, --bundle-base <url> | URL prefix for bundle locations | | -c, --compact | Emit minified JSON | | --validate-only | Validate without writing files |


Configuration

Config is stored at ~/.agentrules/config.json.

You can override the config directory with the AGENT_RULES_HOME environment variable.

{
  "defaultRegistry": "main",
  "registries": {
    "main": {
      "url": "https://agentrules.directory/"
    }
  }
}

Supported Platforms

| Platform | Project Directory | Global Directory | |----------|-------------------|------------------| | opencode | .opencode/ | ~/.config/opencode | | claude | .claude/ | ~/.claude | | cursor | .cursor/ | ~/.cursor | | codex | .codex/ | ~/.codex |