create-writbee
v0.1.0
Published
Scaffold a blog powered by the Writbee content API.
Maintainers
Readme
create-writbee
Scaffolds a blog wired to your Writbee project — routes, metadata, a feed, a sitemap and your key already in place.
npm create writbee@latest my-blogIt asks where the blog should live, which framework to use, and for an API key, then writes the project, initialises a repository and installs the dependencies.
Templates
| --template | What you get |
| ------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| next | Next.js App Router and Tailwind 4, reading through @writbee/next: cached server reads, a publish webhook that clears them, and a build that fails if the secret key is ever imported into a client component |
| astro | A static Astro build on @writbee/core alone, no adapter package and no framework CSS — every read happens while the site is being generated |
Both come with an archive, a post page, rss.xml, sitemap.xml, robots.txt,
a 404, canonical URLs and Open Graph tags, and dark mode that follows the
reader's system setting.
Options
Everything can be answered up front, which is what makes this scriptable:
npx create-writbee my-blog --template next --key sk_live_... --no-install| Option | |
| ------------------------ | ------------------------------------------------------------------------------- |
| -t, --template <name> | next or astro. Asked for when omitted |
| --api-url <url> | The API, including its /api prefix. Defaults to https://api.writbee.com/api |
| --key <sk_...> | Written into the project's env file, which is gitignored |
| --package-manager <pm> | npm, pnpm, yarn or bun. Defaults to whichever one ran the command |
| --no-install | Skip installing dependencies |
| --no-git | Skip creating a repository |
| -y, --yes | Take every default without asking |
With no terminal to ask in — a CI job, a pipe — every unanswered question falls back to its default, and the directory becomes required rather than prompted.
Note the -- in npm create writbee@latest my-blog -- --template astro: npm
needs it before it passes flags through. npx create-writbee does not.
Pointing at a local API
npx create-writbee my-blog --api-url http://localhost:8000/api --key sk_test_...The URL only ever lands in the project's env file, so changing your mind later is a one-line edit rather than a re-scaffold.
Working on it
npm install
npm run build -w create-writbee
node packages/create-writbee/dist/index.js /tmp/trial --template nextTemplates are copied verbatim, so they stay runnable in place — the only things
the CLI rewrites are the name in package.json and the env file it writes
from your answers. Dotfiles ship with an underscore (_gitignore) because npm
strips a real .gitignore out of a published package, and are renamed back on
the way out.
