llms.txt

create-hudson-app

create-hudson-app scaffolds a new Hudson app with the correct directory structure, boilerplate files, and a development workspace. It follows the Provider + Slots + Hooks pattern described in Building Apps.

Usage

Run from the root of a Hudson project (any directory containing an app/ folder):

bunx create-hudson-app my-tool

The scaffolder walks up from the current directory to find the project root (the nearest parent with an app/ directory), then writes files into app/apps/<app-name>/.

Interactive Mode

With no arguments, the CLI prompts for each option:

bunx create-hudson-app
  create-hudson-app  v0.1.0

  ? App name (kebab-case): my-tool
  ? Description: A custom development tool
  ? Tier:
    1) Minimal   -- Provider + Content + basic hooks (5 files)
    2) Standard  -- + LeftPanel + Inspector + intents (8 files)
    3) Full      -- + tools + Terminal + LeftFooter + manifest (12 files)
  Choose [1/2/3]: 2
  ? Mode (panel/canvas) [panel]: panel

Non-Interactive Mode

Pass all options as flags to skip prompts:

bunx create-hudson-app my-tool \
  --tier standard \
  --mode panel \
  --description "A custom development tool"

Options

FlagValuesDefaultDescription
--tierminimal, standard, fullPromptedControls how many files and slots are generated.
--modepanel, canvaspanelLayout mode for the app.
--description"...""A Hudson app"Short description used in the app definition.
--no-workspacefalseSkip generating a workspace file.
-h, --helpPrint help and exit.

App Name Rules

The app name must be:

  • Lowercase kebab-case (e.g. my-tool, data-browser)
  • Start with a letter
  • Between 2 and 40 characters
  • Contain only lowercase letters, digits, and hyphens

Tiers

The --tier flag controls the complexity of the generated app.

Minimal (5 files)

The simplest starting point. Generates a Provider, Content slot, basic hooks, types, and an index file.

app/apps/my-tool/
  index.ts                # HudsonApp definition
  MyToolProvider.tsx       # React context provider
  MyToolContent.tsx        # Content slot
  hooks.ts                # useCommands + useStatus
  types.ts                # App-specific types

Standard (8 files)

Adds a left panel, inspector, and intent declarations.

app/apps/my-tool/
  index.ts                # HudsonApp definition
  MyToolProvider.tsx       # React context provider
  MyToolContent.tsx        # Content slot
  MyToolLeftPanel.tsx      # Left sidebar slot
  MyToolInspector.tsx      # Right inspector slot
  hooks.ts                # useCommands + useStatus
  intents.ts              # Intent declarations
  types.ts                # App-specific types

Full (12 files)

The complete app scaffold with terminal integration, header actions, a left footer, and a sample tool.

app/apps/my-tool/
  index.ts                # HudsonApp definition
  MyToolProvider.tsx       # React context provider
  MyToolContent.tsx        # Content slot
  MyToolLeftPanel.tsx      # Left sidebar slot
  MyToolLeftFooter.tsx     # Footer below left panel
  MyToolInspector.tsx      # Right inspector slot
  MyToolHeaderActions.tsx  # Navigation bar actions
  MyToolTerminal.tsx       # Embedded terminal slot
  hooks.ts                # useCommands + useStatus
  intents.ts              # Intent declarations
  types.ts                # App-specific types
  tools/
    SampleTool.tsx        # Example tool component

Generated Workspace

Unless --no-workspace is passed, the scaffolder also generates a development workspace file:

app/workspaces/myToolDev.ts
import type { HudsonWorkspace } from '@hudson/sdk';
import { myToolApp } from '../apps/my-tool';

export const myToolDevWorkspace: HudsonWorkspace = {
  id: 'my-tool-dev',
  name: 'My Tool.dev',
  description: 'A custom development tool',
  mode: 'panel',
  apps: [{ app: myToolApp }],
};

Template Variables

The scaffolder replaces the following placeholders in template files:

PlaceholderExample ValueDescription
__APP_NAME__MyToolPascalCase name for components
__APP_ID__my-toolKebab-case ID for registration
__APP_VAR__myToolcamelCase name for variables
__APP_DISPLAY_NAME__My ToolTitle case for UI labels
__APP_DESCRIPTION__A custom development toolDescription string
__APP_MODE__panelLayout mode
__APP_ICON__BoxLucide icon name (auto-detected from app name)

Icon Detection

The scaffolder maps common keywords in the app name to Lucide icon names. For example, my-browser resolves to Globe, code-editor resolves to Code, and data-table resolves to Table. If no keyword matches, the default is Box.

Next Steps After Scaffolding

  1. Import the workspace in app/page.tsx:
import { myToolDevWorkspace } from './workspaces/myToolDev';

// Add to your workspaces array
const workspaces = [myToolDevWorkspace, ...otherWorkspaces];
  1. Start the dev server:
bun dev
  1. Open Hudson at http://localhost:3500 and switch to your new workspace.

  2. Add state to the generated Provider. See Getting Started for the context pattern.

  3. Add commands in hooks.ts. See API Reference for useCommands and useStatus.

  4. Declare intents if your app should respond to LLM or voice commands. See Systems.