open-design
OpenDesign — local-first design app exposed to coding agents over MCP. Install once with your agent's plugin command and projects/files/skills are reachable through stdio.
Safety scan
A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.
Check it deeper on your machine
It has changed since its scan on 11 Nov 2026. Its scripts were only partly scanned.
As a Claude Code plugin, install it and then ask Claude Code:
/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/nexu-io/open-design with scanskillsafety
Or from a terminal, clone it and run it:
git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/nexu-io/open-design'
It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.
Badge for your README
Markdown
[](/listings/nexu-io-open-design)HTML
<a href="/listings/nexu-io-open-design"><img src="/api/listings/nexu-io-open-design/badge.svg" alt="findsafeskills safety rating" /></a>Install
Install instructions from the README
As written by the repo's author. findsafeskills has not verified these steps.
These steps run a script from the network that findsafeskills does not scan.
🖥️ Download the desktop app (recommended — zero config)
The fastest way to use OpenDesign. No Node, no pnpm, no clone.
- **macOS** (Apple Silicon · Intel x64) → [**open-design.ai**](https://open-design.ai/?utm_source=github&utm_medium=referral&utm_content=readme_download_macos) or [GitHub Releases](https://github.com/nexu-io/open-design/releases) - **Windows** (x64) → [**open-design.ai**](https://open-design.ai/?utm_source=github&utm_medium=referral&utm_content=readme_download_windows) or [GitHub Releases](https://github.com/nexu-io/open-design/releases) - **Linux** → No prebuilt Linux artifact is currently published in the official releases. For now, [run OpenDesign from source](#-run-from-source); Linux release work is tracked in [#4368](https://github.com/nexu-io/open-design/issues/4368).
After install: the app auto-detects every coding-agent CLI on your `PATH`, loads 100+ functional skills, the separate rendering-template catalog, and 151 design systems, and lets you type a brief in the entry view.
🤖 Install into your coding agent (no UI)
You can use OpenDesign without ever opening the GUI — call it as a skill, plugin, or MCP server inside Claude Code, Codex, Cursor, Copilot, OpenClaw, Antigravity, Hermes, Kimi, and more.
If you installed the macOS desktop app via the DMG or Homebrew cask, your shell may still resolve `od` to Apple's built-in `/usr/bin/od` octal-dump utility. In that case, open **Settings → MCP server** in the desktop app and copy the client-specific snippet; it uses absolute paths and does not rely on the bare `od` command.
# One-line install into the agent you're using: od mcp install <agent> # <agent> = claude | codex | reasonix | raven | cursor | copilot | openclaw # | antigravity | pi | vibe | hermes | cline | kimi | kiro # | trae | opencode # Hosted equivalent for curl-based setup: curl -fsSL https://open-design.ai/install.sh | sh -s <agent>
`install.sh` is a thin shell wrapper around `od mcp install`; it exists so the hosted URL returns shell instead of the landing-page HTML fallback and fails fast if your shell resolves a non-Open-Design `od` binary.
> **macOS / WSL2 users:** `/usr/bin/od` is a system octal-dump command and can > shadow OpenDesign's `od` command. Desktop-app users should prefer the > **Settings → MCP server** snippet; WSL2 users should follow the > [`WSL2 setup guide`](docs/wsl-setup.md) first.
Then, inside the agent:
> Use open-design to generate a landing page with the Linear design system
In a filesystem-backed local CLI run, the agent composes the selected functional skill or design template with your `DESIGN.md`, writes the canonical project files, and OpenDesign previews those files. A BYOK/plain-API run without filesystem tools instead returns one complete `<artifact>` block.
🐳 Run with Docker
git clone https://github.com/nexu-io/open-design.git cd open-design/deploy cp .env.example .env echo "OD_API_TOKEN=$(openssl rand -hex 32)" >> .env docker compose up -d # open http://127.0.0.1:7456
If the browser asks for credentials, use `open-design` as the username and the `OD_API_TOKEN` value from `deploy/.env` as the password. This keeps Docker bridge traffic authenticated without requiring host networking. API clients can keep using `Authorization: Bearer <OD_API_TOKEN>`.
🚀 Deploy on Sealos
The Sealos App Store template runs the published OpenDesign Docker image with persistent workspace storage and Basic Auth on the public proxy. For custom public or shared Docker deployments, follow the reverse-proxy and `OPEN_DESIGN_ALLOWED_ORIGINS` guidance in [`deploy/README.md`](deploy/README.md#local-compose).
🧑💻 Run from source
git clone https://github.com/nexu-io/open-design.git cd open-design corepack enable && pnpm install pnpm tools-dev run web
Open the URL printed by `tools-dev`; development ports are allocated dynamically unless you pass explicit port flags.
What was scanned
The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.
.claude-plugin/marketplace.json · Manifest · 16 lines
View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)
This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.
- {
- "$schema": "https://raw.githubusercontent.com/anthropics/claude-code/main/schemas/marketplace.json",
- "name": "open-design",
- "owner": {
- "name": "nexu-io",
- "url": "https://github.com/nexu-io/open-design"
- },
- "description": "OpenDesign — local-first design app exposed to coding agents over MCP. Install once with your agent's plugin command and projects/files/skills are reachable through stdio.",
- "plugins": [
- {
- "name": "open-design",
- "source": "./plugins/open-design",
- "description": "OpenDesign MCP server (stdio). 139 skills + projects/files/preview tools, served by your local `od` daemon. Requires `od` on PATH (brew / npm / DMG)."
- }
- ]
- }
README.md · README · 747 lines
View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)
This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.
- <h1 align="center">OpenDesign: The 1st Collaborative AI Design Agent Workspace</h1>
- > ✨ **[Celebrating 100K GitHub stars with OpenDesign Go](https://open-design.ai/pricing/)** — Go credits are doubled: **$8 for your first month, with up to $120 in monthly credits for eligible Design Plan models**. Use them across 10+ models, including GPT-6 Luna, DeepSeek V4.1 Flash, GLM-5.3 Flash-X, and MiMo V2.6 Flash. All personal plans include API access for Codex, Claude Code, DSH, OpenCode, and more.
- <p align="center">
- <img src="docs/assets/readme-hero-design-agent.webp" alt="OpenDesign: The 1st Collaborative AI Design Agent Workspace" width="100%" />
- </p>
- <p align="center">
- <a href="https://open-design.ai/?utm_source=github&utm_medium=referral&utm_content=readme_website">Website</a> ·
- <a href="https://open-design.ai/?utm_source=github&utm_medium=referral&utm_content=readme_download">Download</a> ·
- <a href="https://open-design.ai/cloud/?utm_source=github&utm_medium=referral&utm_content=readme_cloud">OpenDesign Cloud</a> ·
- <a href="https://discord.gg/mHAjSMV6gz">Discord</a> ·
- <a href="https://x.com/OpenDesignHQ">Follow @OpenDesignHQ</a>
- </p>
- <p align="center">
- <a href="https://github.com/nexu-io/open-design/releases"><img alt="release" src="https://img.shields.io/github/v/release/nexu-io/open-design?style=flat&color=blueviolet&label=release&include_prereleases&display_name=tag" /></a>
- <a href="LICENSE"><img alt="license" src="https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=flat" /></a>
- <a href="https://discord.gg/mHAjSMV6gz"><img alt="discord" src="https://img.shields.io/discord/1479002485040480266?style=flat&logo=discord&logoColor=white&label=discord&color=5865F2&cacheSeconds=3600" /></a>
- <a href="QUICKSTART.md"><img alt="quickstart" src="https://img.shields.io/badge/quickstart-3%20commands-green?style=flat" /></a>
- </p>
- <p align="center"><b>English</b> · <a href="docs/i18n/README.es.md">Español</a> · <a href="docs/i18n/README.pt-BR.md">Português</a> · <a href="docs/i18n/README.de.md">Deutsch</a> · <a href="docs/i18n/README.fr.md">Français</a> · <a href="docs/i18n/README.zh-CN.md">简体中文</a> · <a href="docs/i18n/README.zh-TW.md">繁體中文</a> · <a href="docs/i18n/README.ko.md">한국어</a> · <a href="docs/i18n/README.ja-JP.md">日本語</a> · <a href="docs/i18n/README.ar.md">العربية</a> · <a href="docs/i18n/README.ru.md">Русский</a> · <a href="docs/i18n/README.uk.md">Українська</a> · <a href="docs/i18n/README.tr.md">Türkçe</a> · <a href="docs/i18n/README.th.md">ภาษาไทย</a></p>
- ---
- ## What is OpenDesign
- OpenDesign is **the 1st collaborative AI design agent workspace**. Start with a brief, then use your coding agent or OpenDesign Cloud to create a prototype that follows your design system. Share it with your team for feedback, and let your agent refine it in the same project.
- That workflow is open and extensible. OpenDesign is licensed under Apache 2.0 and gives teams skills, design templates, design systems, and plugins they can inspect and adapt to their own process.
- ---
- ## Product tour
- ### Core pages
- <table>
- <tr>
- <td width="50%" valign="top">
- <a href="docs/screenshots/product-tour/home-workspace-2026-09-30-220844.png"><img src="docs/screenshots/product-tour/home-workspace-2026-09-30-220844.png" alt="OpenDesign Home page with the prototype composer and example prompts" width="500" /></a><br/>
- <sub><b>Home</b> — start with a brief or an example.</sub>
- </td>
- <td width="50%" valign="top">
- <a href="docs/screenshots/product-tour/all-projects-2026-09-30-220900.webp"><img src="docs/screenshots/product-tour/all-projects-2026-09-30-220900.webp" alt="OpenDesign All projects page showing recent design systems, media, and prototypes" width="500" /></a><br/>
- <sub><b>All projects</b> — revisit design systems, media, and prototypes.</sub>
- </td>
- </tr>
- <tr>
- <td width="50%" valign="top">
- <a href="docs/screenshots/product-tour/design-systems-stripe-2026-09-30-220910.png"><img src="docs/screenshots/product-tour/design-systems-stripe-2026-09-30-220910.png" alt="OpenDesign Design systems page showing the Stripe brand identity, logo, and typography" width="500" /></a><br/>
- <sub><b>Design Systems</b> — inspect brand assets and refine them with an agent.</sub>
- </td>
- <td width="50%" valign="top">
- <a href="docs/screenshots/product-tour/plugins-skills-2026-09-30-220917.png"><img src="docs/screenshots/product-tour/plugins-skills-2026-09-30-220917.png" alt="OpenDesign Plugins page showing official skills, categories, and search" width="500" /></a><br/>
- <sub><b>Plugins</b> — find skills and launch them with <code>Try it</code>.</sub>
- </td>
- </tr>
- </table>
- ### Studio — create and refine in one project
- <table>
- <tr>
- <td width="50%" valign="top">
- <img src="docs/screenshots/product-tour/studio-prototype-2026.webp" alt="Website prototype with live preview and agent conversation in OpenDesign Studio" /><br/>
- <sub><b>Prototype</b> — build and refine interactive web experiences with your agent and live preview.</sub>
- </td>
- <td width="50%" valign="top">
- <img src="docs/screenshots/product-tour/studio-slides-2026.png" alt="Swiss Grid presentation in OpenDesign Studio with slide thumbnails and speaker notes" /><br/>
- <sub><b>Slides</b> — create decks, review slides and speaker notes, and export when ready.</sub>
- </td>
- </tr>
- <tr>
- <td width="50%" valign="top">
- <img src="docs/screenshots/product-tour/studio-image-2026.webp" alt="Generated fashion portrait preview in OpenDesign Studio" /><br/>
- <sub><b>Image</b> — generate visual assets from the conversation, inspect the result, then download or open it.</sub>
- </td>
- <td width="50%" valign="top">
- <a href="docs/screenshots/product-tour/studio-hyperframes-2026.mp4"><img src="docs/screenshots/product-tour/studio-hyperframes-poster-2026.png" alt="OpenDesign HyperFrames editor showing the One brief, Every deliverable motion graphic" /></a><br/>
- <sub><b>HyperFrames</b> — create motion graphics with your agent and export to MP4. <a href="docs/screenshots/product-tour/studio-hyperframes-2026.mp4">Watch the video</a>.</sub>
- </td>
- </tr>
- </table>
- ---
- <!-- motion-template-library:start -->
- ## Product videos with OpenMotion
- Find a visual starting point for a product launch, feature demo, brand story, or milestone. Browse selected motion references and adaptation guides, copy a brief into your agent, and bring your own message, brand, and assets.
- Review and refine the generated project, then reuse it for your next release, campaign, or update.
- [Explore motion references and start creating →](docs/motion-templates/README.md)
- <!-- motion-template-library:end -->
- ---
- ## Platform Compatibility
- > OpenDesign connects to mainstream coding agents in two ways: **skills, CLI, and MCP** for agents that consume OD, plus **native runtime adapters** for agents that OD launches directly. DeepSeek Harness is a first-class native runtime through the official `dsh` CLI, with structured streaming, model discovery, cancellation, and session resume.
- | Coding agent / platform | Status | Quick setup |
- |---|:---:|---|
- | [Claude Code](https://docs.anthropic.com/en/docs/claude-code) | ✅ Supported | `od mcp install claude` |
- | [Claude Desktop](https://claude.ai/download) | ✅ Supported¹ | `od mcp install claude-desktop` |
- | [Codex CLI](https://github.com/openai/codex) | ✅ Supported | `od mcp install codex` |
- | [DeepSeek Reasonix](https://github.com/esengine/DeepSeek-Reasonix) | ✅ Supported | `od mcp install reasonix` |
- | [DeepSeek Harness](https://github.com/deepseek-ai/deepseek-harness) | ✅ Native runtime | `od agent setup deepseek-harness` |
- | [Raven](https://github.com/EverMind-AI/Raven) | ✅ Supported | `od mcp install raven` |
- | [Cursor](https://www.cursor.com/cli) | ✅ Supported | `od mcp install cursor` |
- | [VS Code + GitHub Copilot](https://github.com/features/copilot) | ✅ Supported | `od mcp install copilot` |
- | [GitHub Copilot CLI](https://github.com/features/copilot/cli) | ✅ Supported | `od mcp install copilot` |
- | [OpenCode](https://opencode.ai/) | ✅ Supported | `od mcp install opencode` |
- | [OpenClaw](https://github.com/openclaw/openclaw) | ✅ Supported | `od mcp install openclaw` |
- | [Antigravity](https://antigravity.google) | ✅ Supported | `od mcp install antigravity` |
- | [Cline](https://github.com/cline/cline) | ✅ Supported | `od mcp install cline` |
- | [Trae](https://www.trae.ai/) | ✅ Supported | `od mcp install trae` |
- | [Kimi CLI](https://github.com/MoonshotAI/kimi-cli) | ✅ Supported | `od mcp install kimi` |
- | [Kiro](https://kiro.dev) | ✅ Supported | `od mcp install kiro` |
- | [Pi Agent](https://github.com/badlogic/pi-mono) | ✅ Supported | `od mcp install pi` |
- | [Mistral Vibe CLI](https://github.com/mistralai/mistral-vibe) | ✅ Supported | `od mcp install vibe` |
- | [Hermes Agent](https://github.com/nousresearch/hermes-agent) | ✅ Supported | `od mcp install hermes` |
- For DeepSeek Harness, install the official `dsh` CLI first, then select it in OpenDesign or run `od agent setup deepseek-harness` to install/repair OD's connection component. For MCP integrations: `od mcp install <agent> --print` for a dry-run preview · `--uninstall` to remove · full list with `od mcp install --help`.
- ¹ Automatic MCP configuration for Claude Desktop is currently supported on macOS and Windows only.
- <p align="center">
- <img src="https://repo-assets.open-design.ai/resources/images/coding-agents.png" alt="The 26 coding-agent CLIs OpenDesign supports — DeepSeek Harness · Claude Code · Codex · OpenCode · Hermes · Antigravity · Vela · Grok Build · Kimi · Cursor Agent · Qwen · Qoder · GitHub Copilot · Pi · Kiro · Kilo · Mistral Vibe · DeepSeek · Reasonix · Aider · Amp · CodeBuddy · Mimo · AtomCode · Devin · Trae" width="100%" />
- </p>
- **No CLI installed?** The BYOK proxy at `POST /api/proxy/{anthropic,openai,azure,google,ollama,senseaudio}/stream` gives you the same loop (no process spawn) — paste `baseUrl` + `apiKey` + `model`, with presets for OpenAI, Atlas Cloud, Anthropic, Azure OpenAI, Google Gemini, Ollama, LM Studio, vLLM, or any OpenAI-compatible endpoint. Atlas Cloud uses `https://api.atlascloud.ai/v1` with your own key and OpenAI-compatible model ids such as `qwen/qwen3.5-flash`. Per-target SSRF protection blocks internal IPs / link-local / CGNAT at the daemon edge.
- Runtime definitions live in [`apps/daemon/src/runtimes/defs/`](apps/daemon/src/runtimes/defs/), with registration and shared stream handling under [`apps/daemon/src/runtimes/`](apps/daemon/src/runtimes/). See [`docs/agent-adapters.md`](docs/agent-adapters.md) for the adapter contract.
- ---
- ## Demo
- Four core product categories, all rendered by a coding agent running on your laptop. Click a thumbnail to see the real example.
- ### 1 · Prototypes — web · desktop · mobile
- The default output surface. Single-page HTML artifacts that read your `DESIGN.md` and render in a sandboxed iframe.
- <table>
- <tr>
- <td width="50%" valign="top">
- <img src="docs/screenshots/skills/dating-web.png" alt="Web prototype dating-web" /><br/>
- <sub><b>Web prototype</b> — an editorial dashboard with scrollbars, KPIs, and charts. Rendered straight from <code>design-templates/dating-web/</code>.</sub>
- </td>
- <td width="50%" valign="top">
- <img src="docs/screenshots/skills/gamified-app.png" alt="Gamified app" /><br/>
- <sub><b>Mobile app prototype</b> — a three-screen gamified flow with XP ribbons and quest detail. Hand off straight to Cursor / Codex / Claude Code to turn into React/Next/Vue.</sub>
- </td>
- </tr>
- </table>
- ### 2 · Live artifacts & dashboards
- Live dashboards, decision rooms, KPI walls — single-page artifacts that pull data through a tweaks panel and stay editable in place.
- <table>
- <tr>
- <td width="50%" valign="top">
- <img src="docs/screenshots/skills/live-dashboard.png" alt="Live dashboard" /><br/>
- <sub><b>Live dashboard</b> — an editable KPI wall whose tweaks panel surfaces the parameters worth nudging. The agent emits a manifest, and the iframe re-renders without a reload.</sub>
- </td>
- <td width="50%" valign="top">
- <img src="docs/screenshots/skills/research-decision-room.png" alt="Decision room" /><br/>
- <sub><b>Decision room</b> — a multi-source briefing artifact for product / research / ops meetings.</sub>
- </td>
- </tr>
- <tr>
- <td width="50%" valign="top">
- <img src="docs/screenshots/skills/github-dashboard.png" alt="GitHub dashboard" /><br/>
- <sub><b>GitHub-style dashboard</b> — repo metrics presented as a live artifact.</sub>
- </td>
- <td width="50%" valign="top">
- <img src="docs/screenshots/skills/flowai-live-dashboard-template.png" alt="Flow live dashboard" /><br/>
- <sub><b>Flow live-dashboard template</b> — a domain-specific KPI template, branded through the active <code>DESIGN.md</code>.</sub>
- </td>
- </tr>
- </table>
- ### 3 · Decks — magazine decks, weekly updates, pitches
- <table>
- <tr>
- <td width="50%" valign="top">
- <img src="docs/screenshots/07-magazine-deck.png" alt="Magazine deck (guizang-ppt)" /><br/>
- <sub><b>Deck mode (guizang-ppt)</b> — magazine layouts, WebGL hero, P0/P1/P2 checklists. Bundled verbatim from <a href="https://github.com/op7418/guizang-ppt-skill"><code>op7418/guizang-ppt-skill</code></a> with its original license preserved.</sub>
- </td>
- <td width="50%" valign="top">
- <img src="docs/screenshots/skills/deck-swiss-international.png" alt="Swiss deck" /><br/>
- <sub><b>Swiss International-style deck</b> — grid-anchored, monochrome accents. One of <b>15 deck templates</b> and <b>36 themes</b> under <code>design-templates/html-ppt-*/</code>.</sub>
- </td>
- </tr>
- </table>
- Every deck exports to **HTML** (single file, inlined assets), **PDF** (browser print, deck-aware), **PPTX** (agent-driven skill), **ZIP** (archive), or **Markdown**.
- ### 4 · Images — `gpt-image-2`, ImageRouter, custom API
- <table>
- <tr>
- <td width="20%" valign="top"><img src="https://cms-assets.youmind.com/media/1776662673014_nf0taw_HGRMNDybsAAGG88.jpg" alt="Illustrated city food map" /><br/><sub><b>Illustrated city food map</b><br/>Hand-drawn editorial travel poster</sub></td>
- <td width="20%" valign="top"><img src="https://cms-assets.youmind.com/media/1777453149026_gd2k50_HHCSvymboAAVscc.jpg" alt="Cinematic elevator scene" /><br/><sub><b>Cinematic elevator scene</b><br/>Single-frame editorial still</sub></td>
- <td width="20%" valign="top"><img src="https://cms-assets.youmind.com/media/1777453164993_mt5b69_HHDoWfeaUAEA6Vt.jpg" alt="Cyberpunk anime portrait" /><br/><sub><b>Cyberpunk portrait</b><br/>Profile avatar — neon face text</sub></td>
- <td width="20%" valign="top"><img src="https://cms-assets.youmind.com/media/1776661968404_8a5flm_HGQc_KOaMAA2vt0.jpg" alt="3D stone staircase evolution" /><br/><sub><b>3D stone staircase</b><br/>Hewn-stone infographic</sub></td>
- <td width="20%" valign="top"><img src="https://cms-assets.youmind.com/media/1777453184257_vb9hvl_HG9tAkOa4AAuRrn.jpg" alt="Glamorous portrait" /><br/><sub><b>Glamorous portrait</b><br/>Editorial studio shot</sub></td>
- </tr>
- </table>
- **93 ready-to-replicate prompts** live in [`prompt-templates/`](prompt-templates/) — preview thumbnails, full prompt body, target model, aspect ratio, and source attribution. One click drops a brief into the composer.
- ### 5 · Video & HyperFrames — agent-native motion graphics
- **[HyperFrames][hyperframes]** is HeyGen's open-source, agent-native video framework, integrated as a first-class citizen in OpenDesign. The agent writes HTML + CSS + GSAP, and HyperFrames renders it to a deterministic MP4 via headless Chrome + FFmpeg. Pair it with **Seedance 2.0** for cinematic t2v / i2v, **Veo 3 / Sora 2 / Kling 2** for routed model variants, and **Suno v5 / Lyria 2** for the audio layer.
- <table>
- <tr>
- <td width="25%" valign="top"><a href="prompt-templates/video/hyperframes-saas-product-promo-30s.json"><img src="https://static.heygen.ai/hyperframes-oss/docs/images/catalog/blocks/app-showcase.png" alt="SaaS promo" /></a><br/><sub><b>30s SaaS product promo</b> · 16:9 · UI 3D reveals</sub></td>
- <td width="25%" valign="top"><a href="prompt-templates/video/hyperframes-tiktok-karaoke-talking-head.json"><img src="https://static.heygen.ai/hyperframes-oss/docs/images/catalog/blocks/tiktok-follow.png" alt="TikTok karaoke" /></a><br/><sub><b>TikTok karaoke talking-head</b> · 9:16 · TTS + word-synced captions</sub></td>
- <td width="25%" valign="top"><a href="prompt-templates/video/hyperframes-brand-sizzle-reel.json"><img src="https://static.heygen.ai/hyperframes-oss/docs/images/catalog/blocks/logo-outro.png" alt="Brand sizzle reel" /></a><br/><sub><b>30s brand sizzle reel</b> · 16:9 · audio-reactive kinetic type</sub></td>
- <td width="25%" valign="top"><a href="prompt-templates/video/hyperframes-data-bar-chart-race.json"><img src="https://static.heygen.ai/hyperframes-oss/docs/images/catalog/blocks/data-chart.png" alt="Bar chart race" /></a><br/><sub><b>Bar chart race</b> · 16:9 · NYT-style data infographic</sub></td>
- </tr>
- <tr>
- <td width="25%" valign="top"><a href="prompt-templates/video/hyperframes-flight-map-route.json"><img src="https://static.heygen.ai/hyperframes-oss/docs/images/catalog/blocks/nyc-paris-flight.png" alt="Flight map" /></a><br/><sub><b>Flight map</b> · 16:9 · Apple-style route reveal</sub></td>
- <td width="25%" valign="top"><a href="prompt-templates/video/hyperframes-logo-outro-cinematic.json"><img src="https://static.heygen.ai/hyperframes-oss/docs/images/catalog/blocks/logo-outro.png" alt="Logo outro" /></a><br/><sub><b>4s cinematic logo outro</b> · 16:9 · piece-by-piece assembly + bloom</sub></td>
- <td width="25%" valign="top"><a href="prompt-templates/video/hyperframes-money-counter-hype.json"><img src="https://static.heygen.ai/hyperframes-oss/docs/images/catalog/blocks/apple-money-count.png" alt="Money counter" /></a><br/><sub><b>$0 → $10K money counter</b> · 9:16 · Apple-style hype</sub></td>
- <td width="25%" valign="top"><a href="prompt-templates/video/hyperframes-website-to-video-promo.json"><img src="https://static.heygen.ai/hyperframes-oss/docs/images/catalog/blocks/instagram-follow.png" alt="Website to video" /></a><br/><sub><b>Website-to-video</b> · 16:9 · captures the site at 3 viewports</sub></td>
- </tr>
- </table>
- 11 HyperFrames templates + 39 Seedance prompts ship with the repo. Catalog thumbnails © HeyGen; the framework is Apache-2.0. The OD-specific render workflow (composition cache, sandbox-exec workaround, MP4-as-chip) is detailed in [`design-templates/hyperframes/`](design-templates/hyperframes/).
- [hyperframes]: https://github.com/heygen-com/hyperframes
- ---
- ## Why OpenDesign
- - 🤖 **Agent-native, model-agnostic.** We don't ship an agent. The `claude` / `codex` / `cursor-agent` / `copilot` / `hermes` / `kimi` already on your `PATH` are the design engine. Swap with one click.
- - 🧠 **Brand-grade by default.** Every render reads the active package's `DESIGN.md` as the core brand contract. 151 design-system packages ship with the repo; legacy packages may be `DESIGN.md`-only, while newer packages can add `manifest.json`, `tokens.css`, components, assets, and provenance. Drop a folder in, the picker finds it.
- - 🖥️ **Local-first, BYOK at every layer.** Native desktop apps for macOS (Apple Silicon + Intel) and Windows (x64). Linux desktop users can currently run OpenDesign [from source](#-run-from-source); the latest official release does not include a prebuilt Linux artifact. Product analytics and session replay are consent-gated; scrubbed safety and reliability telemetry is always on. Before describing daemon data paths, contributors and operators MUST read `AGENTS.md` → **Daemon data directory contract**. This README MUST NOT restate it.
- - 🌍 **Composable on four planes.** **Plugins** carry runnable workflows · functional **skills** carry agent behavior · **design templates** carry rendering blueprints · **design systems** carry the brand. All four use portable, versionable directories that anyone can author and publish.
- - 🔁 **Refresh an existing codebase.** Hand a `git` repo + `DESIGN.md` to the agent and it refactors your real components to the brand spec.
- - 🔒 **Privacy by conviction.** Projects can run locally or in your own deployment. Cloud model and OpenDesign Cloud requests are sent to the corresponding services. The BYOK proxy includes SSRF safeguards.
- ---
- ## Quick start
- ### 🖥️ Download the desktop app (recommended — zero config)
- The fastest way to use OpenDesign. No Node, no pnpm, no clone.
- - **macOS** (Apple Silicon · Intel x64) → [**open-design.ai**](https://open-design.ai/?utm_source=github&utm_medium=referral&utm_content=readme_download_macos) or [GitHub Releases](https://github.com/nexu-io/open-design/releases)
- - **Windows** (x64) → [**open-design.ai**](https://open-design.ai/?utm_source=github&utm_medium=referral&utm_content=readme_download_windows) or [GitHub Releases](https://github.com/nexu-io/open-design/releases)
- - **Linux** → No prebuilt Linux artifact is currently published in the official releases. For now, [run OpenDesign from source](#-run-from-source); Linux release work is tracked in [#4368](https://github.com/nexu-io/open-design/issues/4368).
- After install: the app auto-detects every coding-agent CLI on your `PATH`, loads 100+ functional skills, the separate rendering-template catalog, and 151 design systems, and lets you type a brief in the entry view.
- ### 🤖 Install into your coding agent (no UI)
- You can use OpenDesign without ever opening the GUI — call it as a skill, plugin, or MCP server inside Claude Code, Codex, Cursor, Copilot, OpenClaw, Antigravity, Hermes, Kimi, and more.
- If you installed the macOS desktop app via the DMG or Homebrew cask, your shell
- may still resolve `od` to Apple's built-in `/usr/bin/od` octal-dump utility. In
- that case, open **Settings → MCP server** in the desktop app and copy the
- client-specific snippet; it uses absolute paths and does not rely on the bare
- `od` command.
- ```bash
- # One-line install into the agent you're using:
- od mcp install <agent>
- # <agent> = claude | codex | reasonix | raven | cursor | copilot | openclaw
- # | antigravity | pi | vibe | hermes | cline | kimi | kiro
- # | trae | opencode
- # Hosted equivalent for curl-based setup:
- curl -fsSL https://open-design.ai/install.sh | sh -s <agent>
- ```
- `install.sh` is a thin shell wrapper around `od mcp install`; it exists so the
- hosted URL returns shell instead of the landing-page HTML fallback and fails
- fast if your shell resolves a non-Open-Design `od` binary.
- > **macOS / WSL2 users:** `/usr/bin/od` is a system octal-dump command and can
- > shadow OpenDesign's `od` command. Desktop-app users should prefer the
- > **Settings → MCP server** snippet; WSL2 users should follow the
- > [`WSL2 setup guide`](docs/wsl-setup.md) first.
- Then, inside the agent:
- ```
- > Use open-design to generate a landing page with the Linear design system
- ```
- In a filesystem-backed local CLI run, the agent composes the selected functional skill or design template with your `DESIGN.md`, writes the canonical project files, and OpenDesign previews those files. A BYOK/plain-API run without filesystem tools instead returns one complete `<artifact>` block.
- ### 🐳 Run with Docker
- ```bash
- git clone https://github.com/nexu-io/open-design.git
- cd open-design/deploy
- cp .env.example .env
- echo "OD_API_TOKEN=$(openssl rand -hex 32)" >> .env
- docker compose up -d
- # open http://127.0.0.1:7456
- ```
- If the browser asks for credentials, use `open-design` as the username and the
- `OD_API_TOKEN` value from `deploy/.env` as the password. This keeps Docker bridge
- traffic authenticated without requiring host networking. API clients can keep
- using `Authorization: Bearer <OD_API_TOKEN>`.
- ### 🚀 Deploy on Sealos
- [](https://sealos.io/products/app-store/open-design/)
- The Sealos App Store template runs the published OpenDesign Docker image with persistent workspace storage and Basic Auth on the public proxy. For custom public or shared Docker deployments, follow the reverse-proxy and `OPEN_DESIGN_ALLOWED_ORIGINS` guidance in [`deploy/README.md`](deploy/README.md#local-compose).
- ### 🧑💻 Run from source
- ```bash
- git clone https://github.com/nexu-io/open-design.git
- cd open-design
- corepack enable && pnpm install
- pnpm tools-dev run web
- ```
- Open the URL printed by `tools-dev`; development ports are allocated dynamically unless you pass explicit port flags.
- Node `~24`, pnpm `10.33.x`. WSL2 users, see [`docs/wsl-setup.md`](docs/wsl-setup.md); native Windows users, see [`docs/windows-troubleshooting.md`](docs/windows-troubleshooting.md). Full quickstart, env vars, and packaged build flow → [`QUICKSTART.md`](QUICKSTART.md).
- ### A full workflow — from brief to artifact
- `brief → plugin → direction → design system → artifact → handoff → memory`
- 1. **A PM submits a brief.** The plugin picker offers landing page · pitch deck · dashboard · social post · PM spec · OKR scorecard…
- 2. **A designer (or the agent) locks the direction.** No brand? Pick from 5 curated directions. Have a brand? Drop a screenshot / URL → the agent connects GitHub and codifies a reusable `DESIGN.md`.
- 3. **The agent creates the first deliverable.** Plugin + functional skill or design template + `DESIGN.md` are bound. Filesystem-backed CLI runs write canonical project files and the preview follows them; BYOK/plain-API runs without file tools return one complete `<artifact>` block.
- 4. **Hand off to engineering.** The artifact is real HTML/CSS — drop it into Cursor, Codex, or Claude Code to keep building as code. Or export PPTX / PDF / MP4 straight to marketing.
- 5. **OpenDesign gets smarter as you use it.** Your screenshots, fonts, palettes, and confirmed artifacts accumulate as defaults for the next session. Less rework, less drift.
- ---
- ## Use OpenDesign from your coding agent
- OpenDesign ships a **stdio MCP server** and per-agent **install scripts**. Any MCP-compatible agent in another repo can read files from your local OpenDesign projects directly — tokens CSS, JSX components, entry HTML — as a structured API queryable by name. The agent always sees the live file, not a stale export.
- ```bash
- # One-line install (16+ CLIs supported):
- od mcp install <agent>
- # Then the agent can:
- od project list --json
- od files list <project-id> --json
- od files read <project-id> <relative-path>
- od plugin list --json
- od skills list --json
- ```
- **Why MCP?** Exporting and re-attaching a zip every iteration breaks flow. MCP exposes the design source directly — the agent always sees the live file.
- **For an agent starting from scratch,** the installer places `~/.config/<agent>/open-design.json` (or the platform equivalent) plus a copy-paste MCP snippet. Cursor gets a one-click deeplink; Claude Code gets a `claude mcp add-json` one-liner; every other agent gets JSON in the schema its config expects. On macOS desktop installs, prefer that Settings snippet over typing bare `od mcp install <agent>` in Terminal, because `/usr/bin/od` may win on PATH. Full per-agent flow → **Settings → MCP server** in the desktop app, or [`docs/agent-adapters.md`](docs/agent-adapters.md).
- **Security model.** Read-only by default, the daemon binds to `127.0.0.1`, and SSRF is blocked at the proxy edge. LAN exposure requires an explicit `OD_BIND_HOST` plus `OD_ALLOWED_ORIGINS`. Connector credentials and live-artifact preview routes stay loopback-only regardless.
- **Internally-hosted model endpoints.** To prevent SSRF, the daemon blocks provider base URLs that resolve to private/internal address ranges (RFC1918, link-local, CGNAT, and cloud-metadata IPs) by default, surfacing `Internal IPs blocked`. If you run an internally-hosted gateway (e.g. LiteLLM or Ollama on a VPN-only `10.x`/`192.168.x` address), opt that host out with `OD_ALLOWED_INTERNAL_HOSTS=<host1>,<host2>,...` — a comma- or whitespace-separated list of bare hostnames or IPs (`10.0.0.5`, `litellm.internal.corp`; a `host:port` or full URL is accepted and reduced to its hostname; IPv6 must be bracketed, e.g. `[fd00::1]`). The allowlist is strict opt-in (empty by default), exact-host (no subdomain/substring matching), and applies **only** to provider endpoints you configure (connection test, model discovery, BYOK chat). It deliberately does **not** relax the guard on download URLs returned inside upstream responses, which stay blocked. A malformed entry — or CIDR notation, which is not supported — is dropped with a warning rather than silently trusted, so a typo never quietly widens (or fails to widen) the guard. Allowlisting a hostname trusts whatever it resolves to (like `OD_ALLOWED_ORIGINS`); allowlist the resolved IP instead if you want the DNS-resolved address re-checked.
- ---
- ## Skills and design templates
- **100+ functional skills ship in [`skills/`](skills/)**. Each follows the Agent Skills [`SKILL.md`][skill] convention and supplies reusable agent behavior, references, or utilities. Renderable starters live separately in [`design-templates/`](design-templates/); they may also use `SKILL.md`, but they populate the design-template catalog rather than the functional-skill registry.
- Two **modes** anchor the design-template catalog: `prototype` (web/mobile/desktop single-page artifacts) and `deck` (horizontal-swipe presentations). Other templates cover `image`, `video`, `audio`, and utility surfaces. The **`scenario`** field groups templates by audience: `design` · `marketing` · `operation` · `engineering` · `product` · `finance` · `hr` · `sale` · `personal`.
- | Design template | Mode | Scenario | What it produces |
- |---|---|---|---|
- | [`web-prototype`](design-templates/web-prototype/) | prototype | design | Default landing page / hero |
- | [`saas-landing`](design-templates/saas-landing/) | prototype | marketing | Hero / features / pricing / CTA |
- | [`dashboard`](design-templates/dashboard/) | prototype | operation | Admin / analytics (with sidebar) |
- | [`mobile-app`](design-templates/mobile-app/) | prototype | design | iPhone 15 Pro / Pixel framed app |
- | [`mobile-onboarding`](design-templates/mobile-onboarding/) | prototype | design | Splash · value-prop · sign-in flow |
- | [`social-carousel`](design-templates/social-carousel/) | prototype | marketing | 3-card 1080×1080 carousel |
- | [`email-marketing`](design-templates/email-marketing/) | prototype | marketing | Table-fallback-safe brand email |
- | [`magazine-poster`](design-templates/magazine-poster/) | prototype | marketing | Single-page magazine layout |
- | [`motion-frames`](design-templates/motion-frames/) | prototype | marketing | Looping CSS motion hero |
- | [`sprite-animation`](design-templates/sprite-animation/) | prototype | marketing | 8-bit pixel animated explainer |
- | [`pm-spec`](design-templates/pm-spec/) | prototype | product | PM spec doc (with TOC + decision log) |
- | [`team-okrs`](design-templates/team-okrs/) | prototype | product | OKR scorecard |
- | [`eng-runbook`](design-templates/eng-runbook/) | prototype | engineering | Incident runbook |
- | [`finance-report`](design-templates/finance-report/) | prototype | finance | Exec finance summary |
- | [`hr-onboarding`](design-templates/hr-onboarding/) | prototype | hr | Role onboarding plan |
- | [`guizang-ppt`](design-templates/guizang-ppt/) | deck | marketing | Magazine-style web PPT (deck default) |
- | [`html-ppt-*`](design-templates/) | deck | marketing | 15 deck templates × 36 themes (master template in [`design-templates/html-ppt/`](design-templates/html-ppt/)) |
- | [`hyperframes`](design-templates/hyperframes/) | video | marketing | HTML → MP4 motion graphics (HeyGen OSS framework) |
- | [`critique`](design-templates/critique/) | utility | design | Five-dimensional self-critique scoresheet |
- | [`tweaks`](design-templates/tweaks/) | utility | design | AI-emitted tweaks-panel manifest |
- Full protocol and directory split → [`docs/skills-protocol.md`](docs/skills-protocol.md). Registry endpoints: `GET /api/skills` for functional skills and `GET /api/design-templates` for rendering templates.
- ---
- ## Design Systems
- **151 brand-grade design-system packages centered on `DESIGN.md`** ship with the repo. Legacy packages may contain only that Markdown contract; newer packages can also carry `manifest.json`, compiled `tokens.css`, component fixtures, assets, and provenance evidence. The catalog mixes upstream-derived systems with project-owned additions; [`design-systems/README.md`](design-systems/README.md) records the package shape and provenance. Switch a system → the next render uses the new tokens.
- <details>
- <summary><b>Full catalog (click to expand)</b></summary>
- **AI & LLM** — `claude` · `cohere` · `mistral-ai` · `minimax` · `together-ai` · `replicate` · `runwayml` · `elevenlabs` · `ollama` · `x-ai`
- **Developer Tools** — `cursor` · `vercel` · `linear-app` · `expo` · `clickhouse` · `mongodb` · `supabase` · `hashicorp` · `posthog` · `sentry` · `warp` · `sanity` · `mintlify` · `composio` · `opencode-ai` · `voltagent`
- **Productivity** — `notion` · `miro` · `airtable` · `superhuman` · `intercom` · `zapier` · `cal` · `clay` · `raycast`
- **Fintech** — `stripe` · `coinbase` · `binance` · `kraken` · `mastercard` · `revolut` · `wise`
- **E-commerce** — `shopify` · `airbnb` · `uber` · `nike` · `starbucks` · `pinterest`
- **Media** — `spotify` · `playstation` · `wired` · `theverge` · `meta`
- **Automotive** — `tesla` · `bmw` · `ferrari` · `lamborghini` · `bugatti` · `renault`
- **Other** — `apple` · `ibm` · `nvidia` · `vodafone` · `resend` · `spacex`
- **Starters** — `default` (Neutral Modern) · `warm-editorial`
- </details>
- Re-import the library via [`scripts/sync-design-systems.ts`](scripts/sync-design-systems.ts). Add your own brand → drop a `DESIGN.md` into `design-systems/<brand>/`. Full guide → [`design-systems/README.md`](design-systems/README.md).
- [acd2]: https://github.com/VoltAgent/awesome-design-md
- ---
- ## Plugins
- **277 official plugins plus 183 remixable reference examples** live in [`plugins/_official/`](plugins/_official/). Each entry is a portable plugin directory anchored by `open-design.json` plus the payload required by its type: for example `SKILL.md` for agent workflows, `template.json` for media templates, or `DESIGN.md` for design-system entries. Jump straight to a category:
- | Category | Count | Contents |
- |---|---|---|
- | [`scenarios/`](plugins/_official/scenarios/) | 13 | Complete design scenarios — [`od-default`](plugins/_official/scenarios/od-default/), [`od-design-refine`](plugins/_official/scenarios/od-design-refine/), [`od-figma-migration`](plugins/_official/scenarios/od-figma-migration/), [`od-code-migration`](plugins/_official/scenarios/od-code-migration/), [`od-react-export`](plugins/_official/scenarios/od-react-export/), [`od-nextjs-export`](plugins/_official/scenarios/od-nextjs-export/), [`od-vue-export`](plugins/_official/scenarios/od-vue-export/), [`od-media-generation`](plugins/_official/scenarios/od-media-generation/), [`od-new-generation`](plugins/_official/scenarios/od-new-generation/), [`od-tune-collab`](plugins/_official/scenarios/od-tune-collab/), [`od-plugin-authoring`](plugins/_official/scenarios/od-plugin-authoring/), [`od-share-to-community`](plugins/_official/scenarios/od-share-to-community/), [`od-web-effect-extractor`](plugins/_official/scenarios/od-web-effect-extractor/) |
- | [`image-templates/`](plugins/_official/image-templates/) | 45 | One-shot image prompts — editorial, cinematic, product, portrait |
- | [`video-templates/`](plugins/_official/video-templates/) | 63 | HyperFrames / Seedance / Veo motion templates |
- | [`design-systems/`](plugins/_official/design-systems/) | 143 | Brand `DESIGN.md` wrapped as plugins |
- | [`atoms/`](plugins/_official/atoms/) | 13 | Reusable UI fragments (buttons, heroes, KPI cards) |
- | [`examples/`](plugins/_official/examples/) | 183 | Remixable reference outputs |
- Also [`plugins/community/`](plugins/community/) for community plugins and [`plugins/registry/`](plugins/registry/) for the publishing flow.
- ### What plugins can do
- - 🤖 **Run in any coding agent** — [Claude Code](docs/agent-adapters.md), Codex, Cursor, Copilot, [OpenClaw](https://github.com/openclaw/openclaw), [Antigravity](https://antigravity.google), Hermes, Kimi… through the same skill protocol the agent already knows.
- - 🔁 **Migrate Figma / Pencil workflows** → React, Next.js, or Vue source. See [`od-figma-migration`](plugins/_official/scenarios/od-figma-migration/).
- - 🛠️ **Refresh an existing codebase to a brand spec** — point a plugin at a `git` repo + `DESIGN.md`, get a PR. See [`od-code-migration`](plugins/_official/scenarios/od-code-migration/).
- - 💾 **Persist custom workflows** — your team's reusable templates sit next to the shipped ones.
- ### Using plugins
- Plugins are at full parity across the **web UI** and the **`od` CLI** — same `/api/plugins` endpoints, pick whichever fits.
- **In the desktop / web app:** open the **Plugin** page to browse the marketplace and click **Install**; inside a project's Studio, plugins appear as composer chips you click to apply (with the inputs they declare).
- **On the command line** (runs without a UI — this is the path external agents use):
- ```bash
- od plugin list # list installed plugins (--task-kind / --mode / --tag filters)
- od plugin search "landing page" # search by keyword
- od plugin info od-default # inspect a plugin's metadata, inputs, capabilities
- od plugin install od-default # install from a registry; also accepts ./local-folder or an https://… link
- od plugin apply od-default --input brief="a one-page pitch for our seed round"
- od plugin upgrade od-default # upgrade
- od plugin uninstall od-default # uninstall
- ```
- Every command supports `--json`, so you can pipe it through `jq` / `xargs` into automation.
- ### Building a plugin
- An OpenDesign plugin requires `open-design.json` plus the payload required by its type. A workflow skill or scenario also includes `SKILL.md`; manifest-only template and design-system entries use their own payloads instead:
- ```
- my-plugin/
- ├── open-design.json ← required: marketplace metadata + inputs + pipeline + capabilities
- ├── SKILL.md ← required for agent-skill/scenario entries; omitted for other plugin types
- ├── README.md ← optional: usage, install, registry links
- ├── preview/ ← optional: index.html / poster.png (strongly recommended for visual plugins)
- └── examples/ ← optional: concrete use cases
- ```
- Core `open-design.json` fields: `specVersion` (currently `1.0.0`), `name` (stable ID), `version` (semver), optional `compat.agentSkills[].path` (points at `./SKILL.md` when the entry exposes an Agent Skill), `od.kind` (`skill` / `scenario` / `atom` / `bundle`), `od.taskKind` (`new-generation` / `figma-migration` / `code-migration` / `tune-collab`), `od.mode` (the output surface, e.g. `prototype` / `deck` / `live-artifact` / `image` / `video` / `hyperframes` / `audio` / `design-system` / `scenario`), `od.capabilities[]` (**declare the minimum** — a restricted install grants only `prompt:inject` by default), `od.inputs[]` (apply-time parameters).
- Scaffold + validate locally:
- ```bash
- od plugin scaffold --id my-plugin --title "My Plugin" # generate the skeleton
- od plugin validate ./my-plugin # check manifest / file layout
- pnpm guard && pnpm --filter @open-design/plugin-runtime typecheck
- ```
- Full field set and runtime contract → [`plugins/spec/SPEC.md`](plugins/spec/SPEC.md); developing a plugin with a coding agent → [`plugins/spec/AGENT-DEVELOPMENT.md`](plugins/spec/AGENT-DEVELOPMENT.md); copy-paste minimal templates → [`plugins/spec/examples/`](plugins/spec/examples/).
- ### Contributing a plugin
- 1. Drop the plugin folder into [`plugins/community/`](plugins/community/) (third-party plugins), or — to ship it bundled with OpenDesign — into the matching tier of [`plugins/_official/`](plugins/_official/).
- 2. Pass validation: `od plugin validate`, `pnpm guard`, `pnpm --filter @open-design/plugin-runtime typecheck`.
- 3. Fill the PR using the template in [`plugins/spec/CONTRIBUTING.md`](plugins/spec/CONTRIBUTING.md) (ID, version, lane, mode, capabilities, trigger examples; attach a screenshot / preview for visual plugins).
- 4. To publish to an external registry (skills.sh / ClawHub / standalone GitHub) → [`plugins/spec/PUBLISHING-REGISTRIES.md`](plugins/spec/PUBLISHING-REGISTRIES.md).
- Plugin registry endpoint: `GET /api/plugins`. Directory overview → [`plugins/README.md`](plugins/README.md) ([简体中文](plugins/README.zh-CN.md)).
- ---
- ## Architecture
- ```
- ┌────────────────── browser (Next.js 16) / Electron shell ──────────────┐
- │ chat · file workspace · iframe preview · settings · import · MCP │
- └──────────────┬─────────────────────────────────────┬─────────────────┘
- │ /api/* │
- ▼ ▼
- ┌─────────────────────────────────┐ /api/proxy/{provider}/stream (SSE)
- │ local daemon (Express+SQLite) │ ─→ any OpenAI-compatible BYOK,
- │ │ SSRF-guarded at the edge
- │ /api/skills /api/design-templates /api/plugins │
- │ /api/design-systems │
- │ /api/chat (SSE) /api/proxy/* │
- │ /api/projects/:id/files/... │
- │ /api/artifacts/{save,lint} │
- │ /api/import/claude-design │
- │ MCP stdio server │
- └─────────┬───────────────────────┘
- │ spawn(cli, [...], { cwd: managed project cwd })
- ▼
- ┌──────────────────────────────────────────────────────────────────┐
- │ Local runtime definitions come from runtimes/registry.ts; │
- │ the base registry has 27 definitions (including byok-opencode), │
- │ backed by 26 distinct local CLI executables because byok-opencode shares │
- │ the OpenCode executable. See docs/agent-adapters.md. │
- │ composes a functional skill or design template + DESIGN.md; writes files │
- └──────────────────────────────────────────────────────────────────┘
- ```
- | Layer | Stack |
- |---|---|
- | Frontend | Next.js 16 App Router + React 18 + TypeScript |
- | Daemon | Node 24 · Express · SSE streaming · `better-sqlite3` |
- | Storage | Before changing or documenting daemon storage paths, you MUST read `AGENTS.md` → **Daemon data directory contract**. This README MUST NOT restate it. |
- | Preview | Filesystem runs render canonical project files; BYOK/plain-API runs parse one complete `<artifact>` block into a sandboxed `srcdoc` iframe |
- | Export | HTML (inlined) · PDF (browser print) · PPTX (agent-driven) · ZIP · Markdown · MP4 (HyperFrames) |
- | Desktop | Electron shell + sandboxed renderer + sidecar IPC (STATUS · EVAL · SCREENSHOT · CONSOLE · CLICK · SHUTDOWN) |
- | Lifecycle | One entry point: `pnpm tools-dev` (start / stop / run / status / logs / inspect / check) |
- Full architecture → [`docs/architecture.md`](docs/architecture.md). Skill protocol → [`docs/skills-protocol.md`](docs/skills-protocol.md). Agent adapter contract → [`docs/agent-adapters.md`](docs/agent-adapters.md).
- ---
- ## Roadmap
- - [x] Daemon + 27 runtime definitions across 26 distinct coding-agent CLI executables + skill/design-template registries + design-system catalog
- - [x] Web app + chat + question form + 5-direction picker + todo progress + sandboxed preview
- - [x] 100+ functional skills · separate rendering-template catalog · 151 design-system packages · 5 visual directions · 5 device frames
- - [x] SQLite-backed projects · conversations · messages · tabs · templates
- - [x] Multi-provider BYOK proxy (`/api/proxy/{anthropic,openai,azure,google,ollama,senseaudio}/stream`) with OpenAI-compatible presets including Atlas Cloud + SSRF guard
- - [x] Claude Design ZIP import (`/api/import/claude-design`)
- - [x] Sidecar protocol + Electron desktop + IPC automation
- - [x] Artifact lint API + 5-dim self-critique pre-emit gate
- - [x] **0.8.0** — plugin marketplace infrastructure (261 official plugins, manifest spec, per-agent install scripts)
- - [x] **0.9.0** — OpenDesign Cloud (official model service built into the app: zero config, one-click sign-in)
- - [x] **0.10.0** — the all-in-one design workspace: the whole craft loop in one window (references → material → interactive editing → motion → handoff)
- - [x] **0.11.0** — _The Bazaar_: built in the open — a community marketplace of plugins and design systems anyone can pick from and contribute to
- - [x] **0.12.0** — _Brand-backed Design System_: turn the brand you already own into a reusable, portable `DESIGN.md` system
- - [x] **0.13.0** — _Stay in Flow_: native session resume, faster model picking, and export straight to screenshot-backed PPTX / PDF
- - [x] Published desktop releases — macOS (Apple Silicon + Intel) + Windows (x64)
- - [ ] Published Linux desktop release (optional lane) — tracked in [#4368](https://github.com/nexu-io/open-design/issues/4368)
- - [ ] Comment-mode surgical edits — partially shipped; reliable targeted patching in progress
- - [ ] AI-emitted tweaks panel UX — not yet implemented
- - [ ] `npx od init` to scaffold a project with `DESIGN.md`
- - [ ] Plugin SDK + `od plugin {add,list,remove,test,publish}` CLI
- - [ ] Figma / Pencil → React / Next / Vue migration plugins (alpha)
- - [ ] Refresh-existing-codebase plugin (point at a git repo + `DESIGN.md`)
- Phased delivery → [`docs/roadmap.md`](docs/roadmap.md).
- ---
- ## Community
- Real people behind every channel.
- - 💬 **Discord** — daily chat, plugin sharing, questions → [**discord.gg/mHAjSMV6gz**](https://discord.gg/mHAjSMV6gz)
- - 🐦 **X / Twitter** — release notes, milestones, behind the scenes → [**@OpenDesignHQ**](https://x.com/OpenDesignHQ)
- - 🗣️ **GitHub Discussions** — deep Q&A, RFCs, "show your work" → [**Discussions**](https://github.com/nexu-io/open-design/discussions)
- - 🐛 **GitHub Issues** — bug reports, feature requests → [**Issues**](https://github.com/nexu-io/open-design/issues)
- The [`good-first-issue`](https://github.com/nexu-io/open-design/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) and [`help-wanted`](https://github.com/nexu-io/open-design/issues?q=is%3Aissue+is%3Aopen+label%3A%22help+wanted%22) labels are the easiest way in.
- ---
- ## Contributing
- OpenDesign keeps moving because contributors — designers, engineers, prompt authors — keep showing up. Many of the most-used skills, design systems, and plugins were written by people outside the core team.
- ### 🎯 Where to start (max leverage, min change)
- | Want to ship… | How | Where |
- |---|---|---|
- | A new functional **skill** | Drop a folder with `SKILL.md` + optional `assets/` + `references/` | [`skills/`](skills/) · spec in [`docs/skills-protocol.md`](docs/skills-protocol.md) |
- | A new rendering **design template** | Add a renderable `SKILL.md` bundle | [`design-templates/`](design-templates/) |
- | A new **design system** | Drop a package centered on `DESIGN.md`; add `manifest.json`, `tokens.css`, components, assets, or provenance when needed | [`design-systems/<brand>/`](design-systems/) |
- | A new **plugin** | Drop `open-design.json` + the type-specific payload under a category folder | [`plugins/community/`](plugins/community/) · spec in [`plugins/spec/SPEC.md`](plugins/spec/SPEC.md) · agent dev guide in [`plugins/spec/AGENT-DEVELOPMENT.md`](plugins/spec/AGENT-DEVELOPMENT.md) |
- | Support a new **coding-agent CLI** | One runtime definition + registry entry; add a parser only for a new wire format | [`apps/daemon/src/runtimes/defs/`](apps/daemon/src/runtimes/defs/) |
- | Fix a bug or polish UI | Browse the [`good-first-issue`](https://github.com/nexu-io/open-design/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) label | [Issues →](https://github.com/nexu-io/open-design/issues) |
- | Translate the docs | Update the `README.<lang>.md` files | [`TRANSLATIONS.md`](TRANSLATIONS.md) |
- ### 🤖 Contributing as an agent
- If *you are the agent reading this*, the fastest path is:
- ```bash
- # 1. Boot locally
- git clone https://github.com/nexu-io/open-design.git
- cd open-design && corepack enable && pnpm install
- pnpm tools-dev run web
- # 2. Find a good-first-issue and assign yourself
- gh issue list --label "good first issue" --state open --limit 20
- gh issue develop <number> # create a branch and worktree
- # 3. Make the change, run the checks
- pnpm guard && pnpm typecheck
- pnpm --filter @open-design/<package> test
- # 4. Open the PR
- gh pr create --fill
- ```
- Full agent-friendly contribution flow, code style, and PR bar → [`CONTRIBUTING.md`](CONTRIBUTING.md) ([Deutsch](docs/i18n/CONTRIBUTING.de.md) · [Français](docs/i18n/CONTRIBUTING.fr.md) · [简体中文](docs/i18n/CONTRIBUTING.zh-CN.md) · [日本語](docs/i18n/CONTRIBUTING.ja-JP.md) · [한국어](docs/i18n/CONTRIBUTING.ko.md) · [Português](docs/i18n/CONTRIBUTING.pt-BR.md) · [ภาษาไทย](docs/i18n/CONTRIBUTING.th.md)).
- ### 🏅 OpenDesign Fellow program
- We're recruiting **OpenDesign Fellows** around the world — Fellows shape the product alongside the core team, represent OpenDesign officially in their region, and grow the community locally, backed by funded support ($1,000 / MR), free LLM credits, and a direct review track. Details → [`MAINTAINERS.md`](MAINTAINERS.md) and the announcement on [Discord](https://discord.gg/mHAjSMV6gz).
- ---
- ## Maintainers
- They carry a lot of the load — daily maintenance, review, and community support.
- <table>
- <tr>
- <td align="center" valign="top" width="200">
- <a href="https://github.com/Nagendhra-web">
- <img src="https://github.com/Nagendhra-web.png" width="96" alt="@Nagendhra-web" /><br/>
- <sub><b>@Nagendhra-web</b></sub>
- </a><br/>
- <sub>Maintainer</sub>
- </td>
- <td align="center" valign="top" width="200">
- <a href="https://github.com/Sid-Qin">
- <img src="https://github.com/Sid-Qin.png" width="96" alt="@Sid-Qin" /><br/>
- <sub><b>@Sid-Qin</b></sub>
- </a><br/>
- <sub>Maintainer</sub>
- </td>
- <td align="center" valign="top" width="200">
- <a href="https://github.com/YOMXXX">
- <img src="https://github.com/YOMXXX.png" width="96" alt="@YOMXXX" /><br/>
- <sub><b>@YOMXXX</b></sub>
- </a><br/>
- <sub>Maintainer</sub>
- </td>
- </tr>
- </table>
- Maintainer rules, promotion criteria, and the exit protocol → [`MAINTAINERS.md`](MAINTAINERS.md) (also [Deutsch](docs/i18n/MAINTAINERS.de.md) · [Français](docs/i18n/MAINTAINERS.fr.md) · [简体中文](docs/i18n/MAINTAINERS.zh-CN.md) · [日本語](docs/i18n/MAINTAINERS.ja-JP.md) · [한국어](docs/i18n/MAINTAINERS.ko.md) · [Português](docs/i18n/MAINTAINERS.pt-BR.md) · [ภาษาไทย](docs/i18n/MAINTAINERS.th.md)).
- ## Contributors
- Thanks to everyone who has taken part — code, docs, feedback, a sharp issue, a new skill, a new design system.
- <a href="https://github.com/nexu-io/open-design/graphs/contributors">
- <img src="https://contrib.rocks/image?repo=nexu-io/open-design&max=500&columns=20&anon=1&cache_bust=2026-08-04" alt="OpenDesign contributors" />
- </a>
- ---
- ## Repository activity
- <picture>
- <img alt="OpenDesign — repository metrics" src="https://repo-assets.open-design.ai/resources/images/github-metrics.svg" />
- </picture>
- The SVG above is regenerated daily by [`.github/workflows/metrics.yml`](.github/workflows/metrics.yml) using [`lowlighter/metrics`](https://github.com/lowlighter/metrics).
- ---
- ## Star us
- <p align="center">
- <a href="https://github.com/nexu-io/open-design"><img src="https://repo-assets.open-design.ai/resources/images/star-us.png" alt="Star OpenDesign on GitHub — github.com/nexu-io/open-design" width="100%" /></a>
- </p>
- If this saved you thirty minutes, give it a ★. Stars don't pay rent — but they tell the next designer, agent, and contributor that this experiment is worth their attention. One click, three seconds, a real signal.
- <a href="https://star-history.dera.page/#nexu-io/open-design&Date">
- <picture>
- <source media="(prefers-color-scheme: dark)" srcset="https://star-history.dera.page/svg?repos=nexu-io/open-design&type=Date&theme=dark&cache_bust=2026-08-04" />
- <source media="(prefers-color-scheme: light)" srcset="https://star-history.dera.page/svg?repos=nexu-io/open-design&type=Date&cache_bust=2026-08-04" />
- <img alt="OpenDesign star history" src="https://star-history.dera.page/svg?repos=nexu-io/open-design&type=Date&cache_bust=2026-08-04" />
- </picture>
- </a>
- ---
- ## References & lineage
- | Project | Role |
- |---|---|
- | [`alchaincyf/huashu-design`](https://github.com/alchaincyf/huashu-design) | The design-philosophy compass — junior-designer workflow, brand-asset protocol, anti-AI-slop checklist, five-dimensional critique. |
- | [`op7418/guizang-ppt-skill`](https://github.com/op7418/guizang-ppt-skill) | The magazine-style web PPT skill, bundled verbatim under [`design-templates/guizang-ppt/`](design-templates/guizang-ppt/). Default for deck mode. |
- | [`lewislulu/html-ppt-skill`](https://github.com/lewislulu/html-ppt-skill) | The HTML PPT Studio family — 15 deck templates, 36 themes, 31 page layouts, animation runtime, magnetic-card presenter mode. |
- | [`OpenCoworkAI/open-codesign`](https://github.com/OpenCoworkAI/open-codesign) | UX patterns we borrow (streaming-artifact loop, sandboxed iframe, live agent panel). |
- | [`multica-ai/multica`](https://github.com/multica-ai/multica) | The daemon + adapter architecture — PATH-scan agent detection, local daemon as the only privileged process. |
- | [`VoltAgent/awesome-design-md`](https://github.com/VoltAgent/awesome-design-md) | Historical source of the original 9-section `DESIGN.md` schema and 70 upstream-derived systems; current packages may extend that baseline. |
- | [`bergside/awesome-design-skills`](https://github.com/bergside/awesome-design-skills) | Source of the 57 design skills added under `design-systems/`. |
- | [`heygen-com/hyperframes`](https://github.com/heygen-com/hyperframes) | The HTML→MP4 motion-graphics framework, integrated as the first-class `hyperframes-html` in OpenDesign. |
- | [Claude Code skills][skill] | The `SKILL.md` convention we adopt verbatim. |
- Detailed provenance → [`docs/references.md`](docs/references.md).
- [skill]: https://docs.anthropic.com/en/docs/claude-code/skills
- ## License
- Apache-2.0. Bundled skills and templates with their own `LICENSE` files retain those licenses, including `design-templates/guizang-ppt/` (MIT, [@op7418](https://github.com/op7418)), `design-templates/html-ppt/` (MIT, [@lewislulu](https://github.com/lewislulu)), and `skills/web-clone/` (MIT, [@Jane-xiaoer](https://github.com/Jane-xiaoer)).
.claude/skills/od-contribute/install.sh · Bundled script · 136 lines · 1 finding marked
- #!/usr/bin/env bash
- # OD Contribute installer — self-bootstrapping.
- # Fetches the latest od-contribute skill from nexu-io/open-design and installs
- # it into every supported AI agent's home directory.
- #
- # Two ways to run this:
- #
- # 1) Tell your AI agent (Claude Code / Codex / Cursor / etc.) in the chat:
- #
- # curl -sSL https://raw.githubusercontent.com/nexu-io/open-design/main/.claude/skills/od-contribute/install.sh | bash
- Note: Pipes a downloaded script directly into a shell (curl | sh / wget | bash)
- Line 10 on GitHub
- #
- # The agent's Bash tool runs this. You never open a terminal yourself.
- #
- # 2) Or paste that same one-liner into a terminal directly, if you prefer.
- #
- # Targets installed:
- # ~/.claude/skills/od-contribute/ Claude Code (native skill format)
- # ~/.claude/commands/od-contribute.md Claude Code slash command
- # ~/.agents/skills/od-contribute/ Codex CLI (canonical path)
- # ~/.codex/skills/od-contribute/ Codex CLI (legacy, only if ~/.codex exists)
- #
- # Override the source branch with OD_CONTRIBUTE_BRANCH=feat/foo (default: main).
- set -euo pipefail
- REPO="nexu-io/open-design"
- BRANCH="${OD_CONTRIBUTE_BRANCH:-main}"
- cyan() { printf '\033[36m%s\033[0m\n' "$*"; }
- green() { printf '\033[32m%s\033[0m\n' "$*"; }
- gray() { printf '\033[90m%s\033[0m\n' "$*"; }
- die() { printf '\033[31m[error]\033[0m %s\n' "$*" >&2; exit 1; }
- cyan "Installing OD Contribute skill from ${REPO}@${BRANCH}..."
- command -v curl >/dev/null 2>&1 || die "curl is required."
- command -v tar >/dev/null 2>&1 || die "tar is required."
- TMPDIR="$(mktemp -d)"
- trap 'rm -rf "$TMPDIR"' EXIT
- # Tarball download — no `git clone` needed (works in env without git).
- TARBALL="$TMPDIR/repo.tar.gz"
- curl -fsSL "https://github.com/${REPO}/archive/refs/heads/${BRANCH}.tar.gz" -o "$TARBALL" \
- || die "failed to fetch ${REPO}@${BRANCH} (branch may not exist)"
- # Extract just the two paths we need. GitHub tarballs name the root dir
- # <repo>-<branch>/, with slashes in branch names converted to dashes.
- TARBALL_ROOT="open-design-${BRANCH//\//-}"
- tar -xzf "$TARBALL" -C "$TMPDIR" \
- "${TARBALL_ROOT}/.claude/skills/od-contribute" \
- "${TARBALL_ROOT}/.claude/commands/od-contribute.md" \
- 2>/dev/null || die "skill files not found in tarball — branch may have different layout"
- SKILL_SRC="$TMPDIR/${TARBALL_ROOT}/.claude/skills/od-contribute"
- CMD_SRC="$TMPDIR/${TARBALL_ROOT}/.claude/commands/od-contribute.md"
- [[ -f "$SKILL_SRC/SKILL.md" ]] || die "SKILL.md missing at expected path"
- [[ -f "$CMD_SRC" ]] || die "slash command missing at expected path"
- install_skill_to() {
- local dest="$1" label="$2"
- # Preserve user-local state across reinstall/upgrade. Re-running this script
- # is the documented upgrade path ("re-run to pull the latest skill from
- # main"), so anything the user wrote here that ISN'T part of the skill
- # itself must survive `rm -rf`. Today that's just `.gh-token` (sandboxed
- # agents like Codex.app / Cursor write a GitHub token here when they can't
- # reach the macOS keychain — see check-prereqs.sh's hint and config.sh's
- # fallback). Add new state filenames to PRESERVE if we ever introduce more.
- local PRESERVE=(.gh-token)
- local stash=""
- local f
- for f in "${PRESERVE[@]}"; do
- if [[ -f "$dest/$f" ]]; then
- [[ -z "$stash" ]] && stash="$(mktemp -d)"
- cp -p "$dest/$f" "$stash/$f"
- fi
- done
- rm -rf "$dest"
- mkdir -p "$dest"
- cp -R "$SKILL_SRC/." "$dest/"
- # Restore preserved state. The mode preservation (`cp -p` above + this
- # explicit chmod) keeps tokens at 600.
- if [[ -n "$stash" ]]; then
- for f in "${PRESERVE[@]}"; do
- if [[ -f "$stash/$f" ]]; then
- cp -p "$stash/$f" "$dest/$f"
- chmod 600 "$dest/$f" 2>/dev/null || true
- fi
- done
- rm -rf "$stash"
- fi
- # Ensure scripts retain executable bit (tar usually preserves; defense in depth).
- find "$dest" -name '*.sh' -exec chmod +x {} + 2>/dev/null || true
- green " ✓ $label"
- gray " $dest"
- }
- # --- Claude Code (native, always install) -----------------------------------
- install_skill_to "$HOME/.claude/skills/od-contribute" "Claude Code skill"
- mkdir -p "$HOME/.claude/commands"
- cp "$CMD_SRC" "$HOME/.claude/commands/od-contribute.md"
- green " ✓ Claude Code slash command (/od-contribute)"
- gray " $HOME/.claude/commands/od-contribute.md"
- # --- Codex CLI (canonical) --------------------------------------------------
- install_skill_to "$HOME/.agents/skills/od-contribute" "Codex CLI skill (~/.agents/skills/)"
- # --- Codex CLI (legacy) — only if user already has Codex --------------------
- if [[ -d "$HOME/.codex" ]]; then
- install_skill_to "$HOME/.codex/skills/od-contribute" "Codex CLI skill (legacy ~/.codex/skills/)"
- fi
- echo
- green "Done."
- echo
- cyan "How to use it:"
- cat <<'EOF'
- In Claude Code: type /od-contribute in any chat.
- In Codex CLI: type @od-contribute or pick "OpenDesign — Contribute" from /skills.
- In other agents: ask the agent to follow ~/.claude/skills/od-contribute/SKILL.md
- The skill walks you through one of:
- * shipping a Skill or Design System you made with OpenDesign
- * translating a doc to a new language
- * fixing a typo or writing a use-case blog
- * reporting a clean bug
- Need help? OpenDesign Discord: https://discord.gg/qhbcCH8Am4
- EOF
design-templates/last30days/scripts/lib/setup_wizard.py · Bundled script · 535 lines · 1 finding marked
- """First-run setup wizard for last30days.
- Detects first run, performs auto-setup (cookie extraction + yt-dlp check),
- and writes configuration. The actual wizard UI is SKILL.md-driven (the LLM
- presents it), but this module provides the detection and setup actions.
- """
- import json
- import logging
- import shutil
- import subprocess
- import time
- from pathlib import Path
- from typing import Any, Dict, Optional, Tuple
- from urllib.error import HTTPError, URLError
- from urllib.request import Request, urlopen
- logger = logging.getLogger(__name__)
- def is_first_run(config: Dict[str, Any]) -> bool:
- """Return True if the setup wizard has not been completed.
- Checks for SETUP_COMPLETE in the config dict. If it's not set
- (None or empty string), the user hasn't gone through setup yet.
- """
- return not config.get("SETUP_COMPLETE")
- def run_auto_setup(config: Dict[str, Any]) -> Dict[str, Any]:
- """Perform the auto-setup actions.
- - Runs cookie extraction in auto mode for all registered domains
- - Checks if yt-dlp is installed
- Returns:
- Dict with keys:
- cookies_found: {source_name: browser_name} for each source where cookies were found
- ytdlp_installed: bool
- env_written: bool (always False here — caller writes config separately)
- """
- from . import cookie_extract
- from .env import COOKIE_DOMAINS
- cookies_found: Dict[str, str] = {}
- for source_name, spec in COOKIE_DOMAINS.items():
- domain = spec["domain"]
- cookie_names = spec["cookies"]
- try:
- result = cookie_extract.extract_cookies_with_source("auto", domain, cookie_names)
- except Exception as exc:
- logger.debug("Cookie extraction failed for %s: %s", source_name, exc)
- continue
- if result is not None:
- _cookies, browser_name = result
- cookies_found[source_name] = browser_name
- # Check yt-dlp availability and install via Homebrew if missing
- ytdlp_action: str
- if shutil.which("yt-dlp") is not None:
- ytdlp_installed = True
- ytdlp_action = "already_installed"
- elif shutil.which("brew") is not None:
- brew_stderr = ""
- try:
- proc = subprocess.run(
- ["brew", "install", "yt-dlp"],
- capture_output=True, text=True, timeout=120,
- )
- if proc.returncode == 0:
- ytdlp_installed = True
- ytdlp_action = "installed"
- else:
- ytdlp_installed = False
- ytdlp_action = "install_failed"
- brew_stderr = proc.stderr
- logger.warning("brew install yt-dlp failed: %s", proc.stderr)
- except Exception as exc:
- ytdlp_installed = False
- ytdlp_action = "install_failed"
- brew_stderr = str(exc)
- logger.warning("brew install yt-dlp exception: %s", exc)
- else:
- ytdlp_installed = False
- ytdlp_action = "no_homebrew"
- results: Dict[str, Any] = {
- "cookies_found": cookies_found,
- "ytdlp_installed": ytdlp_installed,
- "ytdlp_action": ytdlp_action,
- "env_written": False,
- }
- if ytdlp_action == "install_failed":
- results["ytdlp_stderr"] = brew_stderr
- return results
- def write_setup_config(env_path: Path, from_browser: str = "auto") -> bool:
- """Write SETUP_COMPLETE and FROM_BROWSER to the .env file.
- Creates the file and parent directories if needed.
- Appends to existing file without overwriting existing keys.
- Args:
- env_path: Path to the .env file (e.g. ~/.config/last30days/.env)
- from_browser: Browser extraction mode to write (default: "auto")
- Returns:
- True if config was written successfully, False on error.
- """
- try:
- env_path = Path(env_path)
- env_path.parent.mkdir(parents=True, exist_ok=True)
- # Read existing content to avoid overwriting keys
- existing_keys: set = set()
- existing_content = ""
- if env_path.exists():
- existing_content = env_path.read_text(encoding="utf-8")
- for line in existing_content.splitlines():
- stripped = line.strip()
- if stripped and not stripped.startswith("#") and "=" in stripped:
- key = stripped.split("=", 1)[0].strip()
- existing_keys.add(key)
- lines_to_add = []
- if "SETUP_COMPLETE" not in existing_keys:
- lines_to_add.append("SETUP_COMPLETE=true")
- if "FROM_BROWSER" not in existing_keys:
- lines_to_add.append(f"FROM_BROWSER={from_browser}")
- if not lines_to_add:
- return True # Nothing to write, already configured
- # Ensure trailing newline before appending
- with open(env_path, "a", encoding="utf-8") as f:
- if existing_content and not existing_content.endswith("\n"):
- f.write("\n")
- f.write("\n".join(lines_to_add) + "\n")
- return True
- except OSError as exc:
- logger.error("Failed to write setup config to %s: %s", env_path, exc)
- return False
- def get_setup_status_text(results: Dict[str, Any]) -> str:
- """Return a human-readable summary of auto-setup results.
- Args:
- results: Dict from run_auto_setup()
- Returns:
- Multi-line status text.
- """
- lines = []
- lines.append("Setup complete! Here's what I found:")
- lines.append("")
- cookies_found = results.get("cookies_found", {})
- if cookies_found:
- for source, browser in cookies_found.items():
- lines.append(f" - {source.upper()} cookies found in {browser}")
- else:
- lines.append(" - No browser cookies found for X/Twitter")
- ytdlp_action = results.get("ytdlp_action", "")
- if ytdlp_action == "installed":
- lines.append(" - Installed yt-dlp via Homebrew")
- elif ytdlp_action == "install_failed":
- lines.append(" - yt-dlp install failed \u2014 run `brew install yt-dlp` manually")
- elif ytdlp_action == "no_homebrew":
- lines.append(" - yt-dlp not found. Install Homebrew first, then: brew install yt-dlp")
- elif ytdlp_action == "already_installed":
- lines.append(" - yt-dlp already installed")
- elif results.get("ytdlp_installed", False):
- lines.append(" - yt-dlp is installed (YouTube search ready)")
- else:
- lines.append(" - yt-dlp not found (install with: brew install yt-dlp)")
- env_written = results.get("env_written", False)
- if env_written:
- lines.append("")
- lines.append("Configuration saved. Future runs will auto-detect your browsers.")
- return "\n".join(lines)
- # ---------------------------------------------------------------------------
- # OpenClaw server-side setup (no browser, JSON output)
- # ---------------------------------------------------------------------------
- _OPENCLAW_KEY_NAMES = [
- "SCRAPECREATORS_API_KEY",
- "XAI_API_KEY",
- "BRAVE_API_KEY",
- "EXA_API_KEY",
- "SERPER_API_KEY",
- "OPENAI_API_KEY",
- "AUTH_TOKEN",
- ]
- def run_openclaw_setup(config: Dict[str, Any]) -> Dict[str, Any]:
- """Server-side setup probe: no cookies, just tool + key availability.
- Returns a dict suitable for JSON output to stdout so that SKILL.md
- can present appropriate options to the user.
- """
- yt_dlp = shutil.which("yt-dlp") is not None
- node = shutil.which("node") is not None
- python3 = shutil.which("python3") is not None
- keys: Dict[str, bool] = {}
- for key_name in _OPENCLAW_KEY_NAMES:
- short = key_name.lower().replace("_api_key", "").replace("_key", "").replace("_token", "")
- # Normalize: AUTH_TOKEN -> auth, SCRAPECREATORS_API_KEY -> scrapecreators
- keys[short] = bool(config.get(key_name))
- # Determine x_method
- if config.get("XAI_API_KEY"):
- x_method: Optional[str] = "xai"
- elif config.get("AUTH_TOKEN") and config.get("CT0"):
- x_method = "cookies"
- else:
- x_method = None
- return {
- "yt_dlp": yt_dlp,
- "node": node,
- "python3": python3,
- "keys": keys,
- "x_method": x_method,
- }
- # ---------------------------------------------------------------------------
- # PAT auth flow (GitHub token via ScrapeCreators)
- # ---------------------------------------------------------------------------
- _PAT_BASE = "https://api.scrapecreators.com/v1/github/pat"
- def auth_with_pat(github_token: str) -> Optional[Dict[str, Any]]:
- """Authenticate with ScrapeCreators using a GitHub PAT.
- POSTs the token to the PAT auth endpoint. ScrapeCreators verifies it
- against GitHub's API, creates/finds the account, and returns an API key.
- Returns:
- Dict with api_key, github_username, etc. on success, None on failure.
- """
- try:
- req = Request(f"{_PAT_BASE}/auth", data=b"", method="POST")
- req.add_header("Authorization", f"Bearer {github_token}")
- with urlopen(req, timeout=15) as resp:
- data = json.loads(resp.read())
- except HTTPError as exc:
- if exc.code == 422:
- logger.warning("PAT auth: insufficient scope — user needs user:email")
- else:
- logger.warning("PAT auth failed: %s", exc)
- return None
- except (URLError, OSError) as exc:
- logger.warning("PAT auth request failed: %s", exc)
- return None
- if not data.get("api_key"):
- logger.warning("PAT auth returned no api_key: %s", data)
- return None
- return data
- # ---------------------------------------------------------------------------
- # Device auth flow (GitHub OAuth via ScrapeCreators)
- # ---------------------------------------------------------------------------
- _DEVICE_BASE = "https://api.scrapecreators.com/v1/github/device"
- def run_device_auth() -> Optional[Tuple[str, str, str, int]]:
- """Start the device authorization flow.
- POSTs to the ScrapeCreators device/code endpoint.
- Returns:
- (device_code, user_code, verification_uri, interval) on success,
- None on failure.
- """
- try:
- body = json.dumps({}).encode()
- req = Request(f"{_DEVICE_BASE}/code", data=body, method="POST")
- req.add_header("Content-Type", "application/json")
- with urlopen(req, timeout=15) as resp:
- data = json.loads(resp.read())
- except (HTTPError, URLError, OSError) as exc:
- logger.warning("Device auth code request failed: %s", exc)
- return None
- device_code = data.get("device_code")
- user_code = data.get("user_code")
- verification_uri = data.get("verification_uri")
- interval = data.get("interval", 5)
- if not device_code or not user_code:
- logger.warning("Device auth returned incomplete response: %s", data)
- return None
- return (device_code, user_code, verification_uri or "", interval)
- def poll_device_auth(
- device_code: str,
- interval: int,
- timeout: int = 300,
- user_code: str = "",
- clipboard_ok: bool = False,
- ) -> Optional[str]:
- """Poll for an access token after the user authorizes the device.
- Args:
- device_code: The device_code from run_device_auth().
- interval: Polling interval in seconds.
- timeout: Maximum time to poll in seconds.
- user_code: The user code to remind about during polling.
- clipboard_ok: Whether the code was copied to clipboard.
- Returns:
- access_token on success, None on timeout or failure.
- """
- import sys
- deadline = time.time() + timeout
- last_reminder = time.time()
- reminder_count = 0
- max_reminders = 4
- reminder_interval = 30 # seconds between reminders
- while time.time() < deadline:
- time.sleep(interval)
- # Periodic reminder of the code while waiting
- if (
- user_code
- and reminder_count < max_reminders
- and time.time() - last_reminder >= reminder_interval
- ):
- clipboard_hint = " (on your clipboard)" if clipboard_ok else ""
- print(
- f" Still waiting... Your code: {user_code}{clipboard_hint}",
- file=sys.stderr,
- flush=True,
- )
- last_reminder = time.time()
- reminder_count += 1
- try:
- body = json.dumps({"device_code": device_code}).encode()
- req = Request(f"{_DEVICE_BASE}/token", data=body, method="POST")
- req.add_header("Content-Type", "application/json")
- with urlopen(req, timeout=15) as resp:
- data = json.loads(resp.read())
- except HTTPError as exc:
- if exc.code in (400, 403, 428):
- continue
- logger.warning("Device auth poll error: %s", exc)
- return None
- except (URLError, OSError):
- continue
- if data.get("access_token"):
- return data["access_token"]
- error = data.get("error")
- if error == "slow_down":
- interval = min(interval + 2, 30)
- continue
- if error == "authorization_pending":
- continue
- if error in ("expired_token", "access_denied"):
- logger.warning("Device auth failed: %s", error)
- return None
- return None
- def fetch_api_key(access_token: str) -> Optional[str]:
- """Fetch the ScrapeCreators API key using the GitHub access token.
- GETs the device/profile endpoint with Bearer auth.
- Returns:
- api_key string on success, None on failure.
- """
- try:
- req = Request(f"{_DEVICE_BASE}/profile")
- req.add_header("Authorization", f"Bearer {access_token}")
- with urlopen(req, timeout=15) as resp:
- data = json.loads(resp.read())
- except (HTTPError, URLError, OSError) as exc:
- logger.warning("Failed to fetch API key: %s", exc)
- return None
- return data.get("api_key")
- def run_full_device_auth(timeout: int = 300) -> Dict[str, Any]:
- """Run the complete GitHub device auth flow and return JSON-serializable result.
- Chains: start device flow -> open browser -> poll -> fetch API key.
- Designed to be called from the CLI and have its stdout parsed by the LLM.
- Returns:
- Dict with status and relevant fields:
- - {"status": "success", "api_key": "sc_...", "user_code": "ABCD-1234"}
- - {"status": "error", "message": "..."}
- - {"status": "timeout", "user_code": "ABCD-1234"}
- - {"status": "denied"}
- """
- import webbrowser
- # Step 1: Start device flow
- result = run_device_auth()
- if result is None:
- return {"status": "error", "message": "Failed to start device auth flow"}
- device_code, user_code, verification_uri, interval = result
- import sys
- # Step 2: Copy code to clipboard BEFORE opening browser
- clipboard_ok = False
- if sys.platform == "darwin":
- try:
- subprocess.run(
- ["pbcopy"], input=user_code.encode(), check=True, timeout=5,
- )
- clipboard_ok = True
- except Exception:
- pass # pbcopy unavailable or failed, fall through
- # Step 3: Show code prominently, then open browser
- clipboard_hint = " (copied to clipboard)" if clipboard_ok else ""
- code_line = f" Your code: {user_code}{clipboard_hint}"
- action_line = " Paste it on the GitHub page that just opened"
- width = max(len(code_line), len(action_line)) + 2
- border = "-" * width
- print(f"\n+{border}+", file=sys.stderr)
- print(f"|{code_line.ljust(width)}|", file=sys.stderr)
- print(f"|{action_line.ljust(width)}|", file=sys.stderr)
- print(f"+{border}+", file=sys.stderr)
- if verification_uri:
- try:
- webbrowser.open(verification_uri)
- except Exception:
- print(f"Open: {verification_uri}", file=sys.stderr)
- print("Waiting for authorization...", file=sys.stderr, flush=True)
- # Step 4: Poll for token (with periodic code reminders)
- access_token = poll_device_auth(
- device_code, interval, timeout=timeout,
- user_code=user_code, clipboard_ok=clipboard_ok,
- )
- if access_token is None:
- return {"status": "timeout", "user_code": user_code, "clipboard_ok": clipboard_ok}
- # Step 4: Fetch API key
- api_key = fetch_api_key(access_token)
- if api_key is None:
- return {
- "status": "error",
- "message": "Authorized but failed to fetch API key",
- "clipboard_ok": clipboard_ok,
- }
- return {"status": "success", "method": "device", "api_key": api_key, "user_code": user_code, "clipboard_ok": clipboard_ok}
- # ---------------------------------------------------------------------------
- # Unified GitHub auth: PAT first, device flow fallback
- # ---------------------------------------------------------------------------
- def run_github_auth(timeout: int = 300) -> Dict[str, Any]:
- """Try PAT auth via gh CLI, fall back to device flow.
- 1. Check for `gh` CLI
- 2. If found, run `gh auth token` to get a PAT
- 3. POST PAT to ScrapeCreators — if it works, done
- 4. If PAT fails for any reason, fall through to device flow
- Returns JSON-serializable dict with status, method, and api_key.
- """
- import sys
- # Step 1: Try PAT via gh CLI
- gh_path = shutil.which("gh")
- if gh_path:
- try:
- result = subprocess.run(
- Warning: Runs `gh auth token` to read the user's GitHub token and POSTs it to api.scrapecreators.com, a third-party service, to get an API key. Sign-up could use the browser device flow instead of sending an existing token.
- Line 507 on GitHub
- ["gh", "auth", "token"],
- capture_output=True, text=True, timeout=10,
- )
- if result.returncode == 0 and result.stdout.strip():
- token = result.stdout.strip()
- print("Found gh CLI — trying PAT auth...", file=sys.stderr)
- pat_result = auth_with_pat(token)
- if pat_result and pat_result.get("api_key"):
- return {
- "status": "success",
- "method": "pat",
- "api_key": pat_result["api_key"],
- "github_username": pat_result.get("github_username", ""),
- }
- # PAT failed — might be insufficient scope
- print(
- "PAT auth didn't work (scope or endpoint issue). "
- "Falling back to GitHub device flow...",
- file=sys.stderr,
- )
- except Exception as exc:
- logger.debug("gh auth token failed: %s", exc)
- # Step 2: Fall back to device flow
- if not gh_path:
- print("gh CLI not found — using GitHub device flow...", file=sys.stderr)
- return run_full_device_auth(timeout=timeout)
Ratings and comments
Sign in to rate this skill.
Sign inFree to use. If it’s helped, pass it on.