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

@motherbase/cli

v0.2.4

Published

Motherbase operator CLI — drives the Platform Console and linked projects.

Readme

Motherbase CLI

A Supabase-CLI-like operator CLI for Motherbase. It drives both the Platform Console (account + multi-project lifecycle) and a linked project's admin API through the Console proxy — or a single project API directly.

Zero runtime dependencies. Node ≥ 18 (uses built-in fetch, readline, fs, child_process only).

node bin/motherbase.js --help          # auto-generated help
npm link                               # or: npm i -g @motherbase/cli
motherbase login --url https://console.example.com
motherbase link                        # pick a project → writes ./.motherbase/config.json
motherbase db tables
motherbase functions deploy --name hello --route hello --file ./hello.js

Connection model

  1. Console / accountmotherbase login [--url <consoleUrl>] performs a real Console login (POST /api/platform/login) and stores the session token.
  2. Linked projectmotherbase link [project] records which project this directory targets. All resource commands then route through the Console proxy (/api/projects/:id/admin/*).
  3. Direct mode (CI / single stack) — set MOTHERBASE_URL + MOTHERBASE_ADMIN_TOKEN to talk straight to one project's /api/admin/*.

Configuration files

Global credentials~/.motherbase/config.json (contains tokens, written 0o600):

{
  "consoles": {
    "https://console.example.com": { "token": "…", "email": "[email protected]" }
  },
  "current": "https://console.example.com"
}

Project link./.motherbase/config.json (versionable, non-secret):

{ "consoleUrl": "https://console.example.com", "projectId": "my-app", "projectName": "my-app" }

Resolution precedence

flags > env > config, per value:

| Value | Flag | Env | Config | | ----------- | ----------------- | ------------------------- | ------ | | console URL | --url/-u | MOTHERBASE_CONSOLE_URL | link / global current | | token | --token | MOTHERBASE_TOKEN | global console entry | | project | --project/-p | MOTHERBASE_PROJECT | link | | direct API | — | MOTHERBASE_URL + MOTHERBASE_ADMIN_TOKEN | — |

Auth headers

The console session token is sent as Authorization: Bearer <token> on every request. Console requests hit /api/platform/*; admin requests hit the proxy at /api/projects/:id/admin/* (which validates the session, then injects its own X-Platform-Token to the project). In direct mode the admin token is the Bearer.

Commands

Global flags: --json, --yes/-y, --project/-p <id>, --url/-u <consoleUrl>, --token <t>, -h/--help, -v/--version.

  • Connection: login, logout, whoami, link, unlink, status
  • Projects (Console): projects list|create|start|stop|restart|update|rebuild|delete|logs|info|limits
  • Local self-host (docker compose): init, start, stop, deploy, logs
  • Database: db tables|sql|dump|restore|backups
  • Migrations: migrations list|diff|get|create|apply|rollback, migration new
  • Import: import --from-supabase <conn> [--preview] [--no-data] [--no-auth]
  • RLS: rls list|enable|disable, rls policy create|delete
  • Users: users list|get|create|update|delete|reset-password|promote|demote|revoke-sessions
  • Storage: storage buckets list|create|delete, storage ls|cp|rm
  • Functions: functions list|get|new|deploy|delete|invoke|logs
  • Secrets: secrets list|set|unset
  • Realtime: realtime config|channels
  • Webhooks: webhooks list|create|delete|test
  • Cron: cron list|create|delete|toggle
  • Config: config list|get|set
  • Inspect: inspect logs|stats|performance|requests|advisor|shield
  • Codegen: gen types typescript [--schema public] [--local] [--output <file>] [--check]

Run motherbase <group> -h for per-group usage.

Type generation

Generate TypeScript definitions for the live schema, in the shape supabase-js emits, so createClient<Database>(url, key) types every row, rejects unknown columns and types .rpc() calls:

motherbase gen types typescript > database.types.ts
motherbase gen types typescript --schema shop --output src/shop.types.ts

With no --output the file goes to stdout and nothing else does, so the redirect above produces a compiling file. --local skips the Console proxy and talks to a project API on this machine (MOTHERBASE_URL, default http://localhost:5001, with MOTHERBASE_ADMIN_TOKEN).

Gate CI on schema drift with --check, which never writes and exits non-zero when the committed file differs from a fresh generation:

motherbase gen types typescript --check --output database.types.ts

Supabase migration

Preview a Supabase import without writing to Motherbase:

motherbase import --from-supabase "$SUPABASE_DB_URL" --preview --json

Run the import:

motherbase import --from-supabase "$SUPABASE_DB_URL" --yes

The importer moves the portable parts of a Supabase project: public schema, table data, RLS policies, and email/password users from auth.users. Storage objects are not copied. Use --no-data or --no-auth for partial imports.

Tests

npm test        # node --test, mocked fetch, no network/DB