8000 GitHub - bermooda/cli: CLI for scaffolding and managing bermooda ecommerce shops · GitHub
[go: up one dir, main page]

Skip to content
bermoodaPublic

About

CLI for scaffolding and managing bermooda ecommerce shops

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Official bermooda CLI

CLI for scaffolding and managing bermooda ecommerce shops.

Package: @bermooda/cli
Command: bermooda

Design document: DESIGN.md (implementation handoff for agents).

Install

npm i -g @bermooda/cli@latest

From this repo (development):

npm install
npm link
bermooda version --cli

Quick start

bermooda install --local --dir ./my-shop -y \
  --admin-email admin@example.com \
  --admin-password 'TestPass123!' \
  --store-name 'Demo Shop'

cd my-shop
bermooda dev

Offline / local app checkout (skip npm download):

bermooda install --local --source /path/to/bermooda --dir ./my-shop -y \
  --admin-email admin@example.com \
  --admin-password 'TestPass123!' \
  --store-name 'Demo Shop'

Contributor setup

Fork and clone bermooda/bermooda, then run setup inside that checkout (installs deps prerequisites, Prisma, and the default theme via npm run extensions:install):

git clone https://github.com/<you>/bermooda.git
cd bermooda
npm install
npm run setup

Do not use bermooda install for platform contribution — that scaffolds a merchant shop from the published app package.

Commands

Command Description
bermooda install [--local|--server] Download app, deps, env, DB, admin, store
bermooda update Update shop to latest app version (git ff-only or tarball merge)
bermooda plugin add|update|remove|list|help Manage app/plugins/*
bermooda theme add|update|remove|list|help Manage app/themes/*
bermooda mcp init Write Cursor MCP config for this shop
bermooda dev Dev server (no 1Password op run)
bermooda start Production server (builds if build/ missing)
bermooda version [--cli|--shop] Versions
bermooda upgrade Upgrade this CLI globally
bermooda help [command] Help

Global flags: --cwd, -y / --yes, --json, --verbose.

Install flags

Flag Description
--local / --server Install profile (SQLite vs PostgreSQL defaults)
--dir <path> Target directory
--source <path> Local bermooda app checkout (skip network)
--ref <tag|branch> App git ref (default: bermooda@latest from npm)
--admin-email, --admin-password, --store-name Bootstrap credentials
--skip-deps, --skip-db Skip npm install or migrate/seed
--force, --force-env Non-empty dir / overwrite .env
--with-demo Include demo catalog on server installs

Plugin / theme sources

Default: install from an npm package name (official @bermooda/* packages and third-party):

bermooda plugin add @bermooda/plugin-subscriptions
bermooda theme add @bermooda/theme-paper
bermooda plugin add @bermooda/plugin-subscriptions 1.2.0

Alternate sources:

bermooda plugin add my-plugin --path ./packages/my-plugin
bermooda plugin add my-plugin --git https://github.com/org/plugin.git#v1
bermooda plugin add my-plugin --tarball https://example.com/plugin.tgz
bermooda theme list

If the npm package is not found, the CLI falls back to the bermooda registry (when configured). Registry URL: BERMOODA_REGISTRY_URL or builtin stub.

Extension dependency install scripts

plugin add|update and theme add|update install an extension's own dependencies into app/<plugins|themes>/<folder>/node_modules with npm install --ignore-scripts, so dependency preinstall / postinstall scripts don't run third-party code with your environment. Opt in with BERMOODA_EXTENSION_INSTALL_SCRIPTS: 1 / true / all for every extension, or a comma list of <kind>/<folder>:

BERMOODA_EXTENSION_INSTALL_SCRIPTS=plugins/resend bermooda plugin add @bermooda/plugin-resend

An extension can't opt itself in. The shop's own npm run build uses the same variable. peerDependencies and bermooda.dependencies merge into the shop's package.json and install at the shop root with scripts on, since native addons belong there.

Engine compatibility (bermooda.engine)

Plugins and themes must declare a semver range in package.json under the bermooda object:

{
  "bermooda": {
    "id": "my-plugin",
    "engine": ">=1.0.0"
  }
}

On plugin add|update and theme add|update, the CLI compares this range against the shop root package.json version. Incompatible packages are rejected before install (exit code 1). The shop must declare a valid semver version field.

Exit codes

Code Meaning
0 Success
1 User / project error
2 Network / download
3 Dependency install
4 Database / bootstrap
130 Interrupted

Requirements

  • Node.js ≥ 22.22.0 for the CLI. Shops that run on the Remix v3 server (they have a server.js) need Node.js ≥ 24.3; bermooda dev detects which kind a shop is
  • Network access to GitHub for remote install / update (unless --source)
  • git and tar recommended
  • Shop bootstrap uses app scripts/cli-bootstrap.mjs when present (admin + shopName + optional minimal seed)

Development

npm install
npm test              # vitest run
npm run test:watch    # vitest watch mode
npm run lint          # oxlint + oxfmt --check
npm run fmt           # oxfmt (write)
npm link
bermooda version --cli

Unit tests live under test/ and cover project detection, env generation, registry resolve, plugin install safety, non-git update merge, bootstrap env wiring, and command helpers.

Lint/format config matches the app repo (.oxlintrc.json, .oxfmtrc.json).

Releasing

Releases are automated with release-please (no local semantic-release dependencies). Conventional Commits on master drive the version bump; merging the release PR publishes.

  1. Use Conventional Commits in PR commits (or the squash merge subject). Agents must follow AGENTS.md and .cursor/rules/conventional-commits.mdc. Bump rules:

    Commit type Release
    fix:, perf:, revert: patch
    feat: minor
    BREAKING CHANGE: / feat!: / … major
    chore:, docs:, ci:, test:, … none
  2. Merge to master. .github/workflows/publish.yml runs release-please-action, which opens or updates a release PR that bumps package.json / package-lock.json and CHANGELOG.md.

  3. Merge the release PR. The same workflow then:

    • tags vX.Y.Z and creates a GitHub Release
    • runs tests and publishes @bermooda/cli via npm trusted publishing (OIDC)

No manual npm version or --follow-tags push. No NPM_TOKEN secret; provenance is published automatically. You can also run the workflow manually via Actions → Publish → Run workflow (useful to refresh the release PR).

One-time npm trusted publisher setup

On the package settings page (npmjs.com/package/@bermooda/cli → Settings → Trusted Publisher):

Field Value
Organization / user bermooda
Repository cli
Workflow filename publish.yml
Allowed action npm publish

Optional: after the first OIDC publish succeeds, set publishing access to Require two-factor authentication and disallow tokens, then revoke any old automation tokens.

Related repos

Deferred (v1)

  • Full plugin marketplace UI / remote registry with many packages
  • Enabling plugins via live HTTP admin API
  • Docker/Fly deploy automation

License

MIT

About

CLI for scaffolding and managing bermooda ecommerce shops

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Used by

Contributors

Languages

0