npm.io
0.2.3 • Published 2d agoCLI

@feeef.dev/cli

Licence
UNLICENSED
Version
0.2.3
Deps
9
Size
950 kB
Vulns
0
Weekly
0

@feeef.dev/cli

Official Feeef developer CLI for template authors. Install once, scaffold templates, preview drafts on your live store without touching what customers see, then publish when ready.

npm install -g @feeef.dev/cli
feeef --help
Package @feeef.dev/cli
Binary feeef
Config ~/.config/feeef/config.json (dir 0700, file 0600)
SDK depends on feeef ^0.12.1

You do not need the private Lithium Next.js storefront repo to build or preview templates.


Quick start

npm install -g @feeef.dev/cli
feeef signin                          # browser OAuth (no client secret)
feeef template init my-template --blank
cd my-template
feeef use                             # pick a store you own
npm run build
npm run dev                           # draft preview URL opens in browser
# …edit pages/… then refresh the preview tab…
npm run publish -- --apply            # go live (explicit)

Auth

Default sign-in is browser OAuth with PKCE (public client — no FEEEF_OAUTH_CLIENT_SECRET).

Detail Value
Redirect http://localhost.feeef.org:7777/oauth/callback (http)
Callback bind 127.0.0.1 only
DNS localhost.feeef.org must resolve to 127.0.0.1
Scopes auth, store, store.settings, store_templates, store_templates.read (not *)
feeef signin                    # opens browser → consent → token saved
feeef signin --password-auth    # email/password (interactive prompt; no -p on argv)
feeef whoami
feeef signout
feeef config show
feeef config set apiUrl https://api.feeef.org/v1

Optional env (see .env.example):

  • FEEEF_OAUTH_CLIENT_ID — override built-in CLI client id
  • FEEEF_OAUTH_CLIENT_SECRET — only for confidential apps / local overrides
  • FEEEF_ACCOUNTS_URL / FEEEF_API_BASE_URL

Template workflow

Templates are Node.js packages. Scripts wrap the global feeef binary. All kit commands live under feeef template ….

feeef template init my-template       # blank scaffold (bundled) or marketplace / --git
cd my-template
feeef use <slug>                      # writes .feeefrc

feeef template add page products
feeef template add component products grid --title "Product grid"

npm run build                         # → dist/data.json (+ schema, locales)
npm run check
npm run dev                           # remote draft preview
npm run publish -- --apply            # catalog upload + install on store
Source layout (blank kit)
schema.ts                 # template-owned editor schema
pages/<page>/components/  # preferred → published sections.main
shared/ | library/        # reusable custom components
locales/*.json
feeef.template.json
dist/data.json            # TemplateData (build output)
dist/schema.json          # merged editor schema

Authoring: flat hero.tsx with export const meta + function App(). See scaffold docs under scaffolds/blank/docs/.

Marketplace sales: see 18-PAID-TEMPLATE-MARKET--price, releases, wallet buy, forever Owned.


Preview (feeef template dev)

Default preview is remote draft — not a local Next.js clone.

flowchart LR
  Watch["CLI watch + build"]
  Dist["dist/data.json"]
  API["PUT /stores/:id/template-preview"]
  Host["Hosted shop ?preview=token"]
  Live["Customers → live templateData"]
  Watch --> Dist --> API --> Host
  Live -.-> Host
Draft preview Live shop
Written by feeef template dev publish --apply / merchant editor
Storage metadata.templatePreview metadata.templateData
Who sees it You (and anyone with the preview link/cookie) Customers

Session UX

  1. CLI builds → PUT …/template-preview → opens https://{slug}.…/?preview={token}
  2. Middleware sets httpOnly cookie feeef_preview so you can navigate home → PLP → PDP → checkout with the draft template
  3. Catalog (products, prices) is still the real store
  4. Thin banner: Previewing draft template — Exit
  5. Exit: banner, or /?preview=0 / /?preview=exit, or stop the CLI (clears draft), or wait for token TTL (~24h)

API must match the shop. Hosted *.feeef.store loads drafts from production (https://api.feeef.org/v1). If the CLI still uses http://127.0.0.1:3333, the preview URL opens but you only see the live theme:

feeef config set apiUrl https://api.feeef.org/v1
feeef signin
feeef template dev

Hard rule: dev never overwrites live templateData.

Local Next (employees only)
feeef template dev --local
# implies storefront on disk: FEEEF_STOREFRONT_PATH or config storefrontPath

Not documented for public authors; not required for npm installs.


Publish (go live)

# Free public listing + release
feeef template publish --public --apply

# Paid listing (developers set price; Feeef takes an admin-configurable cut, default 30%)
feeef template publish --public --price 5000 --version 1.0.0 \
  --changelog "Initial marketplace release" --apply
Target Source
store_templates Listing metadata + head schema/data + price
store_template_releases Immutable snapshot + semver + changelog
template_components shared/ + library/
store_template_locales dist/locales/*.json
Install (--apply) Pins store.templateId + template_release_id → live metadata.templateData

Merchants who buy a paid template own it forever on that store (reinstall / update free). Paid templates cannot be forked into a new catalog row.

Without --apply, the marketplace listing/release updates but customers keep the previous live install until they install/update.


Commands cheat sheet

Command Purpose
feeef signin OAuth (or --password-auth)
feeef use [store] Bind template store (.feeefrc)
feeef template init Scaffold blank / git / marketplace
feeef template add|remove page|component Scaffold edits
feeef template build|check|watch Compile / validate
feeef template dev Remote draft preview
feeef template publish [--apply] Upload (+ optional install)
feeef config show|set Global config

License

UNLICENSED — proprietary Feeef software. See LICENSE.

Monorepo develop

cd cli
npm install
npm test
npm run build
npm run link:global

Release notes for maintainers: RELEASE.md.

Keywords