API / @aihu/cli

@aihu/cli

Compiler & tooling

Aihu CLI (`aihu`, `create-aihu`) — scaffolding, dev, build commands.

version
1.0.0
exports
28
values
23
types
5
01

appAboutAihu

function
function appAboutAihu(appName: string = 'app'): string

src/pages/about.aihu — a second route, emitted by the `full` template to demonstrate the router resolving more than one page.

02

appAihuConfig

function
function appAihuConfig(): string

aihu.config.ts — kept for server/SSR config; optional for client-only apps.

03

appDefaultLayout

function
function appDefaultLayout(): string

src/layouts/default.aihu for Hello World (v1 syntax).

04

appDocsGuideAihu

function
function appDocsGuideAihu(appName: string = 'app'): string

src/pages/guide.aihu — second docs route for the `docs` template.

05

appDocsIndexAihu

function
function appDocsIndexAihu(appName: string = 'app'): string

src/pages/index.aihu for the `docs` template — a docs-flavored landing page.

06

appIndexAihu

function
function appIndexAihu(appName: string = 'app', withCssEngine = false): string

src/pages/index.aihu for Hello World (v1 syntax).

07

appIndexHtml

function
function appIndexHtml(name: string): string

index.html for a new aihu application.

08

appMainTs

function
function appMainTs(_name: string): string

src/main.ts entry point for a new aihu app.

09

appPackageJson

function
function appPackageJson( name: string, pm: PkgManager = 'bun', withCssEngine = false, ): string

package.json for a new aihu application.

10

appTsConfig

function
function appTsConfig(): string

tsconfig.json for a new aihu application.

11

appViteConfig

function
function appViteConfig( appName = 'app', withCssEngine = false, shadowMode: ShadowChoice = 'shadow', ): string

vite.config.ts for a new aihu application.

12

appVscodeExtensions

function
function appVscodeExtensions(): string

.vscode/extensions.json — recommends the aihu language extension.

13

appVscodeSettings

function
function appVscodeSettings(): string

.vscode/settings.json — file associations and editor wiring for .aihu.

14

componentAihu

function
function componentAihu(name: string): string

A component file for a given component name.

15

pageAihu

function
function pageAihu(routePath: string): string

A page file for a given route path.

16

pluginIndex

function
function pluginIndex(name: string): string

src/index.ts for a new aihu plugin.

17

pluginPackageJson

function
function pluginPackageJson(name: string): string

package.json for a new aihu plugin.

18

scaffoldApp

function
function 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 }, ): ScaffoldResult

Scaffold a new aihu application at `<outDir>/<name>/`.

19

scaffoldComponent

function
function scaffoldComponent(name: string, outDir?: string): ScaffoldResult

Scaffold a component file under `src/components/`.

20

scaffoldPage

function
function scaffoldPage(routePath: string, outDir?: string): ScaffoldResult

Scaffold a page file under `src/pages/`.

21

scaffoldPlugin

function
function scaffoldPlugin(name: string, outDir?: string): ScaffoldResult

Scaffold a plugin package directory.

22

toKebab

function
function toKebab(name: string): string
23

toSafe

function
function toSafe(name: string): string

Convert a project name to a safe JS identifier (for use as rolldown input key or custom-element tag name component).

24

ScaffoldResult

interface
interface ScaffoldResult {
  /** Files that were written. */
  readonly created: ReadonlyArray<string>
  /** Files skipped because they already existed. */
  readonly skipped: ReadonlyArray<string>
}
25

AppTemplate

type
type AppTemplate = 'minimal' | 'full' | 'docs' | 'agent'
26

CssChoice

type
type CssChoice = 'engine' | 'none'

Out-of-the-box CSS strategy for a scaffolded app.

27

PkgManager

type
type PkgManager = 'bun' | 'pnpm' | 'npm' | 'yarn'
28

ShadowChoice

type
type ShadowChoice = 'light' | 'shadow'

Shadow-DOM mode threaded into the compiler when css-engine is opted in.