Vectis CLI
AI-driven design engineering CLI for Penpot. Generate, audit and analyze UI boards from your terminal.
Ask AI about Vectis CLI
Powered by Claude ยท Grounded in docs
I know everything about Vectis CLI. Ask me about installation, configuration, usage, or troubleshooting.
0/500
Reviews
Documentation
Vectis is a slash-command REPL that connects to a self-hosted Penpot instance via its official MCP server and uses the Claude API for AI-powered design generation, auditing, and analysis, all from your terminal.
The CLI is the brain. Each project folder is its memory. Penpot is the canvas. Slash commands are the language.
@referencesare the inputs.
Features
| Feature | What it does |
|---|---|
/create pipeline | Natural language โ validated LayoutSpec โ ASCII preview โ push to Penpot (flex + grid) |
@reference system | Inject files, folders, Penpot boards, images, tokens, and selections into AI context |
/structure onboarding | Conversational brief-to-structure: generates flows, screens, and context files |
| 30+ slash commands | Setup, generation, auditing, analysis, flow navigation, skills, history |
| Skills system | Extend AI with project-local, global, or community skill files (markdown โ prompt) |
| Live Penpot bridge | MCP client for canvas ops + WebSocket for real-time selection/shape events |
| SQLite graph store | Persistent project graph (flows, screens, boards, tokens) with migrations |
| Conversation history | Stored, resumable sessions with auto-compaction at token limits |
| Vim mode | Modal editing, paste mode, customizable keybindings |
Installation
Prerequisites
| Dependency | Version | Purpose |
|---|---|---|
| Bun | >= 1.0 | Runtime |
| Penpot | Self-hosted or cloud | Design canvas |
| Penpot MCP Server | mcp/ directory | Canvas bridge |
| Anthropic API Key | - | AI features |
Setup
# Clone and install
git clone https://github.com/dinethlive/vectis-cli.git
cd vectis-cli
bun install
# Start in dev mode
bun run dev
# Run the setup wizard (configures API key, Penpot URLs)
# Inside the REPL:
/init
Penpot + MCP Server
Vectis expects a Penpot instance and its MCP server running locally. Everything you need is in docs/penpot-setup/:
cd docs/penpot-setup
bash start-penpot.sh # Start Penpot (Docker) โ http://localhost:9001
bash setup-mcp.sh # First time: clone Penpot repo + install MCP deps
bash start-mcp.sh # Start MCP server โ ports 4400/4401/4402
| Port | Protocol | Service |
|---|---|---|
| 9001 | HTTP | Penpot UI |
| 4401 | HTTP | MCP Streamable HTTP (/mcp) |
| 4402 | WebSocket | Live events |
See the full setup guide for plugin connection, troubleshooting, and more.
Quick Start
bun run dev
โญโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ
โ โ
โ โโโ โโโโโโโโโโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โโโ โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ โ
โ โโโ โโโโโโโโโ โโโ โโโ โโโโโโโโโโโ โ
โ โโโโ โโโโโโโโโโ โโโ โโโ โโโโโโโโโโโ โ
โ โโโโโโโ โโโโโโโโโโโโโโโโ โโโ โโโโโโโโโโโ โ
โ โโโโโ โโโโโโโโ โโโโโโโ โโโ โโโโโโโโโโโ โ
โ โ
โ AI-driven design engineering for Penpot โ
โ v0.1.0 ยท Type /help for commands โ
โ โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
vectis >
# Check everything is connected
/doctor
# Scan your Penpot file
/pull
# Generate a UI board from a description
/create Login "A clean login form with email, password, and a sign-in button"
# Ask Claude about your project with context
/ask "what tokens do we use?" @context/tokens.json
# Audit an existing board against design rules
/audit Dashboard/Home
Commands
Setup & Health
| Command | Description |
|---|---|
/init | Setup wizard: API key, Penpot URLs, project config |
/doctor | Validate API key, Penpot connection, MCP server |
/pull | Scan Penpot file for pages, boards, components, tokens |
AI & Design Generation
| Command | Description |
|---|---|
/create <board> "<description>" | Full pipeline: generate spec, validate, preview, push to Penpot |
/ask "<question>" [@refs...] | Ask Claude with optional @file, @folder, @penpot context |
/audit <board> | UX review against design rules and graph constraints |
/analyze <flow> | Deep analysis of an entire flow |
/explain <layer> | Explain a Penpot layer's role and relationships |
Project Navigation
| Command | Description |
|---|---|
/structure | Conversational onboarding: generate flows/screens from brief files |
/flow [name] | Show or switch active flow |
/flows | List all tracked flows |
/checkout <flow> | Switch to a flow and load its context |
Skills & Tokens
| Command | Description |
|---|---|
/skill list|show|add|new|enable|disable | Manage AI skills |
/token pull|push|show|diff | Design token operations |
Session & History
| Command | Description |
|---|---|
/status | Current flow, boards, Penpot connection, tokens |
/context | Show mode, model, project root |
/memory | Loaded skills and token counts |
/usage | Token usage and estimated cost |
/history | List or load past conversations |
/compact | Compress conversation history to save tokens |
/log [n] | Show recent conversation turns |
/pending | List boards awaiting approval |
/approve <flow> | Promote pending board to context |
Misc
| Command | Description |
|---|---|
/help [command] | Detailed help for any command |
/clear | Clear the terminal |
/exit | Save session and quit |
/vim | Toggle vim modal editing |
/keybindings | Show keyboard shortcuts |
/bug | Open a pre-filled GitHub issue |
The /create Pipeline
The core design generation flow:
Description โโโบ Prompt Assembly โโโบ Claude (tool_use) โโโบ Post-Process โโโบ Validate โโโบ Preview โโโบ Penpot
โ โ โ โ โ โ
system prompt + LayoutSpec JSON 4px grid snap Zod schema ASCII tree Plugin JS
skills + tokens + via structured min 32px touch + business renders (flex/grid)
component patterns output tool fill text defaults rules the spec
- Prompt Assembly - System prompt with LayoutSpec schema, design principles, component pattern library (11 patterns), active skills, and detected layout template
- Generation - Claude returns a structured
LayoutSpecviatool_usefor reliable JSON extraction - Post-Processing - Snap to 4px grid, enforce 32px minimum for interactive elements, fill text defaults, warn on low contrast
- Validation - Zod structural validation + business rules (token refs, naming conventions, layout requirements)
- Preview - ASCII tree preview in the terminal
- Push - User chooses: push to Penpot, edit, regenerate, save spec, or quit
@reference System
Pull external context into any AI command:
# Local files
/ask "explain this" @src/components/Button.tsx
# Entire folders
/ask "summarize the brief" @briefs/
# Penpot boards
/ask "what's wrong with this layout?" @penpot:Dashboard/Home
# Penpot shortcuts
@penpot:selection # Currently selected shapes
@penpot:tokens # Design tokens
@penpot:components # Component library
@penpot:page/Dashboard # All boards on a page
# Images
/ask "recreate this" @image:mockup.png
Configuration
Precedence
Environment variables > Project config > Global config > Defaults
Config Files
~/.vectis/config.json # Global (API key, default model)
<project>/.vectis/config.json # Project (Penpot file, MCP URLs, model override)
Global Config
{
"anthropicApiKey": "sk-ant-...",
"defaultModel": "claude-sonnet-4-20250514",
"globalSkillsDir": "~/.vectis/skills"
}
Project Config
{
"penpotFileId": "...",
"penpotFileUrl": "http://localhost:9001/...",
"mcpServerUrl": "http://localhost:4401/mcp",
"wsServerUrl": "ws://localhost:4402",
"model": "claude-sonnet-4-20250514"
}
Environment Variables
| Variable | Purpose |
|---|---|
ANTHROPIC_API_KEY | Claude API key (highest precedence) |
VECTIS_DEBUG | Set to 1 for verbose logging |
Project Structure
src/
index.ts # Entry point
constants.ts # Version, defaults, limits
types/ # VectisError, Config, ReplState, SessionContext
config/ # Layered config loading + Zod schemas
ai/ # Claude client (streaming + tool_use), retry, RAG, prompts
bridge/ # Penpot MCP client + WebSocket listener
references/ # @file, @folder, @penpot, @image resolver + security
workspace/ # Context assembler (system prompt + refs + skills)
graph/ # SQLite graph store, migrations, CRUD
conversation/ # Store, compactor, history
generation/ # Spec pipeline: generator โ postprocess โ validator โ renderer
structure/ # /structure analyser, conversation, writer, differ
skills/ # Registry, loader, installer
context/ # Event processor, pending queue
utils/ # Logger, spinner, platform, JSON output
repl/
theme.ts # Truecolor purple palette (6 shades)
banner.ts # ANSI-shadow gradient banner
prompt.ts # Mode/flow/stream indicators
session.ts # REPL loop, readline, slash dispatch
commands/ # 30+ slash command handlers
... # vim-mode, paste-mode, completer, keybindings, signals
Tech Stack
| Layer | Technology |
|---|---|
| Runtime | Bun |
| Language | TypeScript (strict, NodeNext) |
| AI | @anthropic-ai/sdk |
| Penpot Bridge | @modelcontextprotocol/sdk + WebSocket |
| Database | bun:sqlite (WAL mode) |
| Validation | Zod |
| Testing | Vitest |
| Terminal | picocolors + truecolor ANSI |
Development
# Start dev REPL
bun run dev
# Run tests
bun test
# Type check
bun run lint
# Build for distribution
bun run build
Workspace Layout
When you run /init and /structure, Vectis creates this in your project:
your-project/
โโโ briefs/ # Your messy input files
โโโ .vectis/
โ โโโ config.json # Project config
โ โโโ graph.db # SQLite graph store
โ โโโ skills/ # Project-local skills
โ โโโ conversations/ # Session history
โโโ context/
โ โโโ project.md # Generated by /structure
โ โโโ flows/ # Flow definitions
โ โโโ screens/ # Screen definitions
โ โโโ tokens.json # Design tokens
โโโ specs/ # Saved LayoutSpec files
โโโ exports/ # CSS/Tailwind token exports
License
MIT
Status & Contributing
Vectis is under active development. Expect breaking changes as the core stabilises, but things will improve steadily with each release.
Why this exists: Context loss is the single biggest problem in AI-assisted design today. AI can generate beautiful UIs, but without project context (tokens, flows, screens, constraints) the output is disconnected from reality. Vectis exists to fix that: a CLI that manages and preserves design context, with Penpot as the canvas.
Contributions are welcome. Open an issue for bugs or ideas, or submit a pull request. All feedback helps.
Built by @dinethlive
