open-codesign-ai-design
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseOpen CoDesign AI Design Skill
Open CoDesign AI设计技能
Skill by ara.so — Design Skills collection.
Open CoDesign is an MIT-licensed, local-first desktop application that transforms prompts into polished prototypes, slide decks, and marketing assets. It's the open-source alternative to Claude Design, v0, Lovable, and Bolt.new — letting you bring your own API key (BYOK) for Claude, GPT, Gemini, DeepSeek, Ollama, or any OpenAI-compatible endpoint.
Key capabilities:
- Prompt → prototype/slides/PDF generation
- Multi-model support (20+ providers)
- Desktop-native Electron app (macOS 12+, Windows 10+, Linux)
- Local-first with workspace-backed sessions
- Version history and iteration tracking
- Comment mode for targeted edits
- AI-generated tweaks panels (color pickers, sliders)
- Export to HTML, PDF, PPTX, ZIP, Markdown
由ara.so提供的技能——设计技能合集。
Open CoDesign是一款MIT协议授权、本地优先的桌面应用,可将提示词转换为精美的原型、幻灯片和营销素材。它是Claude Design、v0、Lovable和Bolt.new的开源替代方案,支持用户自带API密钥(BYOK)对接Claude、GPT、Gemini、DeepSeek、Ollama或任何兼容OpenAI的端点。
核心功能:
- 提示词→原型/幻灯片/PDF生成
- 多模型支持(20+服务商)
- 基于Electron的原生桌面应用(支持macOS 12+、Windows 10+、Linux)
- 本地优先,支持工作区会话
- 版本历史与迭代追踪
- 批注模式,支持针对性编辑
- AI生成的参数调节面板(颜色选择器、滑块)
- 导出为HTML、PDF、PPTX、ZIP、Markdown格式
Installation
安装
Package Managers (Recommended)
包管理器(推荐)
macOS:
bash
brew install --cask opencoworkai/tap/open-codesignWindows (Scoop):
bash
scoop bucket add opencoworkai https://github.com/OpenCoworkAI/scoop-bucket
scoop install opencoworkai/open-codesignWindows (winget - pending approval):
bash
winget install OpenCoworkAI.OpenCoDesignmacOS:
bash
brew install --cask opencoworkai/tap/open-codesignWindows(Scoop):
bash
scoop bucket add opencoworkai https://github.com/OpenCoworkAI/scoop-bucket
scoop install opencoworkai/open-codesignWindows(winget - 待审核):
bash
winget install OpenCoworkAI.OpenCoDesignDirect Downloads
直接下载
Download from GitHub Releases:
- macOS (Apple Silicon):
open-codesign-*-arm64.dmg - macOS (Intel):
open-codesign-*-x64.dmg - Windows (x64):
open-codesign-*-x64-setup.exe - Windows (ARM64):
open-codesign-*-arm64-setup.exe - Linux (AppImage):
open-codesign-*-x64.AppImage - Linux (Debian/Ubuntu):
open-codesign-*-x64.deb - Linux (Fedora/RHEL):
open-codesign-*-x64.rpm
从GitHub Releases下载:
- macOS(Apple Silicon):
open-codesign-*-arm64.dmg - macOS(Intel):
open-codesign-*-x64.dmg - Windows(x64):
open-codesign-*-x64-setup.exe - Windows(ARM64):
open-codesign-*-arm64-setup.exe - Linux(AppImage):
open-codesign-*-x64.AppImage - Linux(Debian/Ubuntu):
open-codesign-*-x64.deb - Linux(Fedora/RHEL):
open-codesign-*-x64.rpm
macOS Security Workaround
macOS安全绕过方案
Installers are not yet notarized. On macOS Sequoia 15+:
bash
xattr -cr "/Applications/Open CoDesign.app"Then launch normally. On Windows, click "More info" → "Run anyway" when SmartScreen appears.
安装程序尚未完成公证。在macOS Sequoia 15+系统中:
bash
xattr -cr "/Applications/Open CoDesign.app"之后正常启动即可。在Windows系统中,当SmartScreen提示时,点击“更多信息”→“仍要运行”。
Configuration
配置
First Launch Setup
首次启动设置
Open CoDesign opens Settings automatically on first run. Choose one of three provider paths:
Open CoDesign首次运行时会自动打开设置界面。选择以下三种服务商配置方式之一:
1. ChatGPT Subscription (No API Key)
1. ChatGPT订阅(无需API密钥)
For ChatGPT Plus/Pro/Team subscribers using Codex models:
- Click "Sign in with ChatGPT"
- Authenticate via browser
- Select Codex models from the dropdown
适用于使用Codex模型的ChatGPT Plus/Pro/Team订阅用户:
- 点击**“使用ChatGPT登录”**
- 通过浏览器完成身份验证
- 从下拉菜单中选择Codex模型
2. API Key Provider
2. API密钥服务商
Set up any supported provider with an API key:
typescript
// Supported providers in TypeScript config format
interface ProviderConfig {
type: 'anthropic' | 'openai' | 'google' | 'openrouter' |
'deepseek' | 'kimi' | 'glm' | 'siliconflow' |
'openai-compatible';
apiKey: string;
baseURL?: string; // For OpenAI-compatible endpoints
model?: string;
}Environment variable pattern:
bash
undefined使用API密钥设置任何支持的服务商:
typescript
// TypeScript配置格式下的支持服务商
interface ProviderConfig {
type: 'anthropic' | 'openai' | 'google' | 'openrouter' |
'deepseek' | 'kimi' | 'glm' | 'siliconflow' |
'openai-compatible';
apiKey: string;
baseURL?: string; // 用于兼容OpenAI的端点
model?: string;
}环境变量配置方式:
bash
undefinedAnthropic
Anthropic
export ANTHROPIC_API_KEY=sk-ant-...
export ANTHROPIC_API_KEY=sk-ant-...
OpenAI
OpenAI
export OPENAI_API_KEY=sk-...
export OPENAI_API_KEY=sk-...
Google Gemini
Google Gemini
export GOOGLE_API_KEY=...
export GOOGLE_API_KEY=...
OpenRouter
OpenRouter
export OPENROUTER_API_KEY=...
export OPENROUTER_API_KEY=...
DeepSeek
DeepSeek
export DEEPSEEK_API_KEY=...
**In-app configuration:**
1. Open Settings (gear icon or `Cmd+,` / `Ctrl+,`)
2. Navigate to **Providers** tab
3. Click **Add Provider**
4. Select provider type
5. Paste API key from environment variable
6. (Optional) Set base URL for custom endpoints
7. Click **Save**export DEEPSEEK_API_KEY=...
**应用内配置:**
1. 打开设置界面(齿轮图标或使用快捷键`Cmd+,` / `Ctrl+,`)
2. 导航至**服务商**标签页
3. 点击**添加服务商**
4. 选择服务商类型
5. 粘贴环境变量中的API密钥
6. (可选)为自定义端点设置基础URL
7. 点击**保存**3. Local/Keyless (Ollama)
3. 本地/无密钥(Ollama)
For local models without API keys:
bash
undefined适用于无需API密钥的本地模型:
bash
undefinedInstall Ollama
安装Ollama
curl -fsSL https://ollama.com/install.sh | sh
curl -fsSL https://ollama.com/install.sh | sh
Pull a model (e.g., llama3.1)
拉取模型(例如llama3.1)
ollama pull llama3.1
ollama pull llama3.1
Ollama runs on http://localhost:11434 by default
Ollama默认运行在http://localhost:11434
In Open CoDesign:
1. Settings → Providers → Add Provider
2. Select **OpenAI-compatible**
3. Base URL: `http://localhost:11434/v1`
4. Leave API key empty
5. Model name: `llama3.1` (or your pulled model)
在Open CoDesign中配置:
1. 设置→服务商→添加服务商
2. 选择**兼容OpenAI**类型
3. 基础URL:`http://localhost:11434/v1`
4. 留空API密钥
5. 模型名称:`llama3.1`(或你拉取的其他模型)One-Click Import
一键导入
Import existing configurations:
- Claude Code config: Settings → Import → Browse to
~/.claude/config.json - Codex API config: Settings → Import → CLIProxyAPI auto-detect
导入现有配置:
- Claude Code配置: 设置→导入→浏览至
~/.claude/config.json - Codex API配置: 设置→导入→CLIProxyAPI自动检测
Core Workflows
核心工作流程
Generate a Design from Scratch
从零生成设计
Basic prompt pattern:
typescript
// The agent interprets natural language prompts
const prompt = `
Create a landing page for a SaaS product called "TaskFlow"
with a hero section, feature cards, pricing table, and footer.
Use a blue and white color scheme.
`;In the app:
- Open Open CoDesign
- Click New Design (or /
Cmd+N)Ctrl+N - Enter prompt in left panel
- Select model from dropdown (e.g., )
claude-3-5-sonnet-20241022 - Click Generate or press
Enter - Watch agent panel for live progress (todos, tool calls)
Expected output: Full HTML artifact with CSS, interactive elements, hover states
基础提示词格式:
typescript
// 智能体可理解自然语言提示词
const prompt = `
为名为"TaskFlow"的SaaS产品创建一个着陆页
包含英雄区、功能卡片、定价表格和页脚。
采用蓝白配色方案。
`;应用内操作:
- 打开Open CoDesign
- 点击新建设计(或使用快捷键/
Cmd+N)Ctrl+N - 在左侧面板输入提示词
- 从下拉菜单选择模型(例如)
claude-3-5-sonnet-20241022 - 点击生成或按键
Enter - 在智能体面板查看实时进度(待办事项、工具调用)
预期输出: 包含CSS、交互元素、悬停状态的完整HTML产物
Iterate with Comment Mode
使用批注模式迭代
Target specific regions without rewriting entire prompt:
typescript
// Comment mode workflow
1. Click "Comment" button in toolbar (or `C` key)
2. Click element in preview pane
3. Drop pin with feedback: "Make this heading larger and bold"
4. Agent rewrites only that regionUse cases:
- Adjust typography: "Increase line height in this paragraph"
- Refine colors: "Make this button background darker"
- Add elements: "Insert a contact form below this section"
无需重写整个提示词即可针对特定区域调整:
typescript
// 批注模式工作流程
1. 点击工具栏中的"批注"按钮(或按`C`键)
2. 点击预览面板中的元素
3. 添加带反馈的标记:"将此标题放大并加粗"
4. 智能体仅重写该区域适用场景:
- 调整排版:"增加此段落的行高"
- 优化颜色:"将此按钮背景调深"
- 添加元素:"在此区域下方插入联系表单"
Use AI-Generated Tweaks
使用AI生成的参数调节面板
The model emits a tweaks panel with adjustable parameters:
typescript
// Example tweaks JSON structure (auto-generated)
{
"primaryColor": { type: "color", value: "#3B82F6" },
"headingSize": { type: "range", value: 32, min: 16, max: 64 },
"spacing": { type: "range", value: 16, min: 8, max: 48 }
}In the app:
- Generate a design
- Open Tweaks panel (right sidebar)
- Adjust sliders, color pickers, or dropdowns
- Preview updates live
- Click Apply to commit changes
模型会生成带有可调参数的调节面板:
typescript
// 示例调节面板JSON结构(自动生成)
{
"primaryColor": { type: "color", value: "#3B82F6" },
"headingSize": { type: "range", value: 32, min: 16, max: 64 },
"spacing": { type: "range", value: 16, min: 8, max: 48 }
}应用内操作:
- 生成设计
- 打开调节面板(右侧边栏)
- 调整滑块、颜色选择器或下拉菜单
- 实时预览更新效果
- 点击应用提交更改
Export Artifacts
导出产物
Export formats:
- HTML: Single-file with embedded CSS/JS
- PDF: Print-ready document
- PPTX: PowerPoint presentation
- ZIP: Multi-file project archive
- Markdown: Source code with annotations
typescript
// Programmatic export pattern (desktop app API)
// Available in Electron main process
import { exportArtifact } from './export';
await exportArtifact({
sessionId: 'abc123',
format: 'html', // 'pdf' | 'pptx' | 'zip' | 'markdown'
outputPath: './exports/my-design.html'
});In the app:
- Open a completed design
- Click Export button (top-right)
- Select format
- Choose save location
- Optionally include version history
导出格式:
- HTML: 嵌入CSS/JS的单文件
- PDF: 可打印文档
- PPTX: PowerPoint演示文稿
- ZIP: 多文件项目归档
- Markdown: 带注释的源代码
typescript
// 程序化导出格式(桌面应用API)
// 适用于Electron主进程
import { exportArtifact } from './export';
await exportArtifact({
sessionId: 'abc123',
format: 'html', // 'pdf' | 'pptx' | 'zip' | 'markdown'
outputPath: './exports/my-design.html'
});应用内操作:
- 打开已完成的设计
- 点击导出按钮(右上角)
- 选择格式
- 选择保存位置
- (可选)包含版本历史
Work with Design Systems
使用设计系统
Use files to enforce consistent styling:
DESIGN.mdmarkdown
<!-- DESIGN.md in your workspace -->使用文件确保样式一致性:
DESIGN.mdmarkdown
<!-- 工作区中的DESIGN.md文件 -->TaskFlow Design System
TaskFlow设计系统
Colors
颜色
- Primary: #3B82F6
- Secondary: #10B981
- Neutral: #6B7280
- 主色:#3B82F6
- 辅助色:#10B981
- 中性色:#6B7280
Typography
排版
- Heading: Inter, 32px, bold
- Body: Inter, 16px, regular
- 标题:Inter字体,32px,加粗
- 正文:Inter字体,16px,常规
Spacing
间距
- Base unit: 8px
- Section padding: 64px vertical
- 基础单位:8px
- 区块内边距:上下64px
Components
组件
- Button: 12px padding, 4px border-radius, primary background
**How to use:**
1. Create `DESIGN.md` in workspace directory (Settings → Workspace → Set Path)
2. In prompt, reference: "Follow the design system in DESIGN.md"
3. Agent reads file via permissioned local tools- 按钮:12px内边距,4px圆角,主色背景
**使用方法:**
1. 在工作区目录创建`DESIGN.md`(设置→工作区→设置路径)
2. 在提示词中引用:"遵循DESIGN.md中的设计系统"
3. 智能体通过授权的本地工具读取文件Version History
版本历史
All iterations are saved locally:
typescript
// Session directory structure
~/.open-codesign/sessions/
abc123/
design-v1.html
design-v2.html
design-v3.html
metadata.json
chat-history.jsonIn the app:
- Open Your Designs hub (/
Cmd+Shift+D)Ctrl+Shift+D - Select a design
- Click Versions in right sidebar
- Preview past iterations
- Restore or fork from any version
所有迭代都会本地保存:
typescript
// 会话目录结构
~/.open-codesign/sessions/
abc123/
design-v1.html
design-v2.html
design-v3.html
metadata.json
chat-history.json应用内操作:
- 打开你的设计中心(快捷键/
Cmd+Shift+D)Ctrl+Shift+D - 选择一个设计
- 点击右侧边栏的版本
- 预览过往迭代
- 恢复或基于任意版本创建分支
Multi-Model Configuration
多模型配置
Switch Models Mid-Session
会话中切换模型
typescript
// Model selection pattern
1. Start design with claude-3-5-sonnet-20241022
2. Click model dropdown in top bar
3. Switch to gpt-4o for next iteration
4. Conversation context carries overRecommended models by use case:
- Prototypes: (best design sense)
claude-3-5-sonnet-20241022 - Slides: (structured layouts)
gpt-4o - Code-heavy: (technical accuracy)
deepseek-chat - Local/offline: via Ollama (privacy)
llama3.1
typescript
// 模型选择流程
1. 使用claude-3-5-sonnet-20241022开始设计
2. 点击顶部栏的模型下拉菜单
3. 切换至gpt-4o进行下一次迭代
4. 对话上下文会保留按场景推荐模型:
- 原型设计: (最佳设计感知能力)
claude-3-5-sonnet-20241022 - 幻灯片: (结构化布局能力强)
gpt-4o - 代码密集型任务: (技术准确性高)
deepseek-chat - 本地/离线使用: 通过Ollama运行(隐私性好)
llama3.1
Configure Multiple Providers
配置多个服务商
typescript
// Example: Use Claude for design, GPT for copy, Ollama for experiments
// In Settings → Providers, add:
[
{
name: "Anthropic",
type: "anthropic",
apiKey: process.env.ANTHROPIC_API_KEY,
models: ["claude-3-5-sonnet-20241022"]
},
{
name: "OpenAI",
type: "openai",
apiKey: process.env.OPENAI_API_KEY,
models: ["gpt-4o", "gpt-4o-mini"]
},
{
name: "Ollama Local",
type: "openai-compatible",
baseURL: "http://localhost:11434/v1",
models: ["llama3.1", "codellama"]
}
]typescript
// 示例:使用Claude做设计,GPT写文案,Ollama做实验
// 在设置→服务商中添加:
[
{
name: "Anthropic",
type: "anthropic",
apiKey: process.env.ANTHROPIC_API_KEY,
models: ["claude-3-5-sonnet-20241022"]
},
{
name: "OpenAI",
type: "openai",
apiKey: process.env.OPENAI_API_KEY,
models: ["gpt-4o", "gpt-4o-mini"]
},
{
name: "Ollama Local",
type: "openai-compatible",
baseURL: "http://localhost:11434/v1",
models: ["llama3.1", "codellama"]
}
]TypeScript Integration Patterns
TypeScript集成模式
Extend with Custom Tools
扩展自定义工具
Open CoDesign uses permissioned local tools in workspace mode:
typescript
// Example custom tool definition
// Place in workspace/.open-codesign/tools/
import { Tool } from '@open-codesign/types';
export const fetchDataTool: Tool = {
name: 'fetch_marketing_data',
description: 'Fetch product metrics from local JSON file',
parameters: {
type: 'object',
properties: {
filePath: { type: 'string' }
},
required: ['filePath']
},
handler: async ({ filePath }) => {
// Permission check happens in main process
const data = await fs.readFile(filePath, 'utf-8');
return JSON.parse(data);
}
};Open CoDesign在工作区模式下使用授权的本地工具:
typescript
// 示例自定义工具定义
// 放置在workspace/.open-codesign/tools/目录下
import { Tool } from '@open-codesign/types';
export const fetchDataTool: Tool = {
name: 'fetch_marketing_data',
description: '从本地JSON文件获取产品指标',
parameters: {
type: 'object',
properties: {
filePath: { type: 'string' }
},
required: ['filePath']
},
handler: async ({ filePath }) => {
// 权限检查在主进程中进行
const data = await fs.readFile(filePath, 'utf-8');
return JSON.parse(data);
}
};React Component Generation
React组件生成
Prompts targeting React components:
typescript
const reactPrompt = `
Create a reusable TaskCard component in React + TypeScript.
Props: title (string), description (string), status (enum: pending | done).
Use Tailwind CSS for styling.
`;
// Expected output structure
/*
interface TaskCardProps {
title: string;
description: string;
status: 'pending' | 'done';
}
export const TaskCard: React.FC<TaskCardProps> = ({
title,
description,
status
}) => {
return (
<div className="p-4 bg-white rounded-lg shadow">
<h3 className="text-lg font-bold">{title}</h3>
<p className="text-gray-600">{description}</p>
<span className={status === 'done' ? 'text-green-500' : 'text-yellow-500'}>
{status}
</span>
</div>
);
};
*/针对React组件的提示词:
typescript
const reactPrompt = `
用React + TypeScript创建一个可复用的TaskCard组件。
属性:title(字符串)、description(字符串)、status(枚举:pending | done)。
使用Tailwind CSS进行样式设计。
`;
// 预期输出结构
/*
interface TaskCardProps {
title: string;
description: string;
status: 'pending' | 'done';
}
export const TaskCard: React.FC<TaskCardProps> = ({
title,
description,
status
}) => {
return (
<div className="p-4 bg-white rounded-lg shadow">
<h3 className="text-lg font-bold">{title}</h3>
<p className="text-gray-600">{description}</p>
<span className={status === 'done' ? 'text-green-500' : 'text-yellow-500'}>
{status}
</span>
</div>
);
};
*/Common Patterns
常见模式
Prompt Engineering for Designs
设计提示词工程
Effective prompt structure:
typescript
const goodPrompt = `
[Type]: Landing page
[Purpose]: SaaS product launch
[Sections]: Hero with CTA, 3 feature cards, pricing table, footer
[Style]: Modern, minimal, blue/white palette
[Technical]: Responsive, mobile-first, use CSS Grid
[Extras]: Include hover effects on cards
`;
// ❌ Avoid vague prompts:
const badPrompt = "Make a nice website";Iteration tips:
- Start broad, refine with comments
- Reference existing designs: "Like Stripe's homepage but for education"
- Specify frameworks: "Use Tailwind utilities, avoid custom CSS"
有效的提示词结构:
typescript
const goodPrompt = `
[类型]: 着陆页
[用途]: SaaS产品发布
[区块]: 带CTA的英雄区、3个功能卡片、定价表格、页脚
[风格]: 现代、极简、蓝白配色
[技术要求]: 响应式、移动端优先、使用CSS Grid
[额外要求]: 卡片添加悬停效果
`;
// ❌ 避免模糊的提示词:
const badPrompt = "做一个好看的网站";迭代技巧:
- 先宽泛描述,再用批注细化
- 参考现有设计:"类似Stripe的主页,但面向教育领域"
- 指定框架:"使用Tailwind工具类,避免自定义CSS"
Slide Deck Generation
幻灯片生成
typescript
const slideDeckPrompt = `
Create a 5-slide pitch deck for TaskFlow:
1. Title slide with logo placeholder
2. Problem statement with bullet points
3. Solution overview with 3 features
4. Market opportunity (include a bar chart placeholder)
5. Call to action with contact info
Use a professional blue gradient background.
Export as PPTX.
`;typescript
const slideDeckPrompt = `
为TaskFlow创建一个5页的演示文稿:
1. 带Logo占位符的标题页
2. 带项目符号的问题陈述页
3. 包含3个功能的解决方案概述页
4. 市场机会页(包含柱状图占位符)
5. 带联系信息的行动号召页
使用专业的蓝色渐变背景。
导出为PPTX格式。
`;PDF Report Generation
PDF报告生成
typescript
const pdfPrompt = `
Generate a quarterly business review report:
- Cover page with Q1 2026 title
- Executive summary (1 page)
- Key metrics table (revenue, users, churn)
- 3 charts: line graph (revenue), pie chart (user segments), bar chart (MRR)
- Conclusion with 3 action items
Use corporate colors: #1E40AF (blue), #064E3B (green).
Export as PDF with page numbers.
`;typescript
const pdfPrompt = `
生成一份季度业务回顾报告:
- 带2026年Q1标题的封面页
- 执行摘要(1页)
- 关键指标表格(收入、用户数、流失率)
- 3个图表:折线图(收入)、饼图(用户细分)、柱状图(MRR)
- 包含3个行动项的结论页
使用企业配色:#1E40AF(蓝色)、#064E3B(绿色)。
导出为带页码的PDF。
`;Local-First Workflow
本地优先工作流程
typescript
// Set workspace to enable file-backed sessions
// Settings → Workspace → Set Path: ~/projects/my-designs
// Now designs auto-save to:
~/projects/my-designs/.open-codesign/
sessions/
cache/
exports/
// Commit to git:
cd ~/projects/my-designs
git add .open-codesign/sessions/
git commit -m "Save design iterations"typescript
// 设置工作区以启用文件存储的会话
// 设置→工作区→设置路径:~/projects/my-designs
// 现在设计会自动保存至:
~/projects/my-designs/.open-codesign/
sessions/
cache/
exports/
// 提交至git:
cd ~/projects/my-designs
git add .open-codesign/sessions/
git commit -m "保存设计迭代"Troubleshooting
故障排除
Provider Connection Issues
服务商连接问题
Symptom: "Failed to connect to provider" error
Solutions:
typescript
// 1. Verify API key format
// Anthropic: sk-ant-api03-...
// OpenAI: sk-proj-... or sk-...
// Check for trailing spaces/newlines
// 2. Test connectivity
curl https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model":"claude-3-5-sonnet-20241022","max_tokens":10,"messages":[{"role":"user","content":"Hi"}]}'
// 3. Check firewall/proxy settings
// Open CoDesign respects HTTP_PROXY and HTTPS_PROXY env vars
// 4. Enable diagnostics
// Settings → Advanced → Enable Provider Diagnostics
// Check logs in Help → Open Logs Folder症状: "无法连接到服务商"错误
解决方案:
typescript
// 1. 验证API密钥格式
// Anthropic: sk-ant-api03-...
// OpenAI: sk-proj-... 或 sk-...
// 检查是否有 trailing空格或换行符
// 2. 测试连通性
curl https://api.anthropic.com/v1/messages \
-H "x-api-key: $ANTHROPIC_API_KEY" \
-H "anthropic-version: 2023-06-01" \
-H "content-type: application/json" \
-d '{"model":"claude-3-5-sonnet-20241022","max_tokens":10,"messages":[{"role":"user","content":"Hi"}]}'
// 3. 检查防火墙/代理设置
// Open CoDesign会遵循HTTP_PROXY和HTTPS_PROXY环境变量
// 4. 启用诊断功能
// 设置→高级→启用服务商诊断
// 在帮助→打开日志文件夹中查看日志Gemini Model Not Found
Gemini模型未找到
Symptom: Error with models
gemini-*Fix: Prefix with :
models/typescript
// ❌ Incorrect
model: "gemini-1.5-pro"
// ✅ Correct
model: "models/gemini-1.5-pro"症状: 使用模型时出错
gemini-*修复方法: 前缀添加:
models/typescript
// ❌ 错误写法
model: "gemini-1.5-pro"
// ✅ 正确写法
model: "models/gemini-1.5-pro"OpenAI-Compatible Relay Issues
兼容OpenAI的中继问题
Symptom: "Instructions required" error with third-party relays
Cause: Some relays incorrectly enforce system messages
Workaround:
typescript
// Settings → Providers → [Your Relay] → Advanced
{
"forceSystemMessage": true,
"defaultInstructions": "You are a helpful assistant."
}症状: 使用第三方中继时出现"需要指令"错误
原因: 部分中继错误地强制要求系统消息
解决方法:
typescript
// 设置→服务商→[你的中继]→高级
{
"forceSystemMessage": true,
"defaultInstructions": "You are a helpful assistant."
}macOS Sequoia Gatekeeper Block
macOS Sequoia Gatekeeper拦截
Symptom: Cannot open app, "Open Anyway" fails
bash
undefined症状: 无法打开应用,"仍要打开"选项无效
bash
undefinedRemove quarantine attribute
移除隔离属性
xattr -cr "/Applications/Open CoDesign.app"
xattr -cr "/Applications/Open CoDesign.app"
Verify removal
验证移除结果
xattr -l "/Applications/Open CoDesign.app"
xattr -l "/Applications/Open CoDesign.app"
Should show no com.apple.quarantine
应无com.apple.quarantine属性
undefinedundefinedElectron IPC Errors
Electron IPC错误
Symptom: "IPC handler not found" in console
Solution:
bash
undefined症状: 控制台中出现"IPC handler not found"错误
解决方案:
bash
undefinedClear cache and restart
清除缓存并重启
macOS/Linux:
macOS/Linux:
rm -rf ~/.open-codesign/cache
rm -rf ~/.open-codesign/cache
Windows:
Windows:
rmdir /s %APPDATA%\open-codesign\cache
rmdir /s %APPDATA%\open-codesign\cache
Restart app
重启应用
undefinedundefinedExport Failures
导出失败
Symptom: PDF/PPTX export hangs or produces empty file
Debug steps:
typescript
// 1. Check disk space (exports need temp space)
df -h # macOS/Linux
wmic logicaldisk get size,freespace,caption # Windows
// 2. Verify Chromium renderer (for PDF)
// Help → Open DevTools → Console
// Look for Chromium print errors
// 3. Try HTML export first (always works)
// Then convert HTML → PDF externally if needed
// 4. Check export logs
// macOS: ~/Library/Logs/open-codesign/export.log
// Windows: %APPDATA%\open-codesign\logs\export.log
// Linux: ~/.config/open-codesign/logs/export.log症状: PDF/PPTX导出卡住或生成空文件
调试步骤:
typescript
// 1. 检查磁盘空间(导出需要临时空间)
df -h # macOS/Linux
wmic logicaldisk get size,freespace,caption # Windows
// 2. 验证Chromium渲染器(用于PDF导出)
// 帮助→打开开发者工具→控制台
// 查找Chromium打印错误
// 3. 先尝试HTML导出(总能正常工作)
// 如有需要,再将HTML转换为PDF
// 4. 查看导出日志
// macOS: ~/Library/Logs/open-codesign/export.log
// Windows: %APPDATA%\open-codesign\logs\export.log
// Linux: ~/.config/open-codesign/logs/export.logChatGPT Subscription Sign-In Fails
ChatGPT订阅登录失败
Symptom: OAuth redirect loop or "Session expired"
Fix:
typescript
// 1. Clear OAuth cache
// Settings → Advanced → Clear OAuth Cache
// 2. Ensure browser cookies for chat.openai.com are enabled
// 3. Try incognito/private window for OAuth flow
// 4. Verify subscription is active at https://chat.openai.com症状: OAuth重定向循环或"会话已过期"
修复方法:
typescript
// 1. 清除OAuth缓存
// 设置→高级→清除OAuth缓存
// 2. 确保chat.openai.com的浏览器Cookie已启用
// 3. 尝试使用隐身/隐私窗口进行OAuth流程
// 4. 在https://chat.openai.com验证订阅是否有效Advanced Configuration
高级配置
Custom Model Definitions
自定义模型定义
Add unsupported models via config file:
typescript
// ~/.open-codesign/config.json
{
"customModels": [
{
"id": "my-custom-model",
"provider": "openai-compatible",
"baseURL": "https://my-llm-api.com/v1",
"apiKey": "ENV:MY_LLM_KEY",
"contextWindow": 128000,
"maxOutput": 4096
}
]
}通过配置文件添加不支持的模型:
typescript
// ~/.open-codesign/config.json
{
"customModels": [
{
"id": "my-custom-model",
"provider": "openai-compatible",
"baseURL": "https://my-llm-api.com/v1",
"apiKey": "ENV:MY_LLM_KEY",
"contextWindow": 128000,
"maxOutput": 4096
}
]
}Workspace Permissions
工作区权限
Control what the agent can access:
typescript
// workspace/.open-codesign/permissions.json
{
"allowedPaths": [
"./design-system",
"./assets",
"./data"
],
"deniedPaths": [
"./secrets",
"./.env"
],
"allowNetworkAccess": false,
"allowedTools": [
"read_file",
"search_files",
"list_directory"
]
}控制智能体可访问的资源:
typescript
// workspace/.open-codesign/permissions.json
{
"allowedPaths": [
"./design-system",
"./assets",
"./data"
],
"deniedPaths": [
"./secrets",
"./.env"
],
"allowNetworkAccess": false,
"allowedTools": [
"read_file",
"search_files",
"list_directory"
]
}Keyboard Shortcuts
快捷键
- New Design: /
Cmd+NCtrl+N - Save: /
Cmd+S(auto-saves enabled by default)Ctrl+S - Export: /
Cmd+ECtrl+E - Comment Mode:
C - Tweaks Panel:
T - Your Designs Hub: /
Cmd+Shift+DCtrl+Shift+D - Settings: /
Cmd+,Ctrl+, - DevTools: /
Cmd+Opt+ICtrl+Shift+I
- 新建设计: /
Cmd+NCtrl+N - 保存: /
Cmd+S(默认启用自动保存)Ctrl+S - 导出: /
Cmd+ECtrl+E - 批注模式:
C - 调节面板:
T - 你的设计中心: /
Cmd+Shift+DCtrl+Shift+D - 设置: /
Cmd+,Ctrl+, - 开发者工具: /
Cmd+Opt+ICtrl+Shift+I
Security Best Practices
安全最佳实践
-
Never commit API keys: Use environment variablesbash
# .env (add to .gitignore) ANTHROPIC_API_KEY=sk-ant-... OPENAI_API_KEY=sk-... -
Verify downloads: Checkfrom releases
SHA256SUMS.txtbashshasum -a 256 -c SHA256SUMS.txt -
Workspace isolation: Keep sensitive files outside workspace paths
-
Review tool calls: Agent panel shows every file access
-
Update regularly: Security patches ship with minor versions
-
切勿提交API密钥: 使用环境变量bash
# .env(添加到.gitignore) ANTHROPIC_API_KEY=sk-ant-... OPENAI_API_KEY=sk-... -
验证下载文件: 检查发布版本中的
SHA256SUMS.txtbashshasum -a 256 -c SHA256SUMS.txt -
工作区隔离: 将敏感文件放在工作区路径之外
-
审核工具调用: 智能体面板会显示所有文件访问操作
-
定期更新: 安全补丁随小版本发布
Resources
资源
- Documentation: https://opencoworkai.github.io/open-codesign/
- GitHub: https://github.com/OpenCoworkAI/open-codesign
- Releases: https://github.com/OpenCoworkAI/open-codesign/releases
- Discussions: https://github.com/OpenCoworkAI/open-codesign/discussions
- Issues: https://github.com/OpenCoworkAI/open-codesign/issues
- Contributing: https://github.com/OpenCoworkAI/open-codesign/blob/main/CONTRIBUTING.md
- Security: https://github.com/OpenCoworkAI/open-codesign/blob/main/SECURITY.md
- 文档: https://opencoworkai.github.io/open-codesign/
- GitHub: https://github.com/OpenCoworkAI/open-codesign
- 发布版本: https://github.com/OpenCoworkAI/open-codesign/releases
- 讨论区: https://github.com/OpenCoworkAI/open-codesign/discussions
- 问题反馈: https://github.com/OpenCoworkAI/open-codesign/issues
- 贡献指南: https://github.com/OpenCoworkAI/open-codesign/blob/main/CONTRIBUTING.md
- 安全信息: https://github.com/OpenCoworkAI/open-codesign/blob/main/SECURITY.md