create-fragment
v1.0.1
Published
Scaffold multi-surface AI applications with pre-wired agent connections (Electron, VS Code, TUI)
Downloads
24
Maintainers
Readme
Fragment
A scaffold CLI for building multi-surface AI applications. Generate a monorepo with shared core logic and UI components that deploy to Electron, VS Code, and terminal (TUI) — each wired to talk to Claude, Codex, and Gemini.
Quick Start
npm create fragment my-app -- --all
cd my-appOr with specific surfaces:
npx create-fragment init my-app --electron --vscode --tui --author "YourName"What You Get
my-app/
packages/
core/ # Shared state, event bus, controllers
ui/ # React components (chat, timeline, model selector)
apps/
electron/ # Electron app with Forge, Vite, agent IPC
vscode/ # VS Code extension with sidebar + panel webviews
tui/ # Bubble Tea TUI with three-pane layout (Go)Surfaces
| Surface | Stack | Agent Transports | |---------|-------|------------------| | Electron | Vite + React + Forge | IPC to main process | | VS Code | esbuild + React webviews | Extension host commands | | TUI | Bubble Tea + Lip Gloss | CLI subprocess |
Each surface ships with agent adapters for Claude, Codex, and Gemini, a chat panel, brand panel, and tool timeline.
CLI Commands
# Via npm create (recommended)
npm create fragment my-app -- --all
# Or via npx
npx create-fragment init <name> # Scaffold a new project
npx create-fragment add <surface> # Add a surface to an existing project
# Or install globally
npm i -g create-fragment
fragment init <name>
fragment add <surface>Plugin System
AI plugins can be wired into surfaces using the companion fragment-plugin. See plugins/ for the submodule.
Development
npm test # Run CLI tests
npm run build # Compile TypeScriptProject Structure
| Path | Description |
|------|-------------|
| packages/fragment-cli/ | CLI tool — init, add, copier engine, token replacement |
| packages/fragment-cli/templates/ | Surface templates copied during scaffold |
| plugins/fragment-plugin/ | Claude Code plugin for wiring AI into surfaces (submodule) |
License
MIT
