
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
Command-line interface for scaffolding and managing HAI3 framework projects.
@hai3/cli provides a comprehensive set of commands for creating new HAI3 applications, generating screensets, managing project structure, and maintaining framework dependencies. The CLI streamlines project setup and ongoing development by automating common tasks and enforcing framework conventions.
This package eliminates manual project configuration and boilerplate creation. It generates properly structured HAI3 projects with all necessary dependencies, build configurations, and development tools pre-configured. The CLI ensures projects follow framework best practices from the start and provides utilities for maintaining that structure as projects evolve.
Initialize new HAI3 applications with complete project structure, dependency management, and build tooling. The creation process offers interactive prompts for customizing the initial setup, including UI Kit selection and development overlay inclusion.
Create new screensets with proper directory structure, ID management, and template files. Screensets generate with all required files including configuration, screen components, translations, and event handlers.
Copy existing screensets while automatically transforming all IDs and namespaces to prevent conflicts. This command updates screenset IDs, screen IDs, translation keys, event names, and icon references throughout all files in the source screenset.
Update the CLI itself and all HAI3 framework packages to their latest versions. The command detects whether it's running inside a project or standalone and adjusts its behavior accordingly.
npm install -g @hai3/cli
Global installation makes the hai3 command available system-wide for creating new projects anywhere on your system.
npm install --save-dev @hai3/cli
Install as a dev dependency when using CLI commands within project scripts or when global installation isn't preferred.
hai3 create <project-name>Creates a new HAI3 project or SDK layer package with the specified name.
Options:
--layer, -l - Create a package for a specific SDK layer (sdk, framework, react)--uikit - UI Kit to use (hai3 or custom)--studio / --no-studio - Include or exclude Studio package--no-git - Skip git initialization--no-install - Skip npm installInteractive Options (when --layer not specified):
Output (App Project - default):
Output (Layer Package):
hai3 screenset create <name>Generates a new screenset with proper structure and template files.
Options:
--category - Specify screenset category (drafts, mockups, production)Generated Structure:
hai3 screenset copy <source> <target>Duplicates an existing screenset with automatic ID transformation.
Options:
--category - Target screenset categoryTransformations Applied:
hai3 updateUpdates CLI and framework packages to latest versions.
Options:
--alpha, -a - Update to latest alpha/prerelease version--stable, -s - Update to latest stable version--templates-only - Only sync templates (skip CLI and package updates)--skip-ai-sync - Skip running AI sync after updateChannel Detection: By default, the command auto-detects which channel to use based on the currently installed CLI version. If you have an alpha version installed, it updates from the alpha channel. If you have a stable version, it updates from the stable channel.
Behavior:
hai3 update layoutUpdates layout components from the latest templates.
Options:
--ui-kit, -u - UI kit to use (hai3-uikit or custom)--force, -f - Force update without promptingBehavior: Auto-detects current UI kit from existing layout files and prompts for confirmation before overwriting.
hai3 scaffold layoutGenerates layout components in your project from templates.
Options:
--ui-kit, -u - UI kit to use (hai3-uikit or custom, default: hai3-uikit)--force, -f - Overwrite existing layout filesGenerated Components:
src/layout/Layout.tsx - Main layout orchestratorsrc/layout/Header.tsx - Header componentsrc/layout/Footer.tsx - Footer componentsrc/layout/Menu.tsx - Navigation menusrc/layout/Sidebar.tsx - Sidebar componentsrc/layout/Screen.tsx - Screen content areasrc/layout/Popup.tsx - Popup/modal containersrc/layout/Overlay.tsx - Overlay componentsrc/layout/index.ts - Barrel exportshai3 ai syncSyncs AI assistant configuration files across multiple IDEs.
Options:
--tool, -t - Specific tool to sync (claude, copilot, cursor, windsurf, all)--detect-packages, -d - Detect installed @hai3 packages and merge their configsGenerated Files:
CLAUDE.md - Claude Code configuration with command adapters in .claude/commands/.github/copilot-instructions.md - GitHub Copilot instructions.cursor/rules/hai3.mdc - Cursor rules with command adapters.windsurf/rules/hai3.md - Windsurf rules with workflow adaptersSource Files:
Reads from .ai/GUIDELINES.md and .ai/commands/ directory to generate IDE-specific configurations.
Created projects follow HAI3's standard monorepo-style structure with clear separation between framework packages, application code, screensets, themes, and configuration.
Projects ship with Vite configured for optimal development and production builds, TypeScript with strict mode enabled, and Tailwind CSS with framework theme integration.
Includes ESLint with custom framework rules, TypeScript strict mode checking, dependency validation through Dependency Cruiser, and architecture test setup.
Generated projects include scripts for development server, production builds, type checking, linting, architecture validation, and cleanup operations.
HAI3 supports two UI kit configurations when creating projects or scaffolding layout components.
The hai3-uikit option generates layout components that import from @hai3/uikit. This option is recommended for most projects as it provides pre-built, theme-aware components that integrate seamlessly with the HAI3 framework.
hai3 create my-project --uikit=hai3
hai3 scaffold layout --ui-kit=hai3-uikit
The custom option generates placeholder layout components without any @hai3/uikit imports. Use this when you want to integrate your own UI library (Material UI, Chakra, etc.) or build components from scratch.
hai3 create my-project --uikit=custom
hai3 scaffold layout --ui-kit=custom
HAI3 uses a 3-layer SDK architecture. When building custom packages that extend the framework, use the --layer option to generate properly configured package scaffolding.
┌─────────────────────────────────────────┐
│ React Layer (react) │
│ React hooks, components, UI bindings │
│ Depends on: Framework + React │
├─────────────────────────────────────────┤
│ Framework Layer (framework) │
│ Redux store, events, registries │
│ Depends on: SDK packages │
├─────────────────────────────────────────┤
│ SDK Layer (sdk) │
│ Pure TypeScript, no dependencies │
│ Contracts, utilities, types │
└─────────────────────────────────────────┘
# SDK layer - pure TypeScript, no HAI3 dependencies
hai3 create my-contracts --layer=sdk
# Framework layer - depends on @hai3/events, @hai3/store
hai3 create my-store-extension --layer=framework
# React layer - depends on @hai3/framework + React
hai3 create my-hooks --layer=react
Each layer has specific peer dependency requirements enforced by the generated configuration:
| Layer | Allowed Dependencies |
|---|---|
| SDK | None (pure TypeScript) |
| Framework | @hai3/events, @hai3/store |
| React | @hai3/framework, react, react-dom |
Layer packages include:
my-package/
├── src/
│ └── index.ts # Entry point
├── .ai/
│ ├── GUIDELINES.md # Layer-specific rules
│ └── rules/
│ └── _meta.json # Layer metadata for AI tools
├── package.json # With correct peer deps
├── tsconfig.json # Layer-appropriate config
├── eslint.config.js # Boundary enforcement
├── tsup.config.ts # Build configuration
└── README.md # Layer documentation
Generated packages include AI assistant configurations that understand layer boundaries:
The AI tools will warn you if you attempt to import from a higher layer (e.g., importing React hooks in an SDK package).
When using the custom UI kit option, you receive placeholder components that you need to implement with your preferred UI library. Here's how to customize each component:
Each generated layout component follows this pattern:
// src/layout/Header.tsx (custom template)
import React from 'react';
export interface HeaderProps {
children?: React.ReactNode;
}
export const Header: React.FC<HeaderProps> = ({ children }) => {
return (
<header className="h-14 border-b border-border bg-background flex items-center px-4">
{/* Replace with your UI library components */}
{children}
</header>
);
};
Material UI Example:
import React from 'react';
import { AppBar, Toolbar } from '@mui/material';
export const Header: React.FC<HeaderProps> = ({ children }) => {
return (
<AppBar position="static">
<Toolbar>{children}</Toolbar>
</AppBar>
);
};
Chakra UI Example:
import React from 'react';
import { Box, Flex } from '@chakra-ui/react';
export const Header: React.FC<HeaderProps> = ({ children }) => {
return (
<Box as="header" borderBottomWidth="1px" bg="white" px={4} h={14}>
<Flex align="center" h="full">{children}</Flex>
</Box>
);
};
Custom layout components should still use HAI3's Redux hooks for state management:
import { useAppSelector, useAppDispatch } from '@hai3/react';
import { selectMenuItems, selectSidebarOpen } from '@hai3/uicore';
export const Menu: React.FC = () => {
const menuItems = useAppSelector(selectMenuItems);
const dispatch = useAppDispatch();
// Render menu items with your UI library
};
Custom components should respect HAI3's theme system. Use CSS variables or Tailwind theme tokens:
// Using Tailwind CSS (included by default)
<div className="bg-background text-foreground border-border">
// Using CSS variables
<div style={{ backgroundColor: 'var(--background)', color: 'var(--foreground)' }}>
The CLI exposes a programmatic API for use in build scripts, automation tools, or custom workflows. Import command executors and invoke them with configuration objects.
import { executeCommand, commands } from '@hai3/cli';
// Create a new project
const result = await executeCommand(
commands.createCommand,
{ projectName: 'my-app', uikit: 'hai3', studio: true },
{ interactive: false }
);
// Create a screenset
await executeCommand(
commands.screensetCreateCommand,
{ name: 'billing', category: 'drafts' },
{ interactive: false }
);
// Run AI sync
await executeCommand(
commands.aiSyncCommand,
{ tool: 'all', detectPackages: true },
{ interactive: false }
);
CLI ships with comprehensive template files that new projects copy. These templates stay synchronized with the main HAI3 repository, ensuring new projects always use current best practices.
Alpha Release (0.1.0-alpha.0) - Commands and APIs may change before stable release.
Apache-2.0
https://github.com/HAI3org/HAI3
@hai3/uicore - Core framework package@hai3/uikit - UI component library@hai3/studio - Development tools overlayFAQs
HAI3 CLI - Project scaffolding and screenset management tools
We found that @hai3/cli demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.