5.11 企业版
💡 一句话总结:了解企业版功能,获取团队协作和管理能力。
学完你能做什么
- 了解企业版功能
- 能配置团队协作
- 能使用管理功能
- 能部署私有版本
🎒 开始前的准备
确保你已经完成以下事项:
- [ ] 了解 OpenCode 基本功能
- [ ] 有团队管理需求
功能对比
| 功能 | 免费版 | 企业版 |
|---|---|---|
| 用户数 | 1 | 无限 |
| API 调用 | 有限 | 无限 |
| 自定义模型 | ❌ | ✅ |
| SSO 登录 | ❌ | ✅ |
| 审计日志 | 7天 | 1年 |
| 专属支持 | ❌ | ✅ |
| 私有部署 | ❌ | ✅ |
团队功能
团队管理
yaml
enterprise:
team:
name: "我的团队"
members:
- email: "admin@company.com"
role: "admin"
- email: "dev@company.com"
role: "developer"
roles:
admin:
- "*"
developer:
- "chat:*"
- "files:read"
- "files:write:src/**"共享配置
yaml
enterprise:
shared:
agents:
- name: "公司标准助手"
config: |
role: |
你是一个专业的开发者...
prompts:
- name: "代码审查"
template: |
请审查以下代码...
shortcuts:
- name: "构建"
command: "npm run build"管理功能
使用情况监控
yaml
enterprise:
monitoring:
enabled: true
metrics:
- api_calls
- active_users
- token_usage
- session_duration
dashboards:
- name: "使用概览"
refresh: 60审计日志
yaml
enterprise:
audit:
enabled: true
retention: 365
log_events:
- login
- logout
- api_call
- file_access
- permission_change
export:
format: "jsonl"
schedule: "daily"私有部署
Docker Compose
yaml
version: "3.8"
services:
opencode:
image: opencode/enterprise:latest
ports:
- "8080:8080"
volumes:
- data:/data
- logs:/var/log/opencode
environment:
- LICENSE_KEY=${LICENSE_KEY}
- DATABASE_URL=postgresql://user:pass@db/opencode
- REDIS_URL=redis://redis:6379
db:
image: postgres:15
volumes:
- postgres-data:/var/lib/postgresql/data
redis:
image: redis:7配置示例
yaml
enterprise:
license: "${LICENSE_KEY}"
database:
type: "postgresql"
url: "${DATABASE_URL}"
cache:
type: "redis"
url: "${REDIS_URL}"
auth:
sso:
enabled: true
provider: "saml"
config: |
<SAML配置>
monitoring:
enabled: true
prometheus:
enabled: true
port: 9090检查点 ✅
全部通过才能继续
- [ ] 了解功能对比
- [ ] 能配置团队
- [ ] 能使用监控
- [ ] 能部署私有版
本课小结
你学会了:
- 功能对比
- 团队配置
- 管理功能
- 私有部署
下一课预告
下一课我们将学习插件开发基础。
📚 更多完整模板:Prompt 模板库

