Skip to content

feat: add create-claudius project scaffolder#122

Merged
PAMulligan merged 1 commit into
mainfrom
feat/create-claudius
Jun 15, 2026
Merged

feat: add create-claudius project scaffolder#122
PAMulligan merged 1 commit into
mainfrom
feat/create-claudius

Conversation

@PAMulligan

Copy link
Copy Markdown
Contributor

Closes #42

Summary

npm create claudius@latest (or pnpm create claudius) scaffolds a ready-to-run Claudius project in under a minute — the npm create vite experience for Claudius. New create-claudius/ package, published to npm.

Acceptance criteria

  • create-claudius package (flat at repo root, matching widget/worker/docs — confirmed with you over packages/)
  • Interactive prompts: project name, framework (vanilla / React / Next.js), theme, accent color, API URL — plus an optional Worker confirm. Every prompt has a flag for non-interactive/CI use.
  • Generates a ready-to-run starter (pnpm install && pnpm dev works)
  • Optionally scaffolds the Cloudflare Worker (wrangler.toml + KV stub + deploy runbook)
  • Snapshot tests of generated output (vitest)
  • Documented in README + docs site

How it works

  • CLI: @clack/prompts + built-in node:util parseArgs (no arg-parser dep), bundled to a single ESM bin with tsup. Templates are copied with {{TOKEN}} replacement; _gitignore.gitignore on write (npm strips .gitignore), and claudius-chat-widget is pinned to ^<version> (create-claudius is version-synced with the widget via release-please, so it always matches a real release).
  • Templates: vanilla (CDN script embed), react (Vite + claudius-chat-widget), next (App Router + 'use client' wrapper), worker (trimmed but runnable Hono worker, widget-compatible {messages}{reply}).

Verification

  • pnpm typecheck + pnpm build + pnpm test (5 tests, snapshots) green
  • Built CLI generates all templates; no leftover tokens, .gitignore rename works
  • Generated React (tsc + vite build), vanilla (vite build), and Next.js (next build) all build against the published claudius-chat-widget@1.6.0; the worker scaffold typechecks
  • npm pack ships dist/ + templates/ (including the _gitignore and .dev.vars.example dotfiles)

Release wiring

  • Version-synced via release-please-config.json extra-files
  • Auto-publish step added to release-please.yml; publish-npm.yml now takes a package input (widget | create-claudius)
  • New create-claudius CI job

⚠️ First publish note

Like the widget, create-claudius won't exist on npm until first published, and a package-scoped token can't create it. The NPM_TOKEN secret must be able to create a new package (it's the all-packages token you set last time, so this should work). Bootstrap the first version after merge via Actions → Publish to npm → package: create-claudius, or it ships on the next release.

🤖 Generated with Claude Code

`npm create claudius@latest` scaffolds a ready-to-run Claudius project
(vanilla, React, or Next.js), optionally with a Cloudflare Worker — the
same way `npm create vite` works.

- create-claudius/ — CLI (@clack/prompts + node:util parseArgs) that copies a
  template with token replacement; every prompt has a flag for non-interactive use.
- Templates: vanilla (CDN script embed), react (Vite + claudius-chat-widget),
  next (App Router + 'use client' wrapper), and an optional config-first worker
  scaffold (wrangler.toml + KV stub + deploy runbook).
- Snapshot tests of generated output for every template (vitest).
- Version-synced with the widget via release-please; auto-publishes on release,
  and the manual publish-npm workflow now selects which package to publish.
- CI job (typecheck + test + build); docs scaffolding page + sidebar entry;
  README badge + quick-start section.

Verified: all three frameworks install and build against the published
claudius-chat-widget@1.6.0, the worker scaffold typechecks, and the npm tarball
ships dist + templates (including dotfiles).

Closes #42

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@PAMulligan
PAMulligan merged commit b72f3ca into main Jun 15, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add create-claudius CLI scaffolder for one-command embed setup

1 participant