{"id":46683883,"url":"https://github.com/treble-app/cli","last_synced_at":"2026-05-08T21:02:35.871Z","repository":{"id":342056551,"uuid":"1172186672","full_name":"treble-app/cli","owner":"treble-app","description":"Treble is the fastest way to go from Figma to Code","archived":false,"fork":false,"pushed_at":"2026-03-08T23:12:40.000Z","size":420,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-08T23:24:53.081Z","etag":null,"topics":["design","figma","shadcn-ui","ui-ux","wordpress"],"latest_commit_sha":null,"homepage":"https://treble.build","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/treble-app.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-03-04T03:03:18.000Z","updated_at":"2026-03-08T23:12:41.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/treble-app/cli","commit_stats":null,"previous_names":["dev360/treble-cli","treble-app/treble-cli"],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/treble-app/cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treble-app%2Fcli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treble-app%2Fcli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treble-app%2Fcli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treble-app%2Fcli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/treble-app","download_url":"https://codeload.github.com/treble-app/cli/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/treble-app%2Fcli/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30279765,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-08T20:45:49.896Z","status":"ssl_error","status_checked_at":"2026-03-08T20:45:49.525Z","response_time":56,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["design","figma","shadcn-ui","ui-ux","wordpress"],"created_at":"2026-03-09T01:01:20.085Z","updated_at":"2026-05-08T21:02:35.858Z","avatar_url":"https://github.com/treble-app.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# treble\n\nFigma to production code. Syncs your design to disk, analyzes it with AI, builds every component, and visually verifies the result — all from your terminal.\n\n```bash\nnpm install -g @treble-app/cli\n```\n\n## How it works\n\n```mermaid\nflowchart LR\n    A[\"🎨 Figma\"] --\u003e|treble sync| B[\"📁 Local files\"]\n    B --\u003e|/treble:plan| C[\"📋 Analysis\"]\n    C --\u003e|/treble:dev| D[\"⚡ Code\"]\n    D --\u003e|/treble:cms| E[\"🚀 Production\"]\n```\n\n1. **`treble sync`** pulls your Figma frames to disk — screenshots, layer trees, and visual properties. No API calls after the first sync.\n2. **`/treble:plan`** reads the synced data and produces a component inventory with design tokens, build order, and responsive rules.\n3. **`/treble:dev`** classifies your design, picks the right stack, scaffolds the project, and runs the build loop.\n4. **`/treble:cms`** wires up content editability — Sanity, Prismic, or WordPress.\n\n### The build loop\n\nEach component goes through a code → review → fix cycle until it matches the Figma reference:\n\n```mermaid\nflowchart TD\n    A[\"Pick next component\"] --\u003e B[\"Generate code\"]\n    B --\u003e C[\"Screenshot implementation\"]\n    C --\u003e D{\"Matches\\nFigma?\"}\n    D -- \"No\" --\u003e B\n    D -- \"Yes\" --\u003e E[\"Commit \u0026 advance\"]\n    E --\u003e A\n```\n\nThe output is a real project — `npm run dev` works, components match the Figma design, and the code follows feature-based architecture.\n\n## Quick start\n\n### 1. Install the Claude Code plugin\n\n```bash\nclaude plugin marketplace add treble-app/cli\nclaude plugin install treble\n```\n\n### 2. Install the CLI\n\n```bash\nnpm install -g @treble-app/cli\n```\n\n### 3. Authenticate with Figma\n\n```bash\ntreble login --pat\n```\n\n### 4. Go\n\n```\n/treble:sync          # Checks CLI + auth, helps you pick frames, syncs to disk\n/treble:plan          # Analyzes your design → component inventory + build order\n/treble:dev           # Picks the right stack, scaffolds, builds every component\n/treble:cms           # Wires up CMS (Sanity, Prismic, or WordPress)\n```\n\nThat's it. `/treble:sync` handles initialization, frame selection, and preflight checks — it will tell you if anything is missing.\n\n## CLI reference\n\n```bash\ntreble login --pat                       # Store Figma personal access token\ntreble login                             # OAuth via treble.build (if available)\ntreble status                            # Check auth + project state\ntreble status --json                     # Machine-readable (for agents)\ntreble init --figma \"FIGMA_URL_OR_KEY\"   # Initialize .treble/ in current directory\ntreble sync                              # Pull all Figma frames to disk\ntreble sync -i                           # Interactive frame picker (TUI)\ntreble sync --frame \"Contact\"            # Sync one frame by name\ntreble sync --page \"Homepage\"            # Sync all frames from one page\ntreble sync --force                      # Re-sync even if already cached\ntreble tree \"Contact\"                    # Layer outline (top-level)\ntreble tree \"Contact\" --depth 3          # Layer outline (3 levels deep)\ntreble tree \"Contact\" --verbose          # With fills, fonts, layout, radius\ntreble tree \"Contact\" --root \"55:1234\"   # Subtree from a specific node\ntreble tree \"Contact\" --root \"55:1234\" --json  # Machine-readable output\ntreble show \"NavBar\" --frame \"Contact\"   # Render a node as PNG\ntreble show \"55:1234\"                    # Render by node ID\ntreble extract                           # Extract image assets from synced frames\n```\n\n## Plugin commands\n\nThese run inside Claude Code with the treble plugin installed:\n\n| Command | What it does |\n|---------|-------------|\n| `/treble:sync` | Preflight checks, smart frame selection, sync Figma to disk |\n| `/treble:plan` | Analyze synced Figma data → component inventory, design tokens, build order |\n| `/treble:dev` | Classify design → pick stack → scaffold → build loop with visual review |\n| `/treble:cms` | Wire up CMS editability (Sanity, Prismic, or WordPress) |\n| `/treble:tree` | Interactive layer outline explorer |\n| `/treble:show` | Render a specific Figma node as a screenshot |\n| `/treble:compare` | Visual comparison between Figma reference and implementation |\n\n## Supported stacks\n\n**Deployment targets** (chosen during `/treble:dev`):\n\n| Target | UI Library | Best for |\n|--------|-----------|----------|\n| Next.js | shadcn/ui + Tailwind | Apps, marketing sites, e-commerce — works for everything |\n| Astro | shadcn/ui + Tailwind | Content-heavy sites, blogs, portfolios |\n| WordPress | Basecoat + Tailwind | WordPress hosting, existing WP infrastructure |\n\n**CMS integrations** (wired during `/treble:cms`):\n\n| CMS | Works with | Setup |\n|-----|-----------|-------|\n| Sanity | Next.js, Astro | TypeScript schemas, embedded Studio |\n| Prismic | Next.js, Astro | Slice Machine, slice-based editing |\n| WordPress | WordPress | Gutenberg blocks, ACF fields |\n\n## What gets synced to disk\n\n```\n.treble/\n├── config.toml              # Figma file key\n├── analysis.json            # AI analysis output (components, design system, build order)\n├── build-state.json         # Build progress + deployment config\n└── figma/\n    ├── manifest.json        # Frame inventory\n    └── {frame-slug}/\n        ├── reference.png    # Full frame screenshot\n        ├── nodes.json       # Complete layer tree with visual properties\n        ├── sections/        # Section-level screenshots\n        └── snapshots/       # On-demand screenshots\n```\n\nAll Figma data lives on disk after `treble sync`. The AI agents read local files — no API calls during planning or building.\n\n## CLI without the plugin\n\nThe CLI works standalone as a Figma development tool:\n\n- `treble sync` — snapshot your design to disk\n- `treble tree` — inspect layer hierarchy with visual properties\n- `treble show` — render any node as a PNG\n- `treble extract` — pull image assets\n\nYou just won't get the AI-powered analysis and code generation.\n\n## Plugin without the CLI\n\nThe plugin needs the CLI to access Figma data. If the CLI isn't installed, the plugin will warn you on session start:\n\n```\nWARNING: treble CLI not found. Install it: npm install -g @treble-app/cli\n```\n\n## Requirements\n\n- Node.js 18+\n- [Claude Code](https://claude.ai/code) (for the plugin)\n- A Figma account with a [personal access token](https://www.figma.com/settings)\n\n## License\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftreble-app%2Fcli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftreble-app%2Fcli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftreble-app%2Fcli/lists"}