Alloy CLI Frontend is a command-line tool that installs a GitHub Copilot agent (@alloy) and scans your project's type definitions to build a model registry. The Copilot agent generates frontend components following Atomic Design patterns directly from VS Code Copilot Chat using natural language.
- Prerequisites
- Quick Start
- Commands
- Version Differences (v1 vs v2)
- Copilot Agent & Skills
- Contributing
- License
- Node.js β₯ 20
- VS Code with GitHub Copilot Chat enabled
- A TypeScript/React project using Atomic Design conventions
# 1. Install the Copilot agent and skills
npx alloy-cli-frontend init
# 2. Scan your type definitions to build the model registry
npx alloy-cli-frontend scan
# 3. Restart VS Code, open Copilot Chat, and start generating
# @alloy Create an atom Button with label, onClick, and disabled. Prefix: acmeThe tool is designed to be run via npx in your project root β no global install needed. This keeps the agent and skills in sync with your project.
Installs the Copilot agent and skills into your project. This copies the .github/agents/, .github/skills/, and .github/instructions/ files that power the @alloy Copilot Chat agent.
npx alloy-cli-frontend initYou'll be guided through two interactive prompts:
- Template version β choose v1 or v2 (see Version Differences)
- Categories to install β select which file groups to copy:
| Category | Description |
|---|---|
| Alloy Agent | The @alloy orchestrator agent |
| Generation Skills | Atom, molecule, organism, and page generators |
| Template Skills | Blueprints for component, style, state, type, data, page, and template files |
| Utility Skills | Model property resolution |
Existing files are skipped by default. Use --force to overwrite:
npx alloy-cli-frontend init --forceScans your project's type definition files (src/_types/*.d.ts) and generates a model registry (.alloy-models.json) at the project root. The @alloy agent reads this registry to resolve property types instantly β instead of grepping through .d.ts files on every invocation.
npx alloy-cli-frontend scanYour type definitions must extend BasedAtomicModel for the scanner to detect them. Both syntaxes are supported:
// v1 β interface syntax
interface ButtonModel extends BasedAtomicModel { /* ... */ }
// v2 β type alias syntax
type ButtonModel = BasedAtomicModel & { /* ... */ }The scanner looks for three files β atoms.d.ts, molecules.d.ts, and organisms.d.ts β inside the type definitions directory and produces a categorized registry:
{
"atoms": ["ButtonModel", "ImageModel"],
"molecules": ["SearchBarModel"],
"organisms": ["HeaderModel", "ProductCardModel"]
}| Option | Description | Default |
|---|---|---|
-td, --type-directory <dir> |
Type definitions directory (relative to src/) |
_types |
When running init you choose between two template versions. The core Atomic Design structure is the same; the differences are in file naming and import style:
| Aspect | v1 | v2 |
|---|---|---|
| Component files | ComponentName.tsx, ComponentName.scss |
index.tsx, index.scss |
| Data files | componentNameCamelCase.ts |
component-name-kebab-case.ts |
| Type definitions | interface β¦ extends BasedAtomicModel |
type β¦ = BasedAtomicModel & { } |
| Imports | Explicit (import { Model } from '@_types/types') |
Implicit (auto-import / no explicit path) |
Choose v2 for new projects. Use v1 if your existing codebase already follows v1 conventions.
Alloy CLI Frontend includes a GitHub Copilot agent that brings component generation directly into VS Code Copilot Chat. Describe what you want in natural language and the agent generates all the files for you.
After running init, the following files are added to your project's .github/ directory:
| Category | Files | Purpose |
|---|---|---|
| Agent | alloy.agent.md |
Orchestrator that parses your request and delegates to skills |
| Generation Skills | 4 skills | Generate atoms, molecules, organisms, and pages |
| Template Skills | 8 skills | Embedded template blueprints for every file type |
| Utility Skills | 1 skill | Smart property type resolution |
Restart VS Code (or reload the window) after running
initto activate the agent.
Open Copilot Chat in VS Code and mention @alloy to invoke the agent:
@alloy Create an organism called ProductCard with title, description, image, and price.
Include style, state, script, and a page view with data.
Prefix: xx
The agent will:
- Parse your request β extract component type, name, prefix, optional files, and properties
- Resolve property types β infer TypeScript types from property names (e.g.,
titleβstring,itemsβunknown[],onClickβ() => void) - Confirm the plan β show you a summary of all files to be generated
- Generate files β create every file using the correct Atomic Design conventions
- Populate models β fill in the TypeScript interface with resolved properties
@alloy Create an atom Button with label, onClick, disabled, and variant. Prefix: acme
@alloy Generate a molecule SearchBar with placeholder, onSearch, and isLoading. Include style and state. Prefix: xx
@alloy Create a page for an existing organism called HeroBanner
@alloy What files would an organism with a page view generate?
| Skill | Description |
|---|---|
generate-atom |
Scaffolds an atom component with all optional files |
generate-molecule |
Scaffolds a molecule component with all optional files |
generate-organism |
Scaffolds an organism component with page, template, data, and all optional files |
generate-page |
Creates a standalone page and template component |
tpl-component |
Component .tsx file template |
tpl-template |
Template wrapper .tsx file (works for all component types) |
tpl-page |
Standard page file template |
tpl-page-story |
Story collection page template |
tpl-data |
Data/props file template |
tpl-state |
State JSON file template |
tpl-style |
SCSS style file template |
tpl-type |
TypeScript interface/type definition template |
resolve-model-properties |
Resolves property names into typed TypeScript interface fields |
Contributions are welcome! To get started:
- Fork the repository
- Clone your fork and install dependencies:
bun install
- Run the CLI locally:
bun run cli -- <command>
- Run tests:
bun run test - Create a feature branch, commit your changes, and open a pull request
This project is licensed under the MIT License. See the LICENSE file for details.