@alphasquad/create-storefront-cli
v1.1.0
Published
A CLI tool for scaffolding Saleor storefronts from templates
Readme
@alphasquad/create-storefront-cli
A CLI tool for scaffolding Saleor storefronts from templates.
Prerequisites
- Node.js >= 18
- Git
- SSH keys configured for GitHub (default) or a GitHub Personal Access Token (PAT) with repo access
Quick start
npx @alphasquad/create-storefront-cli --name my-storeThe CLI will prompt you to select a template:
Select a template:
1) basic
2) standard
3) advanced
Enter choice (1-3):Or install globally:
npm i -g @alphasquad/create-storefront-cli
create-storefront --name my-storeOptions
| Flag | Required | Description |
| ---------------- | -------- | -------------------------------------------------------------- |
| --name | Yes | Tenant / directory name |
| --template | No | Template variant: basic, standard, advanced (prompts if omitted) |
| --no-ssh | No | Disable SSH and use HTTPS + PAT instead |
| --pat | No | GitHub Personal Access Token (implies --no-ssh) |
| --settings | No | Path to settings.json (default: ./settings.json) |
| --template-url | No | Custom Git URL (overrides --template) |
| --help | No | Show help message |
Authentication
SSH is the default. The CLI uses your SSH agent and keys (~/.ssh/) to clone repos — no token needed.
To fall back to HTTPS + PAT, pass --no-ssh or --pat <token>, or set the GITHUB_PAT environment variable.
PAT resolution order (when using HTTPS):
GITHUB_PATenvironment variable--patflag- Interactive prompt (masked input)
Using a settings file
If a settings.json file exists in your working directory (or at the path given by --settings), the CLI will use it to pre-fill environment variables instead of prompting interactively.
{
"templateUrl": "https://github.com/AlphaSquadTech/saleor-template-standard.git",
"env": {
"NEXT_PUBLIC_API_URL": "https://api.example.com/graphql/",
"NEXT_PUBLIC_SITE_URL": "http://localhost:3000",
"NEXT_PUBLIC_STOREFRONT_URL": "http://localhost:3000",
"NEXT_PUBLIC_SALEOR_CHANNEL": "default-channel"
}
}If no settings.json is found, the CLI reads .env.example from the cloned template and prompts you for each value.
What it does
The CLI runs through 6 steps:
- Resolve authentication — SSH keys (default) or HTTPS + PAT
- Clone template — clones the selected template repo
- Fresh git init — removes template history and creates a clean repo
- Initialize submodules — syncs and updates git submodules (if any)
- Create
.env.local— fromsettings.jsonvalues or interactive prompts - Final setup — creates
redirects.jsonand makes an initial commit
Examples
# Fully interactive — prompts for template, uses SSH
npx @alphasquad/create-storefront-cli --name my-store
# Skip template prompt by passing --template directly
npx @alphasquad/create-storefront-cli --name my-store --template standard
# Explicit PAT (switches to HTTPS mode)
npx @alphasquad/create-storefront-cli --name my-store --pat ghp_xxx
# PAT from environment
GITHUB_PAT=ghp_xxx npx @alphasquad/create-storefront-cli --name my-store
# Force HTTPS mode — prompts for PAT interactively
npx @alphasquad/create-storefront-cli --name my-store --no-ssh
# Custom template repo
npx @alphasquad/create-storefront-cli --name my-store --template-url https://github.com/org/repo.gitAfter scaffolding
cd my-store
yarn install
yarn devLicense
ISC
