CLI#
One command gets you from nothing to a running hono-preact app:
create-hono-preact scaffolds the project, installs dependencies, and
initializes a git repo. It also has an add-agents subcommand for dropping
framework guidance into a project you set up manually.
Create a new app#
npm create hono-preact
Run with no arguments and the wizard walks you through it: project directory,
adapter (Cloudflare Workers or a Node server), whether to add hono-preact-ui
components, and whether to install dependencies and initialize git. Because the
common path takes no flags, there is nothing for npm to mis-parse.
The CLI requires Node ^22.18.0 || >=24.11.0 (the range hono-preact itself
supports) and exits with a clear message on an older Node before anything is
scaffolded. --help, --version, and add-agents work on any Node.
You can pass a directory and skip prompts with flags for scripting or CI:
# pnpm/yarn/bun forward flags directly:
pnpm create hono-preact my-app --adapter node --ui --yes
# npm needs a `--` separator before tool flags:
npm create hono-preact my-app -- --adapter node --ui --yes
Options#
| Flag | Description |
|---|---|
--adapter <cloudflare|node> | Choose the deployment target (prompted otherwise). |
--ui, --no-ui | Include or exclude hono-preact-ui components. |
--no-install | Skip the dependency install step. |
--no-git | Skip git init. |
-y, --yes | Accept defaults for anything not specified (no prompts). |
--skip-hints | Suppress the "Next steps" note. |
--version, -v | Print the CLI version. |
--help, -h | Print usage. |
In a non-interactive shell (CI, piped input), the CLI never prompts: it uses your flags plus defaults (adapter
cloudflare, UI off, install on, git on), and a missing directory is an error. Withnpm, put tool flags after--.
Add agent guidance to an existing app#
If you added hono-preact to a project you did not scaffold (for example with
pnpm add hono-preact), drop in the guidance an AI coding agent reads:
npx create-hono-preact add-agents
It writes AGENTS.md (framework conventions for any AI coding agent), a one-line CLAUDE.md pointer, an agents/skills/ directory of step-by-step recipes (add a page, a loader, an action, a guard), and agents/llms-full.txt (the full documentation bundled for offline reference). Existing files are left untouched unless you pass --force.
| Flag | Default | Description |
|---|---|---|
--force | off | Overwrite existing files (AGENTS.md, CLAUDE.md, agents/skills/*.md, agents/llms-full.txt). |
See Quick Start for the full walkthrough.