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

@pb-admin/cli

v1.0.2

Published

CLI to manage PocketBase collections, rules, and schema across multiple instances

Readme

@pb-admin/cli

CLI tool for managing PocketBase collections, schema, and access rules. Keep your PocketBase configuration in version control and sync changes across environments.

Why?

  • Version control - Track schema and rules changes in git
  • Environment sync - Push same config to dev, staging, prod
  • Team collaboration - Review PocketBase changes in PRs
  • CI/CD ready - Automate deployments with diff checks

Installation

# npm
npm install -g @pb-admin/cli

# or run directly
npx @pb-admin/cli init

Quick Start

# 1. Initialize in your project
pb-admin init

# 2. Pull current schema and rules from PocketBase
pb-admin pull

# 3. Edit files locally
#    pb-admin/schema.json  - collection fields
#    pb-admin/rules.json   - access permissions

# 4. Preview changes
pb-admin diff

# 5. Apply to PocketBase
pb-admin push

Commands

| Command | Description | |---------|-------------| | pb-admin init | Setup project, login, and pull initial config | | pb-admin login | Login to PocketBase instance | | pb-admin logout | Clear saved credentials | | pb-admin pull | Download schema & rules from PocketBase | | pb-admin push | Upload local schema & rules to PocketBase | | pb-admin diff | Compare local files vs live PocketBase | | pb-admin col | List and inspect collections | | pb-admin status | Check login status |

Options

| Flag | Description | |------|-------------| | --schema, -s | Only operate on schema | | --rules, -r | Only operate on rules | | --dry-run, -n | Preview changes without applying | | --debug | Show detailed error information |

Project Files

After pb-admin init:

your-project/
  pb-admin.json           # Config (PocketBase URL)
  pb-admin/
    schema.json           # Collection fields definition
    rules.json            # Access rules (list/view/create/update/delete)

Example: Updating Rules

// pb-admin/rules.json
{
  "posts": {
    "listRule": "",                           // public
    "viewRule": "",                           // public
    "createRule": "@request.auth.id != ''",   // authenticated users
    "updateRule": "@request.auth.id = owner", // owner only
    "deleteRule": null                        // admin only
  }
}
pb-admin diff   # see what changed
pb-admin push   # apply to PocketBase

CI/CD Integration

# GitHub Actions example
- name: Check PocketBase config
  env:
    PB_URL: ${{ secrets.PB_URL }}
    PB_EMAIL: ${{ secrets.PB_EMAIL }}
    PB_PASSWORD: ${{ secrets.PB_PASSWORD }}
  run: |
    npx @pb-admin/cli diff
# Shell script
export PB_URL=https://your-pocketbase.com
export [email protected]
export PB_PASSWORD=your-password

pb-admin diff || exit 1  # fail if config differs
pb-admin push            # or apply changes

Credentials

Credentials are stored per-project in ~/.config/pb-admin/projects/. Each project directory gets its own credentials file based on the project path.

License

MIT