npm package: @karaoke-cms/create
Description: Scaffold a new karaoke-cms project
Latest version: 0.20.10

# @karaoke-cms/create

Scaffolding tool for karaoke-cms. Creates a complete new project from scratch with a single command, then optionally deploys a live preview to Cloudflare Pages.

## Usage

```bash
npm create @karaoke-cms@latest
# or
npm create @karaoke-cms@latest my-site
```

The wizard asks for your project name, site title, URL, and description, then generates everything and installs dependencies.

At the end you're offered a one-step deploy to Cloudflare Pages (defaults to **yes** — your site can be live before you open your code editor).

## What gets created

```
my-site/
  package.json          # @karaoke-cms/* deps pinned to current version
  astro.config.mjs      # karaoke() integration, site URL
  karaoke.config.ts     # title, description, theme, blog module
  src/
    content.config.ts   # makeCollections() wired to vault/
    env.d.ts            # TypeScript types for virtual:karaoke-cms/config
  tsconfig.json
  .gitignore
  .env.default          # KARAOKE_VAULT=./vault/
  public/_redirects     # Cloudflare Pages 404 config
  vault/                # Obsidian vault with sample blog posts
    blog/               # 30 demo posts (publish: true)
    docs/
    _website/           # nav config and page templates
      menus.yaml
```

A git repository is initialised with an initial commit. Opening `vault/` in Obsidian lets you write content immediately.

## Generated karaoke.config.ts

```ts
import { defineConfig } from '@karaoke-cms/astro';
import { blog } from '@karaoke-cms/module-blog';
import { themeDefault } from '@karaoke-cms/theme-default';
import { loadEnv } from '@karaoke-cms/astro/env';

const env = loadEnv(new URL('.', import.meta.url));

export default defineConfig({
  vault: env.KARAOKE_VAULT,
  title: 'My Site',
  description: 'What this site is about.',
  modules: [blog({ mount: '/blog' })],
  theme: themeDefault(),
});
```

## Local dev

```bash
cd my-site
npm run dev     # → http://localhost:4321
```

## Deploy

```bash
npm run deploy  # publishes to Cloudflare Pages
```

Requires a Cloudflare account and the `wrangler` CLI. The wizard handles the first deploy interactively.

## What's new in 0.18.2

No user-facing changes in this release.

## What's new in 0.18.1

- **`menus.yaml` moved to `_website/`** — the scaffolded vault now puts the navigation config at `vault/_website/menus.yaml` instead of `vault/karaoke-cms/config/menus.yaml`. Existing projects should move the file to match.
- **Landing page included** — the scaffolded project now includes a "Your site is live" home page with a hero and your three most recent posts visible on first run.

## What's new in 0.18.0

No user-facing changes in this release.

## What's new in 0.10.3

- **Directory traversal rejected** — passing a project name like `../../outside` that resolves outside the current working directory now exits with a clear error instead of creating files at an unexpected location.

## What's new in 0.10.2

- **`sharp` in devDependencies** — scaffolded projects now include `sharp` so Astro's image optimisation works without a manual install step.
- Scaffolded `content.config.ts` passes the full karaoke config to `makeCollections`, so new projects are multi-docs-section-ready from day one.

## What's new in 0.9.5

- **Deploy defaults to yes** — the Cloudflare Pages deploy prompt now defaults to YES, so new sites are live by the end of the wizard
- **Three success screens** — distinct output for deploy success, declined, and failed (failed surfaces the error and next steps)
- **isTTY color guard** — ANSI color codes are disabled in CI and piped output
- **30 demo blog posts** included in the scaffolded vault so the site is populated on first visit
- **Generated `karaoke.config.ts`** uses `themeDefault()` + `blog()` module API (replaces the old string-based theme config)