Installation
Prerequisites
aihu requires one of the following runtimes:
- Bun ≥1.3.0 (recommended — faster installs, native TypeScript, built-in test runner)
- Node.js ≥20.18.0 with a package manager of your choice (npm, pnpm, or yarn)
Scaffold a new application
Use the @aihu/cli to generate a new project:
# Bun (recommended)
bunx @aihu/cli app my-app
# npm
npm create aihu@latest my-appNote. The ≤5 minute quick start is conditional until pre-built
aihu-compilebinaries ship. Today the scaffolder builds the Rust SFC compiler from source on first run, which adds a one-time toolchain step. Once the GitHub Actions release workflow publishes platform binaries, the install becomes a single download and this note will be removed.
The scaffolder generates the following files:
my-app/
package.json
vite.config.ts
tsconfig.json
index.html
src/
main.ts
pages/
index.aihu
.vscode/
extensions.json
settings.json
AGENTS.md
CLAUDE.md
.mcp.jsonpackage.json— workspace manifest with@aihu/app,@aihu/runtime,@aihu/signals,@aihu/arbor, and@aihu/routeras dependencies, plus@aihu-plugin/agent-readiness,@aihu/cli,@aihu/compiler,@aihu/tsc, TypeScript, and Vite as devDependencies.vite.config.ts— the whole aihu configuration surface: a singleviteAihuPlugin({...})from@aihu/appthat composes the Rust compiler and the router, and takes the agent-readiness surface inline via itsagentReadinessoption. Config lives here rather than in a separateaihu.config.tsso theaihuCLI and the language server read one file and cannot drift. (A standaloneaihu.config.tsstill works as a legacy fallback, but the scaffold no longer emits one.)tsconfig.json— TypeScript configuration;bun run typecheckrunsaihu-tscagainst it.index.html— the HTML entry document; loadssrc/main.tsas a module.src/main.ts— the client bootstrap:createApp()from@aihu/app/client.src/pages/index.aihu— the Hello World SFC with@route,@state,@template, and@styleblocks..vscode/— recommended extensions and editor settings for working with.aihufiles.AGENTS.md,CLAUDE.md,.mcp.json— coding-agent tooling files; pass--no-agent-toolingto the scaffolder to omit them.
Install and run
cd my-app
bun install
bun run devThe dev server starts at http://localhost:5173 with HMR enabled. Edit src/pages/index.aihu and the browser updates automatically — no full reload needed.
Build for production
bun run build
bun run previewbun run build compiles all .aihu files through the Rust SFC compiler, bundles with Vite/Rolldown, and validates against the size budgets defined in .size-limit.json.
bun run preview serves the production build locally so you can verify the output before deploying.