mirror of
https://github.com/nexu-io/open-design.git
synced 2026-05-31 19:04:39 +07:00
* chore(agent): 增加对 Qoder CLI 的支持和识别 - 在 QUICKSTART 文档中添加 Qoder CLI 为可选本地 agent CLI - 更新代码中 agents.ts 注释包含 Qoder CLI 扫描支持 - 修改首次加载时检测的可用 CLI 列表,加入 Qoder CLI - 在多个语言版本的 README 中增加 Qoder CLI 支持及相关徽章统计 - 更新 agent 适配器与事件解析相关的代码注释和文档,包含 qoder-stream-json 解析器 - 调整 Windows 下 spawn 行为以支持 Qoder CLI 的 stdin 提供 prompt - 修复多语言文档对支持的 CLI 数量描述错误,确保数据保持同步 Change-Id: I388f2f61c60ce8faa7cef5d84eb407950f8bdbfb Co-developed-by: Qoder <noreply@qoder.com> * chore(agent): 增加对 Qoder CLI 的支持和识别 - 在 QUICKSTART 文档中添加 Qoder CLI 为可选本地 agent CLI - 更新代码中 agents.ts 注释包含 Qoder CLI 扫描支持 - 修改首次加载时检测的可用 CLI 列表,加入 Qoder CLI - 在多个语言版本的 README 中增加 Qoder CLI 支持及相关徽章统计 - 更新 agent 适配器与事件解析相关的代码注释和文档,包含 qoder-stream-json 解析器 - 调整 Windows 下 spawn 行为以支持 Qoder CLI 的 stdin 提供 prompt - 修复多语言文档对支持的 CLI 数量描述错误,确保数据保持同步 Change-Id: Id33f125b7c0b1a1c0b0274073da74d1578c324f7 Co-developed-by: Qoder <noreply@qoder.com> * feat(agent-icon): 添加新的Qoder徽标SVG图形组件 - 新增qoderGlyph函数,返回指定大小的SVG格式图形 - 图形包含多路径定义,颜色使用深灰和绿色填充 - 该组件可用于替代或补充现有AgentIcon图标功能 - 提升应用程序的品牌标识和视觉表现力 Change-Id: I4eca18166b5e33bc6229b40b2531d5a54607a560 Co-developed-by: Qoder <noreply@qoder.com> * Translate to English: --- **docs(readme): update to expand CLI agents to 16** - Increased the number of coding agent CLIs from 11 to 16 - New agents included: Devin for Terminal, Kiro CLI, Kilo, Mistral Vibe CLI, DeepSeek TUI **docs(readme): update to expand supported coding agents to 16** - Increased the number of supported code agent CLIs from 11 to 16 - Added support for new CLI tools: Devin for Terminal, Kiro CLI, Kilo, Mistral Vibe CLI, DeepSeek CLI - Added automatic CLI detection and switching while maintaining support for more agents - Added BYOK proxy TUI - Expanded compatibility and support coverage in the README’s multiple language versions - Reflected changes across all README translations (Arabic, German, French, Japanese, Korean) - Updated badges and descriptions to reflect CLI count and feature changes - Added event parsers and protocols for the new CLIs in the agent transport implementation - Updated the BYOK proxy and tool exploration features to be compatible with the expanded CLIs Change-Id: I89786b4a0b09bd279fb23265c2177076206fc5af Co-developed-by: Qoder <noreply@qoder.com> * feat(daemon): 支持 imagePaths 参数作为附件路径传递给 Qoder - 修改 buildArgs 函数,添加 --attachment 参数处理 imagePaths 中的绝对路径 - 过滤并忽略空字符串、非字符串及相对路径的 imagePaths 项 - 在单元测试中覆盖 imagePaths 参数支持及无效项过滤逻辑 - 在文档中补充 Qoder 运行时适配器对 --attachment 参数的说明 Change-Id: Ibfc3583ba86c6d258d524912559e97b77bf1dc87 Co-developed-by: Qoder <noreply@qoder.com> * docs(runtime): 说明Qoder适配器继承用户令牌的环境变量 - 添加文档说明检测代理仅为可用性探针,不进行身份验证 - 说明Qoder CLI账号状态独立,认证通过运行时错误路径反馈 - 详细描述子进程环境继承机制及静态环境变量与用户私密令牌区分 - 明确QODER_PERSONAL_ACCESS_TOKEN通过守护进程环境传递,不写入静态环境 - 解释Qoder验证由Qoder CLI负责,支持持久登录和自动化环境变量注入 test(agent): 添加QODER_PERSONAL_ACCESS_TOKEN环境变量继承测试 - 验证qoder适配器环境继承守护进程中的QODER_PERSONAL_ACCESS_TOKEN - 确认qoder适配器未在静态环境变量中定义用户令牌 - 保证用户私密令牌不会被写入静态适配器环境配置 Change-Id: Ie61869afbe497df1b16879b4e47b35123f758ed8 Co-developed-by: Qoder <noreply@qoder.com> * fix(daemon): 改进Qoder模式支持及错误处理机制 - 更新Qoder CLI参数,使用`--yolo`替代`--permission-mode bypass_permissions` - 将工作目录参数从`--cwd`改为`-w`以符合Qoder文档 - 在agent流事件处理中新增错误捕获并通过SSE错误事件发送 - 运行结束时若检测到agent流错误,则标记运行失败 - 测试中fix(daemon): 优化Qoder代理参数与错误处理 - 调整Qoder启动参数,改用`--yolo`和`-w`替代旧参数,避开argv长度限制 - 增强代理流事件处理,捕获并通过SSE错误通同步更新Qoder参数使用及相应断言 - 新增端到端测试,覆盖Qoder助手错误通过SSE错误通道反馈及运行状态失败处理 - 补充工具函数辅助测试事件流读取与运行状态轮询 Change-Id: I5d933745c3659e093b0d2d807f22726e7f83eb48 Co-developed-by: Qoder <noreply@qoder.com> * feat(qoder-stream): 识别并报告Qoder运行错误事件 - 新增messageFromResult函数以从结果对象提取错误信息 - 在处理result事件时根据is_error字段触发error事件 - error事件携带具体错误消息和原始数据 - 添加测试验证Qoder运行返回is_error且退出码为0时正确触发错误事件 - 更新qoder流解析测试以校验错误事件映射 - 在聊天路由测试中增加针对Qoder错误运行的端到端场景验证 Change-Id: Ie98ac518135dbec3181c52de5a49afdea993e279 Co-developed-by: Qoder <noreply@qoder.com>
230 lines
14 KiB
Markdown
230 lines
14 KiB
Markdown
# Quickstart
|
|
|
|
<p align="center"><b>English</b> · <a href="QUICKSTART.pt-BR.md">Português (Brasil)</a> · <a href="QUICKSTART.de.md">Deutsch</a> · <a href="QUICKSTART.fr.md">Français</a> · <a href="QUICKSTART.ja-JP.md">日本語</a> · <a href="QUICKSTART.zh-CN.md">简体中文</a></p>
|
|
|
|
Run the full product locally.
|
|
|
|
## Environment requirements
|
|
|
|
- **Node.js:** `~24` (Node 24.x). The repo enforces this through `package.json#engines`.
|
|
- **pnpm:** `10.33.x`. The repo pins `pnpm@10.33.2` through `packageManager`; use Corepack so the pinned version is selected automatically.
|
|
- **OS:** macOS, Linux, and WSL2 are the primary paths. Windows native should work for most flows, but WSL2 is the safer baseline.
|
|
- **Optional local agent CLI:** Claude Code, Codex, Devin for Terminal, Gemini CLI, OpenCode, Cursor Agent, Qwen, Qoder CLI, GitHub Copilot CLI, etc. If none are installed, use the BYOK API mode from Settings.
|
|
|
|
`nvm` / `fnm` are optional convenience tools, not required project setup. If you use one, install/select Node 24 before running pnpm:
|
|
|
|
```bash
|
|
# nvm
|
|
nvm install 24
|
|
nvm use 24
|
|
|
|
# fnm
|
|
fnm install 24
|
|
fnm use 24
|
|
```
|
|
|
|
Then enable Corepack and let the repo select pnpm:
|
|
|
|
```bash
|
|
corepack enable
|
|
corepack pnpm --version # should print 10.33.2
|
|
```
|
|
|
|
## One-shot (dev mode)
|
|
|
|
```bash
|
|
corepack enable
|
|
pnpm install
|
|
pnpm tools-dev run web # starts daemon + web in the foreground
|
|
# open the web URL printed by tools-dev
|
|
```
|
|
|
|
For the desktop shell and all managed sidecars in the background:
|
|
|
|
```bash
|
|
pnpm tools-dev # starts daemon + web + desktop in the background
|
|
```
|
|
|
|
On first load, the app detects your installed code-agent CLI (Claude Code / Codex / Devin for Terminal / Gemini / OpenCode / Cursor Agent / Qwen / Qoder CLI), picks it automatically, and defaults to `web-prototype` skill + `Neutral Modern` design system. Type a prompt and hit **Send**. The agent streams into the left pane; the `<artifact>` tag is parsed out and the HTML renders live on the right. When it finishes, click **Save to disk** to persist the artifact under `./.od/artifacts/<timestamp>-<slug>/index.html`.
|
|
|
|
The **Design system** dropdown ships with **129 design systems** — 2 hand-authored starters (Neutral Modern, Warm Editorial), 70 bundled product systems, and 57 design skills sourced from [`awesome-design-skills`](https://github.com/bergside/awesome-design-skills). Pick one to skin every prototype in that brand's aesthetic.
|
|
|
|
The **Skill** dropdown groups by mode (Prototype / Deck / Template / Design system) and shows the default skill per mode with a `· default` suffix. Bundled skills:
|
|
|
|
- **Prototype** — `web-prototype` (generic), `saas-landing`, `dashboard`, `pricing-page`, `docs-page`, `blog-post`, `mobile-app`.
|
|
- **Deck / PPT** — `simple-deck` (single-file horizontal swipe) and `magazine-web-ppt` (the `guizang-ppt` bundle from [`op7418/guizang-ppt-skill`](https://github.com/op7418/guizang-ppt-skill) — default for deck mode, ships its own assets/template + 4 references). Skills with side files get an automatic "Skill root (absolute)" preamble so the agent can resolve `assets/template.html` and `references/*.md` against the real on-disk path instead of its CWD.
|
|
|
|
Pair a skill with a design system and a single prompt produces a layout-appropriate prototype or deck in the chosen visual language.
|
|
|
|
## Other scripts
|
|
|
|
```bash
|
|
pnpm tools-dev # daemon + web + desktop in the background
|
|
pnpm tools-dev start web # daemon + web in the background
|
|
pnpm tools-dev run web # daemon + web in the foreground (e2e/dev server)
|
|
pnpm tools-dev restart # restart daemon + web + desktop
|
|
pnpm tools-dev restart --daemon-port 7457 --web-port 5175
|
|
pnpm tools-dev status # inspect managed runtimes
|
|
pnpm tools-dev logs # show daemon/web/desktop logs
|
|
pnpm tools-dev check # status + recent logs + common diagnostics
|
|
pnpm tools-dev stop # stop managed runtimes
|
|
pnpm --filter @open-design/daemon build # build apps/daemon/dist/cli.js for `od`
|
|
pnpm --filter @open-design/web build # build the web package when needed
|
|
pnpm typecheck # workspace typecheck
|
|
```
|
|
|
|
`pnpm tools-dev` is the only local lifecycle entry point. Do not use the removed legacy root aliases (`pnpm dev`, `pnpm dev:all`, `pnpm daemon`, `pnpm preview`, `pnpm start`).
|
|
|
|
During local development, `tools-dev` starts the daemon first, passes its port into `apps/web`, and `apps/web/next.config.ts` rewrites `/api/*`, `/artifacts/*`, and `/frames/*` to that daemon port so the App Router app can talk to the sibling Express process without CORS setup.
|
|
|
|
## Media generation / agent dispatcher checks
|
|
|
|
Image, video, audio, and HyperFrames skills call the local `od` CLI through environment variables injected by the daemon when it spawns an agent:
|
|
|
|
- `OD_BIN` — absolute path to `apps/daemon/dist/cli.js`.
|
|
- `OD_DAEMON_URL` — the running daemon URL.
|
|
- `OD_PROJECT_ID` — the active project id.
|
|
- `OD_PROJECT_DIR` — the active project's file directory.
|
|
|
|
If media generation fails with `OD_BIN: parameter not set`, `apps/daemon/dist/cli.js` missing, or `failed to reach daemon at http://127.0.0.1:0`, rebuild the daemon CLI and restart the managed runtime:
|
|
|
|
```bash
|
|
pnpm --filter @open-design/daemon build
|
|
pnpm tools-dev restart --daemon-port 7457 --web-port 5175
|
|
ls -la apps/daemon/dist/cli.js
|
|
curl -s http://127.0.0.1:7457/api/health
|
|
```
|
|
|
|
Then open the project from the Open Design app again instead of resuming an old terminal agent session. A daemon-spawned agent should see values like:
|
|
|
|
```bash
|
|
echo "OD_BIN=$OD_BIN"
|
|
echo "OD_PROJECT_ID=$OD_PROJECT_ID"
|
|
echo "OD_PROJECT_DIR=$OD_PROJECT_DIR"
|
|
echo "OD_DAEMON_URL=$OD_DAEMON_URL"
|
|
ls -la "$OD_BIN"
|
|
```
|
|
|
|
`OD_DAEMON_URL` must be a real daemon port such as `http://127.0.0.1:7457`, not `http://127.0.0.1:0`. The `:0` value is only an internal "pick a free port" launch hint and should not leak into agent sessions.
|
|
|
|
For the daemon-only production mode, the daemon serves the static Next.js export itself at `http://localhost:7456`, so no reverse proxy is involved.
|
|
|
|
If you place nginx in front of the daemon, keep SSE routes unbuffered and uncompressed. A common failure is the browser console showing `net::ERR_INCOMPLETE_CHUNKED_ENCODING 200 (OK)` after 80-90 seconds because nginx `gzip on` buffers chunked SSE responses even when the daemon sends `X-Accel-Buffering: no`.
|
|
|
|
```nginx
|
|
location /api/ {
|
|
proxy_pass http://127.0.0.1:7456;
|
|
|
|
proxy_buffering off;
|
|
gzip off;
|
|
|
|
proxy_read_timeout 86400s;
|
|
proxy_send_timeout 86400s;
|
|
proxy_http_version 1.1;
|
|
proxy_set_header Connection "";
|
|
|
|
proxy_set_header Host $host;
|
|
proxy_set_header X-Real-IP $remote_addr;
|
|
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
|
|
proxy_set_header X-Forwarded-Proto $scheme;
|
|
}
|
|
```
|
|
|
|
## Two execution modes
|
|
|
|
| Mode | Picker value | How a request flows |
|
|
|---|---|---|
|
|
| **Local CLI** (default when daemon detects an agent) | "Local CLI" | Frontend → daemon `/api/chat` → `spawn(<agent>, ...)` → stdout → SSE → artifact parser → preview |
|
|
| **API mode** (fallback / no CLI) | "Anthropic API" / "OpenAI API" / "Azure OpenAI" / "Google Gemini" | Frontend → daemon `/api/proxy/{provider}/stream` → provider SSE normalized to `delta/end/error` → artifact parser → preview |
|
|
|
|
Both modes feed the **same** `<artifact>` parser and the **same** sandboxed iframe. The only thing that differs is the transport and the system-prompt delivery (local CLIs have no separate system channel, so the composed prompt is folded into the user message).
|
|
|
|
## Prompt composition
|
|
|
|
For every send, the app builds a system prompt from three layers and sends it to the provider:
|
|
|
|
```
|
|
BASE_SYSTEM_PROMPT (output contract: wrap in <artifact>, no code fences)
|
|
+ active design system body (DESIGN.md — palette/type/layout)
|
|
+ active skill body (SKILL.md — workflow and output rules)
|
|
```
|
|
|
|
Swap the skill or the design system in the top bar and the next send uses the new stack. Bodies are cached in-memory per session so this is a single daemon fetch per pick.
|
|
|
|
## File map
|
|
|
|
```
|
|
open-design/
|
|
├── apps/
|
|
│ ├── daemon/ # Node/Express — spawns local agents + serves APIs
|
|
│ │ └── src/
|
|
│ │ ├── cli.ts # `od` bin entry
|
|
│ │ ├── server.ts # /api/* + static serving
|
|
│ │ ├── agents.ts # PATH scanner for claude/codex/devin/gemini/opencode/cursor-agent/qwen/qoder/copilot
|
|
│ │ ├── skills.ts # SKILL.md loader (frontmatter parser)
|
|
│ │ └── design-systems.ts # DESIGN.md loader
|
|
│ │ ├── sidecar/ # tools-dev daemon sidecar wrapper
|
|
│ │ └── tests/ # daemon package tests
|
|
│ ├── web/ # Next.js 16 App Router + React client
|
|
│ ├── app/ # App Router entrypoints
|
|
│ ├── src/ # React + TypeScript client/runtime modules
|
|
│ │ ├── App.tsx # orchestrates mode / skill / DS pickers + send
|
|
│ │ ├── providers/ # daemon + BYOK API transports
|
|
│ │ ├── prompts/ # system, discovery, directions, deck framework
|
|
│ │ ├── artifacts/ # streaming <artifact> parser + manifests
|
|
│ │ ├── runtime/ # iframe srcdoc, markdown, export helpers
|
|
│ │ └── state/ # localStorage + daemon-backed project state
|
|
│ ├── sidecar/ # tools-dev web sidecar wrapper
|
|
│ └── next.config.ts # tools-dev rewrites + prod apps/web/out export config
|
|
│ └── desktop/ # Electron runtime, launched/inspected by tools-dev
|
|
├── packages/
|
|
│ ├── contracts/ # shared web/daemon app contracts
|
|
│ ├── sidecar-proto/ # Open Design sidecar protocol contract
|
|
│ ├── sidecar/ # generic sidecar runtime primitives
|
|
│ └── platform/ # generic process/platform primitives
|
|
├── tools/dev/ # `pnpm tools-dev` lifecycle and inspect CLI
|
|
├── e2e/ # Playwright UI + external integration/Vitest harness
|
|
├── skills/ # SKILL.md — drops in from any Claude Code skill repo
|
|
│ ├── web-prototype/ # generic single-screen prototype (default for prototype mode)
|
|
│ ├── saas-landing/ # marketing page (hero / features / pricing / CTA)
|
|
│ ├── dashboard/ # admin / analytics dashboard
|
|
│ ├── pricing-page/ # standalone pricing + comparison
|
|
│ ├── docs-page/ # 3-column documentation layout
|
|
│ ├── blog-post/ # editorial long-form
|
|
│ ├── mobile-app/ # phone-frame single screen
|
|
│ ├── simple-deck/ # minimal horizontal-swipe deck
|
|
│ └── guizang-ppt/ # magazine-web-ppt — bundled deck/PPT default
|
|
│ ├── SKILL.md
|
|
│ ├── assets/template.html
|
|
│ └── references/{themes,layouts,components,checklist}.md
|
|
├── design-systems/ # DESIGN.md — 9-section schema (awesome-claude-design)
|
|
│ ├── default/ # Neutral Modern (starter)
|
|
│ ├── warm-editorial/ # Warm Editorial (starter)
|
|
│ ├── README.md # catalog overview
|
|
│ └── …129 systems # 2 starters · 70 product systems · 57 design skills
|
|
├── scripts/sync-design-systems.ts # re-import from upstream getdesign tarball
|
|
├── docs/ # product vision + spec
|
|
├── .od/ # runtime data (gitignored, auto-created)
|
|
│ ├── app.sqlite # projects / conversations / messages / tabs
|
|
│ ├── artifacts/ # one-off "Save to disk" renders
|
|
│ └── projects/<id>/ # per-project working dir + agent cwd
|
|
├── pnpm-workspace.yaml # apps/* + packages/* + tools/* + e2e
|
|
└── package.json # root quality scripts + `od` bin
|
|
```
|
|
|
|
## Troubleshooting
|
|
|
|
- **"no agents found on PATH"** — install one of: `claude`, `codex`, `devin`, `gemini`, `opencode`, `cursor-agent`, `qwen`, `qodercli`, `copilot`. Or switch to API mode in Settings and paste a provider key.
|
|
- **daemon 500 on /api/chat** — check the daemon terminal for the stderr tail; usually the CLI rejected its args. Different CLIs take different argv shapes; see `apps/daemon/src/agents.ts` `buildArgs` if you need to tweak.
|
|
- **media generation says `OD_BIN` is missing or daemon URL is `:0`** — run the media dispatcher checks above. Do not resume the old CLI session; reopen the project from the Open Design app so the daemon can inject fresh `OD_*` variables.
|
|
- **Codex loads too much plugin context** — start Open Design with `OD_CODEX_DISABLE_PLUGINS=1 pnpm tools-dev` to make daemon-spawned Codex processes run with `--disable plugins`.
|
|
- **artifact never renders** — the model produced text without wrapping in `<artifact>`. Confirm the system prompt is going through (check daemon log) and consider switching to a more capable model or a stricter skill.
|
|
|
|
## Mapping back to the vision
|
|
|
|
This Quickstart is the runnable seed of the spec in [`docs/`](docs/). The spec describes where this grows (see [`docs/roadmap.md`](docs/roadmap.md)). Highlights:
|
|
|
|
- `docs/architecture.md` describes the shipped stack: Next.js 16 App Router in front, local daemon behind it, and `apps/web/next.config.ts` rewrites in dev to keep the browser talking to the same `/api` surface.
|
|
- `docs/skills-protocol.md` describes the full `od:` frontmatter (typed inputs, sliders, capability gating). This MVP reads `name` / `description` / `triggers` / `od.mode` / `od.design_system.requires` only — extend `apps/daemon/src/skills.ts` to add the rest.
|
|
- `docs/agent-adapters.md` foresees richer dispatch (capability detection, streaming tool-calls). Our `apps/daemon/src/agents.ts` is a minimal dispatcher — enough to prove the wiring.
|
|
- `docs/modes.md` lists four modes: prototype / deck / template / design-system. We ship skills for the first two; the picker already filters by `mode`.
|