@selorax/pages-cli
v0.1.17
Published
SeloraX Pages CLI — pull/dev/deploy/build/create for file-based storefront projects.
Readme
@selorax/pages-cli
The CLI for the SeloraX Pages platform — pull, edit, preview, deploy, and self-host file-based storefront projects. Command:
selorax-pages.
npm i -g @selorax/pages-cli
# or: npx @selorax/pages-cli <command>0.1.15 · pre-1.0.
Not the extensions CLI.
@selorax/cli(commandselorax) is the separate SeloraX extensions developer CLI. This package —@selorax/pages-cli(commandselorax-pages) — is for the AI-native page/storefront platform.
What it is
A SeloraX Pages storefront is a folder of files (Next-app-router-shaped). This CLI is the developer's entry point to that workflow: a thin HTTP client over the storefront API (/storefront/v1) plus a local renderer and a self-host builder. It never touches storage directly — it talks to the API with a per-tenant key.
The project tree
routes/ pages by path; _layout.{html,tsx} = directory-scoped layout
index.html e.g. → /
products/[slug].tsx dynamic route
components/ shared TSX imported by pages
partials/ Liquid {% include %} fragments
selorax.json { apiUrl, storeId, domain }Commands
selorax-pages pull <dir> --api <url> --store <id> [--domain <d>] [--force] # download the project
selorax-pages dev <dir> [--port 4321] [--watch] # local render, no round-trip
selorax-pages deploy <dir> [--prune] [--dry-run] [--force] # push edits (skips unchanged)
selorax-pages build <dir> [--out <dir>] [--vendor] # emit a self-hostable Next app
selorax-pages create <dir> --api <url> --store <id> [--domain <d>] # scaffold a starter project
selorax-pages validate <dir> [--json] # lint locally (offline) — routes, includes, imports, tags
selorax-pages status <dir> [--json] # show local changes vs. the live storepull→ writes the project tree + a loosetsconfig.json/sx-env.d.ts(so editors stay quiet).dev→ boots the renderer locally against the pulled files, compiling on the fly.--watchadds SSE live-reload (auto-refresh on save).deploy→ walks the tree andPOSTs each page/layout (attaching components + partials); additive, a new version per file. Diffs against the live store first (GET /project) and skips unchanged routes/assets — a shared component/partial change re-pushes all pages (they bundle it). Flags:--prunedeletes remote pages/assets no longer present locally (draft-only editor pages are never touched);--dry-runprints the plan and writes nothing;--forceredeploys everything.build→ precompiles to a self-hostable thin Next app. Deps default to the published@selorax/*@^0.1.0;--vendorinstead bundles tarballs (offline/pre-publish).create→ scaffolds an HTML+TSX starter (home, product, cart, checkout, collection) + anAGENTS.mdauthoring guide.validate→ offline structural + cross-reference lint: route validity,{% include %}/ TSX import resolution, balanced{{#each}}/{{#if}}, section-type references, JSON parse,@typeslug shape. Exit1on errors;--jsonfor tooling/agents.deployruns this first (skip with--force).status→ read-only: which routes/assets are changed, new, unchanged, or remote-only vs. the live store. Reuses the deploy planner, writes nothing.--jsonfor tooling.
Auth
A per-tenant secret key via the SELORAX_TOKEN env var (or a project .env):
SELORAX_TOKEN=sk_live_… selorax-pages pull mystore --api https://your-host/api/storefront/v1 --store 22Global flags
--help (or -h) prints usage; <command> --help prints command usage. --version (or -v) prints the CLI version. --json makes validate, status, and deploy emit machine-readable output (for CI and AI agents).
The loop
pull → edit / selorax-pages dev → selorax-pages deploy (host on SeloraX)
└─ selorax-pages build (self-host: bun install && bun run build && bun run start)Part of SeloraX Pages
@selorax/data · @selorax/runtime · @selorax/platform · @selorax/compiler · @selorax/pages-cli
