craveup
v1.0.3
Published
CraveUp CLI to bootstrap storefront templates
Downloads
14
Readme
CraveUp CLI
The CraveUp command line interface bootstraps production-ready storefronts in minutes. It scaffolds one of our open-source templates, wires credentials, installs dependencies, and can launch the dev server for you.
Quick start
npx craveup initFollow the prompts to:
- Choose a template—single-location (Tomodachi Sushi, Xichuan Noodles) or organization-wide (
storefront-default). - Paste your
NEXT_PUBLIC_CRAVEUP_API_KEY. - Provide a location ID or organization slug when the template requires it.
- Let the CLI clone the template, set up
.env.local, install dependencies, and optionally startpnpm dev.
Tip: rerun the command with
--skip-installif you prefer to manage dependencies manually.
Command reference
| Command | Description |
| ------------------ | --------------------------------------------------------------------------------------------- |
| craveup init | Interactive storefront scaffolding. Aliased as npx craveup init for zero-install runs. |
Flags
| Flag | Description |
| --- | --- |
| --template <id> | Pre-select a template (storefront-default, tomodachi-sushi, xixhuan-noodles). |
| --dir <path> | Target directory for the generated project. |
| --api-key <key> | Inject the API key non-interactively. |
| --skip-install | Skip dependency installation (the CLI prints the command you need to run). |
| --force | Overwrite an empty directory without prompting; handy for scripted runs. |
Combine flags for CI/CD usage:
npx craveup init \
--template storefront-default \
--dir my-storefront \
--api-key "$NEXT_PUBLIC_CRAVEUP_API_KEY" \
--skip-installEnvironment variables
The CLI communicates with CraveUp partner services and writes initial environment values into the generated storefront.
| Variable | Default | Purpose |
| --- | --- | --- |
| CRAVEUP_DASHBOARD_URL | https://partners.craveup.com | Partner dashboard base URL. Override to target staging environments. |
| CRAVEUP_PARTNER_API_URL | https://partners-api.craveup.com | Partner API base URL. |
Generated storefronts receive a minimal .env.local:
- Always:
NEXT_PUBLIC_CRAVEUP_API_KEYandNEXT_PUBLIC_GOOGLE_MAPS_API_KEY(blank placeholder). - Single-location templates: add
NEXT_PUBLIC_LOCATION_ID. - Organization templates: add
NEXT_PUBLIC_ORG_SLUG.
Update the placeholder values before starting the dev server.
Template catalogue
Template metadata lives in src/templates.ts. Each entry defines:
- Template identifier (
storefront-default,tomodachi-sushi,xixhuan-noodles). - Git repository URL (can point to local/private forks).
- Scope (
single-locationororganization) along with the credentials collected by the wizard.
| Template | Scope | Credentials collected |
| --- | --- | --- |
| tomodachi-sushi | Single location | NEXT_PUBLIC_CRAVEUP_API_KEY, NEXT_PUBLIC_LOCATION_ID |
| xixhuan-noodles | Single location | NEXT_PUBLIC_CRAVEUP_API_KEY, NEXT_PUBLIC_LOCATION_ID |
| storefront-default | Organization | NEXT_PUBLIC_CRAVEUP_API_KEY, NEXT_PUBLIC_ORG_SLUG |
To add your own template, update src/templates.ts and publish a compatible Git repository.
Local development
pnpm install
pnpm --filter craveup build- The compiled CLI binary is emitted to
dist/cli.js. - Run
pnpm --filter craveup devfor watch-mode rebuilds. - Execute the local build with
node dist/cli.js init.
Troubleshooting
| Symptom | Fix |
| --- | --- |
| CLI exits with Cannot read property 'trim' of undefined. | Ensure NEXT_PUBLIC_CRAVEUP_API_KEY is supplied either interactively or via --api-key. |
| Generated project fails to fetch data. | Verify .env.local contains a valid API key and restart pnpm dev (Next.js reads env vars at boot). |
| Template install fails due to Git access. | Confirm you can clone the template repo directly. Private templates require authenticated URLs. |
Need help? Open an issue in the monorepo or join the CraveUp developer community.
