Aihu CLI (`aihu`, `create-aihu`) — scaffolding, dev, build commands.
appAboutAihufunction appAboutAihu(appName: string = 'app'): stringsrc/pages/about.aihu — a second route, emitted by the `full` template to demonstrate the router resolving more than one page.
appAihuConfigfunction appAihuConfig(): stringaihu.config.ts — kept for server/SSR config; optional for client-only apps.
appDefaultLayoutfunction appDefaultLayout(): stringsrc/layouts/default.aihu for Hello World (v1 syntax).
appDocsGuideAihufunction appDocsGuideAihu(appName: string = 'app'): stringsrc/pages/guide.aihu — second docs route for the `docs` template.
appDocsIndexAihufunction appDocsIndexAihu(appName: string = 'app'): stringsrc/pages/index.aihu for the `docs` template — a docs-flavored landing page.
appIndexAihufunction appIndexAihu(appName: string = 'app', withCssEngine = false): stringsrc/pages/index.aihu for Hello World (v1 syntax).
appIndexHtmlfunction appIndexHtml(name: string): stringindex.html for a new aihu application.
appMainTsfunction appMainTs(_name: string): stringsrc/main.ts entry point for a new aihu app.
appPackageJsonfunction appPackageJson( name: string, pm: PkgManager = 'bun', withCssEngine = false, ): stringpackage.json for a new aihu application.
appTsConfigfunction appTsConfig(): stringtsconfig.json for a new aihu application.
appViteConfigfunction appViteConfig( appName = 'app', withCssEngine = false, shadowMode: ShadowChoice = 'shadow', ): stringvite.config.ts for a new aihu application.
appVscodeExtensionsfunction appVscodeExtensions(): string.vscode/extensions.json — recommends the aihu language extension.
appVscodeSettingsfunction appVscodeSettings(): string.vscode/settings.json — file associations and editor wiring for .aihu.
componentAihufunction componentAihu(name: string): stringA component file for a given component name.
pageAihufunction pageAihu(routePath: string): stringA page file for a given route path.
pluginIndexfunction pluginIndex(name: string): stringsrc/index.ts for a new aihu plugin.
pluginPackageJsonfunction pluginPackageJson(name: string): stringpackage.json for a new aihu plugin.
scaffoldAppfunction scaffoldApp( name: string, outDir?: string, opts?: { pm?: PkgManager template?: AppTemplate /** `'engine'` includes `@aihu/css-engine` OOTB; `'none'` (default) is the plain scaffold. */ css?: CssChoice /** Shadow mode when css-engine is opted in. Default `'shadow'` (scoped shadow fold). */ shadowMode?: ShadowChoice }, ): ScaffoldResultScaffold a new aihu application at `<outDir>/<name>/`.
scaffoldComponentfunction scaffoldComponent(name: string, outDir?: string): ScaffoldResultScaffold a component file under `src/components/`.
scaffoldPagefunction scaffoldPage(routePath: string, outDir?: string): ScaffoldResultScaffold a page file under `src/pages/`.
scaffoldPluginfunction scaffoldPlugin(name: string, outDir?: string): ScaffoldResultScaffold a plugin package directory.
toKebabfunction toKebab(name: string): stringtoSafefunction toSafe(name: string): stringConvert a project name to a safe JS identifier (for use as rolldown input key or custom-element tag name component).
ScaffoldResultinterface ScaffoldResult {
/** Files that were written. */
readonly created: ReadonlyArray<string>
/** Files skipped because they already existed. */
readonly skipped: ReadonlyArray<string>
}AppTemplatetype AppTemplate = 'minimal' | 'full' | 'docs' | 'agent'CssChoicetype CssChoice = 'engine' | 'none'Out-of-the-box CSS strategy for a scaffolded app.
PkgManagertype PkgManager = 'bun' | 'pnpm' | 'npm' | 'yarn'ShadowChoicetype ShadowChoice = 'light' | 'shadow'Shadow-DOM mode threaded into the compiler when css-engine is opted in.