This repository ships a one-shot installer that scaffolds a SvelteKit app, adds common deps, optionally merges a template, tweaks .gitignore, can copy shared assets from the starter repo, sets a license, and (optionally) makes a local git commit.
Assumes the script lives at
https://raw.githubusercontent.com/bchainhub/sveltekit-starter/main/sv-starter.sh. If you use a different path or branch, adjust the URL accordingly.
Using curl (recommended - maintains interactivity):
Option 1: jsDelivr CDN (faster, more reliable):
bash -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/bchainhub/sveltekit-starter/sv-starter.sh)"With a specific commit version:
bash -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/bchainhub/sveltekit-starter@beebeaf/sv-starter.sh)"Option 2: GitHub Raw (original):
bash -c "$(curl -fsSL https://raw.githubusercontent.com/bchainhub/sveltekit-starter/main/sv-starter.sh)"Or with a custom template repo:
bash -c "$(curl -fsSL https://cdn.jsdelivr.net/gh/bchainhub/sveltekit-starter/sv-starter.sh)" -- --template https://github.com/your-org/your-template.gitwget alternative:
bash -c "$(wget -qO- https://cdn.jsdelivr.net/gh/bchainhub/sveltekit-starter/sv-starter.sh)"Run locally (if you cloned this repo):
chmod +x sv-starter.sh
./sv-starter.sh --template https://github.com/blockchainhub/sveltekit-mota.git💡 You can pass any extra flags after
--and they will go straight tosv create.⚠️ Important: Thebash -c "$(curl ...)"approach maintains proper terminal interactivity, unlike piping with| bash -s --which can break interactive prompts.
- Node.js 18+ (20+ recommended) and
npx - git (for cloning templates and committing)
- One or more package managers available (the script auto-detects):
pnpm,bun,yarn, ornpm - curl (and optionally
rsyncfor robust folder copies)
- macOS 14.6.0 (Sonoma) - Primary testing platform, fully tested and supported
- macOS 13+ (Ventura) - Compatible and tested
- Linux (Ubuntu 22.04+) - Compatible with most distributions
- Shell compatibility: Uses POSIX-compliant bash features
- File operations: Cross-platform
statcommands (macOS-f, Linux-c) - Package managers: Auto-detects npm, yarn, pnpm, bun across platforms
- Git operations: Standard git commands that work everywhere
-
Runs SvelteKit creator Uses
npx sv create "$@"to start a new project (your answers go to SvelteKit’s wizard). -
Detects the created project directory Automatically
cd’s into it (even if SvelteKit created a subfolder). -
Installs base packages Installs a curated set of deps for this starter.
-
Auth picker (interactive) Choose:
0None (default)1@auth/sveltekit(reminder: install your adapter)2lucia(reminder: install your adapter)
If you choose Auth.js, it also runs
npx auth secret. -
Database / data layer picker (interactive) Choose from Prisma, Drizzle ORM, Supabase, Neon, MongoDB, Redis, etc., or None (default). Some options kick off a small init step (e.g.,
prisma init,drizzle-kit init). -
(Optional) Merge a template repository By default, uses:
https://github.com/blockchainhub/sveltekit-mota.gitOverride with--template <repo-url>. -
Initialize git (if needed) & make a quiet scaffold commit Initializes a repository if none exists and captures the initial state.
-
Run npm-check-updates locally and clean up Updates package ranges to latest, reinstalls, then removes
npm-check-updates. -
Augment
.gitignoreAppends extra ignores to the end of your existing.gitignore:- OS cruft:
._* - Logs:
*.log,*.log.*, tool-specific debug logs,logs,*.pid, … - Editor folders:
.idea/,.vscode/, etc. - Optional: ignore lockfiles (default Yes). If chosen, adds common lockfiles to
.gitignore.
- OS cruft:
-
(Optional) Copy shared assets from this starter repo
.editorconfig(default Yes): Pulled fromeditors/.editorconfigand placed at project root as.editorconfig..github(default No): Copiesproviders/.github/to your project root as.github(includesISSUE_TEMPLATE). If retrieval fails, the installer prints a failure and skips—no fallback files.
-
License selection (interactive) Default is CORE (your org’s license). You can also choose from common SPDX licenses or None:
-
CORE (custom)
- Fetches from:
https://raw.githubusercontent.com/bchainhub/core-license/refs/heads/main/LICENSE - Writes to
LICENSEand setspackage.json→"license": "SEE LICENSE IN LICENSE"(npm-compliant for non-SPDX).
- Fetches from:
-
SPDX licenses (MIT, Apache-2.0, GPL-3.0-or-later, AGPL-3.0-or-later, LGPL-3.0-or-later, BSD-2/3, MPL-2.0, Unlicense, CC0-1.0, ISC, EPL-2.0)
- Fetched from canonical text endpoints.
- Writes to
LICENSEand setspackage.json→"license": "<SPDX-ID>".
-
None
- Skips creating
LICENSEand leavespackage.jsonalone.
- Skips creating
If the license text can’t be fetched, the script prints an error and does not modify
package.json. -
-
Final (optional) local commit Prompt: “Create a single git commit with all current changes (no push)?” Default No. If Yes, it stages everything and commits locally. It never pushes.
-
--template <git-url>Use a different template repository for the initial project structure. Example:./sv-starter.sh --template https://github.com/your-org/your-sveltekit-template.git
-
Any additional arguments after
--are forwarded tosv create. Example:bash -c "$(curl -fsSL https://raw.githubusercontent.com/bchainhub/sveltekit-starter/main/sv-starter.sh)" -- --name my-app
-
Auth: pick none/Auth.js/Lucia.
-
DB: pick a data layer (or None).
-
Ignore lockfiles: default Yes (adds them to
.gitignore). -
Copy
.editorconfig: default Yes (fromeditors/.editorconfig). -
Copy
.githubfolder: default No (fromproviders/.github/). -
License: default CORE.
- For CORE (non-SPDX) we set
package.json→"SEE LICENSE IN LICENSE". - For SPDX licenses we write the SPDX ID to
package.json.
- For CORE (non-SPDX) we set
-
Final commit: default No (never pushes).
Running remote scripts is convenient but sensitive. Review the script URL before running:
curl -fsSL https://cdn.jsdelivr.net/gh/bchainhub/sveltekit-starter/sv-starter.sh | lessThen run it once you are comfortable using:
bash -c "$(curl -fsSL https://raw.githubusercontent.com/bchainhub/sveltekit-starter/main/sv-starter.sh)"- “command not found: npx / pnpm / git / curl” Install the missing tool and rerun.
- Template/asset copy fails The script prints a ❌ message and skips that step—no fallbacks are written. Check the URL/branch/path and your network access.
- License wasn’t set in
package.jsonThis only happens if fetching the license text failed. Fix the URL/network and rerun that step, or setlicensemanually.
If you want to pin the asset copy steps to an exact commit:
-
Replace the raw base:
https://raw.githubusercontent.com/bchainhub/sveltekit-starter/<COMMIT_SHA>
-
After cloning the starter repo, check out the same SHA before syncing:
git -C "$STARTER_TMP" checkout <COMMIT_SHA> --quiet || true
- A SvelteKit project with your selections.
package.jsonwith updated dependencies and (optionally)license..gitignorewith enhanced ignores (+ optional lockfile excludes).- Optional
.editorconfigand.github/ISSUE_TEMPLATEfrom the starter repo. LICENSEfile per your selection.
Happy hacking! ✨