createos
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCreateOS Platform Skills
CreateOS平台技能
Ship anything to production — AI agents, APIs, backends, bots, MCP servers, frontends, webhooks, workers, and more.
将任意内容发布到生产环境 — AI Agent、API、后端服务、机器人、MCP服务器、前端应用、Webhook、工作进程等。
⚠️ IMPORTANT: Authentication
⚠️ 重要提示:身份验证
For AI Agents (MCP) - USE THIS
针对AI Agent(MCP)- 使用此方式
When connected via MCP (OpenClaw, MoltBot, ClawdBot, Claude), NO API KEY NEEDED.
The MCP server handles authentication automatically.
MCP Endpoint:
https://api-createos.nodeops.network/mcpJust call the tools directly:
CreateProject(...)
UploadDeploymentFiles(...)
ListProjects(...)当通过MCP(OpenClaw、MoltBot、ClawdBot、Claude)连接时,无需API密钥。
MCP服务器会自动处理身份验证。
MCP端点:
https://api-createos.nodeops.network/mcp直接调用工具即可:
CreateProject(...)
UploadDeploymentFiles(...)
ListProjects(...)For REST API (Scripts/External)
针对REST API(脚本/外部调用)
When calling REST endpoints directly (curl, Python requests, etc.):
X-Api-Key: <your-api-key>
Base URL: https://api-createos.nodeops.networkGet API key via MCP:
CreateAPIKey({name: "my-key", expiryAt: "2025-12-31T23:59:59Z"})当直接调用REST端点时(如curl、Python requests等):
X-Api-Key: <your-api-key>
Base URL: https://api-createos.nodeops.network通过MCP获取API密钥:
CreateAPIKey({name: "my-key", expiryAt: "2025-12-31T23:59:59Z"})🚀 Quick Start for MCP Agents
🚀 MCP Agent快速入门
Deploy Files Directly (Fastest)
直接部署文件(最快方式)
json
// 1. Create upload project
CreateProject({
"uniqueName": "my-app",
"displayName": "My App",
"type": "upload",
"source": {},
"settings": {
"runtime": "node:20",
"port": 3000
}
})
// 2. Upload files and deploy
UploadDeploymentFiles(project_id, {
"files": [
{"path": "package.json", "content": "{\"name\":\"app\",\"scripts\":{\"start\":\"node index.js\"}}"},
{"path": "index.js", "content": "require('http').createServer((req,res)=>{res.end('Hello!')}).listen(3000)"}
]
})
// Result: https://my-app.createos.io is live!json
// 1. 创建上传项目
CreateProject({
"uniqueName": "my-app",
"displayName": "My App",
"type": "upload",
"source": {},
"settings": {
"runtime": "node:20",
"port": 3000
}
})
// 2. 上传文件并部署
UploadDeploymentFiles(project_id, {
"files": [
{"path": "package.json", "content": "{\"name\":\"app\",\"scripts\":{\"start\":\"node index.js\"}}"},
{"path": "index.js", "content": "require('http').createServer((req,res)=>{res.end('Hello!')}).listen(3000)"}
]
})
// 结果:https://my-app.createos.io 已上线!Deploy from GitHub (Auto-deploy on push)
从GitHub部署(推送时自动部署)
json
// 1. Get GitHub installation ID
ListConnectedGithubAccounts()
// Returns: [{installationId: "12345", ...}]
// 2. Find repo ID
ListGithubRepositories("12345")
// Returns: [{id: "98765", fullName: "myorg/myrepo", ...}]
// 3. Create VCS project
CreateProject({
"uniqueName": "my-app",
"displayName": "My App",
"type": "vcs",
"source": {
"vcsName": "github",
"vcsInstallationId": "12345",
"vcsRepoId": "98765"
},
"settings": {
"runtime": "node:20",
"port": 3000,
"installCommand": "npm install",
"buildCommand": "npm run build",
"runCommand": "npm start"
}
})
// Auto-deploys on every git push!json
// 1. 获取GitHub安装ID
ListConnectedGithubAccounts()
// 返回:[{installationId: "12345", ...}]
// 2. 查找仓库ID
ListGithubRepositories("12345")
// 返回:[{id: "98765", fullName: "myorg/myrepo", ...}]
// 3. 创建VCS项目
CreateProject({
"uniqueName": "my-app",
"displayName": "My App",
"type": "vcs",
"source": {
"vcsName": "github",
"vcsInstallationId": "12345",
"vcsRepoId": "98765"
},
"settings": {
"runtime": "node:20",
"port": 3000,
"installCommand": "npm install",
"buildCommand": "npm run build",
"runCommand": "npm start"
}
})
// 每次git推送时自动部署!Deploy Docker Image
部署Docker镜像
json
// 1. Create image project
CreateProject({
"uniqueName": "my-service",
"displayName": "My Service",
"type": "image",
"source": {},
"settings": {
"port": 8080
}
})
// 2. Deploy image
CreateDeployment(project_id, {
"image": "nginx:latest"
})json
// 1. 创建镜像项目
CreateProject({
"uniqueName": "my-service",
"displayName": "My Service",
"type": "image",
"source": {},
"settings": {
"port": 8080
}
})
// 2. 部署镜像
CreateDeployment(project_id, {
"image": "nginx:latest"
})Table of Contents
目录
- Introduction
- Core Skills Overview
- Project Management Skills
- Deployment Skills
- Environment Management Skills
- Domain & Routing Skills
- GitHub Integration Skills
- Analytics & Monitoring Skills
- Security Skills
- Organization Skills (Apps)
- API Key Management Skills
- Common Deployment Patterns
- Best Practices
- Troubleshooting & Edge Cases
- API Quick Reference
Introduction
简介
What is CreateOS?
什么是CreateOS?
CreateOS is a cloud deployment platform designed for rapid shipping of any workload — from simple static sites to complex multi-agent AI systems. It provides:
- Three deployment methods: GitHub auto-deploy, Docker images, direct file upload
- Multi-environment support: Production, staging, development with isolated configs
- Built-in CI/CD: Automatic builds and deployments on git push
- Custom domains: SSL/TLS included, DNS verification
- Real-time analytics: Request metrics, error tracking, performance monitoring
- Security scanning: Vulnerability detection for deployments
CreateOS是一个云部署平台,专为快速发布任意工作负载而设计——从简单的静态站点到复杂的多Agent AI系统。它提供:
- 三种部署方式:GitHub自动部署、Docker镜像、直接文件上传
- 多环境支持:生产、预发布、开发环境,配置相互隔离
- 内置CI/CD:git推送时自动构建和部署
- 自定义域名:包含SSL/TLS,支持DNS验证
- 实时分析:请求指标、错误追踪、性能监控
- 安全扫描:部署漏洞检测
Target Users
目标用户
| User Type | Primary Use Cases |
|---|---|
| AI/ML Engineers | Deploy agents, MCP servers, RAG pipelines, LLM services |
| Backend Developers | Ship APIs, microservices, webhooks, workers |
| Frontend Developers | Deploy SPAs, SSR apps, static sites |
| DevOps Engineers | Manage environments, domains, scaling, monitoring |
| Bot Developers | Host Discord, Slack, Telegram bots |
| 用户类型 | 主要使用场景 |
|---|---|
| AI/ML工程师 | 部署Agent、MCP服务器、RAG流水线、LLM服务 |
| 后端开发者 | 发布API、微服务、Webhook、工作进程 |
| 前端开发者 | 部署SPA、SSR应用、静态站点 |
| DevOps工程师 | 管理环境、域名、扩容、监控 |
| 机器人开发者 | 托管Discord、Slack、Telegram机器人 |
Supported Technologies
支持的技术
Runtimes: , , , , , , , , , ,
node:18node:20node:22python:3.11python:3.12golang:1.22golang:1.25rust:1.75bun:1.1bun:1.3staticFrameworks: , , , , , , , , , , , , , ,
nextjsreactjs-spareactjs-ssrvuejs-spavuejs-ssrnuxtjsastroremixexpressfastapiflaskdjangoginfiberactix运行时:, , , , , , , , , ,
node:18node:20node:22python:3.11python:3.12golang:1.22golang:1.25rust:1.75bun:1.1bun:1.3static框架:, , , , , , , , , , , , , ,
nextjsreactjs-spareactjs-ssrvuejs-spavuejs-ssrnuxtjsastroremixexpressfastapiflaskdjangoginfiberactixCore Skills Overview
核心技能概述
🔌 MCP Tools Available (Direct Call - No Auth Needed)
🔌 可用的MCP工具(直接调用 - 无需身份验证)
When using CreateOS via MCP (OpenClaw, Claude, etc.), these tools are available directly:
Projects:
- - Create new project (vcs, image, or upload type)
CreateProject - - List all projects
ListProjects - - Get project details
GetProject - - Update project metadata
UpdateProject - - Update build/runtime settings
UpdateProjectSettings - - Delete project
DeleteProject
Deployments:
- - Deploy Docker image (image projects)
CreateDeployment - - Trigger build from GitHub (vcs projects)
TriggerLatestDeployment - - Upload files to deploy (upload projects)
UploadDeploymentFiles - - Upload binary files as base64
UploadDeploymentBase64Files - - Upload zip archive
UploadDeploymentZip - - List all deployments
ListDeployments - - Get deployment status
GetDeployment - - View build logs
GetBuildLogs - - View runtime logs
GetDeploymentLogs - - Retry failed deployment
RetriggerDeployment - - Cancel queued/building deployment
CancelDeployment - - Wake sleeping deployment
WakeupDeployment
Environments:
- - Create environment (production, staging, etc.)
CreateProjectEnvironment - - List environments
ListProjectEnvironments - - Update environment config
UpdateProjectEnvironment - - Set env vars
UpdateProjectEnvironmentEnvironmentVariables - - Scale CPU/memory/replicas
UpdateProjectEnvironmentResources - - Assign deployment to env
AssignDeploymentToProjectEnvironment - - Delete environment
DeleteProjectEnvironment
Domains:
- - Add custom domain
CreateDomain - - List domains
ListDomains - - Verify DNS
RefreshDomain - - Assign domain to environment
UpdateDomainEnvironment - - Remove domain
DeleteDomain
GitHub:
- - Get connected GitHub accounts
ListConnectedGithubAccounts - - List accessible repos
ListGithubRepositories - - List branches
ListGithubRepositoryBranches
Apps:
- - Create app to group projects
CreateApp - - List apps
ListApps - - Add projects to app
AddProjectsToApp
User:
- - Get user info
GetCurrentUser - - Check usage limits
GetQuotas - - List runtimes/frameworks
GetSupportedProjectTypes
当通过MCP(OpenClaw、Claude等)使用CreateOS时,可直接调用以下工具:
项目:
- - 创建新项目(vcs、image或upload类型)
CreateProject - - 列出所有项目
ListProjects - - 获取项目详情
GetProject - - 更新项目元数据
UpdateProject - - 更新构建/运行时设置
UpdateProjectSettings - - 删除项目
DeleteProject
部署:
- - 部署Docker镜像(image项目)
CreateDeployment - - 从GitHub触发构建(vcs项目)
TriggerLatestDeployment - - 上传文件进行部署(upload项目)
UploadDeploymentFiles - - 以base64格式上传二进制文件
UploadDeploymentBase64Files - - 上传ZIP归档文件
UploadDeploymentZip - - 列出所有部署
ListDeployments - - 获取部署状态
GetDeployment - - 查看构建日志
GetBuildLogs - - 查看运行时日志
GetDeploymentLogs - - 重试失败的部署
RetriggerDeployment - - 取消排队/构建中的部署
CancelDeployment - - 唤醒休眠的部署
WakeupDeployment
环境:
- - 创建环境(生产、预发布等)
CreateProjectEnvironment - - 列出环境
ListProjectEnvironments - - 更新环境配置
UpdateProjectEnvironment - - 设置环境变量
UpdateProjectEnvironmentEnvironmentVariables - - 调整CPU/内存/副本数
UpdateProjectEnvironmentResources - - 将部署分配到环境
AssignDeploymentToProjectEnvironment - - 删除环境
DeleteProjectEnvironment
域名:
- - 添加自定义域名
CreateDomain - - 列出域名
ListDomains - - 验证DNS
RefreshDomain - - 将域名分配到环境
UpdateDomainEnvironment - - 移除域名
DeleteDomain
GitHub:
- - 获取已连接的GitHub账户
ListConnectedGithubAccounts - - 列出可访问的仓库
ListGithubRepositories - - 列出分支
ListGithubRepositoryBranches
应用:
- - 创建应用以分组项目
CreateApp - - 列出应用
ListApps - - 将项目添加到应用
AddProjectsToApp
用户:
- - 获取用户信息
GetCurrentUser - - 查看使用限制
GetQuotas - - 列出支持的运行时和框架
GetSupportedProjectTypes
Functional Skills
功能技能
| Skill Category | Capabilities |
|---|---|
| Project Management | Create, configure, update, delete, transfer projects |
| Deployment | Build, deploy, rollback, wake, cancel deployments |
| Environment Management | Multi-env configs, env vars, resource scaling |
| Domain Management | Custom domains, SSL, DNS verification |
| GitHub Integration | Auto-deploy, branch management, repo access |
| Analytics | Request metrics, error rates, performance data |
| Security | Vulnerability scanning, API key management |
| Organization | Group projects into apps, manage services |
| 技能类别 | 能力 |
|---|---|
| 项目管理 | 创建、配置、更新、删除、转移项目 |
| 部署 | 构建、部署、回滚、唤醒、取消部署 |
| 环境管理 | 多环境配置、环境变量、资源扩容 |
| 域名管理 | 自定义域名、SSL、DNS验证 |
| GitHub集成 | 自动部署、分支管理、仓库访问 |
| 分析 | 请求指标、错误率、性能数据 |
| 安全 | 漏洞扫描、API密钥管理 |
| 组织 | 将项目分组为应用、管理服务 |
Technical Skills
技术技能
| Skill | Description |
|---|---|
| Authentication | API key-based auth with expiry management |
| Build AI | Automatic build configuration detection |
| Dockerfile Support | Custom container builds |
| Environment Isolation | Separate configs per environment |
| Resource Management | CPU, memory, replica scaling |
| 技能 | 描述 |
|---|---|
| 身份验证 | 基于API密钥的身份验证,支持过期管理 |
| 构建AI | 自动检测构建配置 |
| Dockerfile支持 | 自定义容器构建 |
| 环境隔离 | 每个环境的配置相互独立 |
| 资源管理 | CPU、内存、副本数调整 |
Project Management Skills
项目管理技能
Skill: Create Projects
技能:创建项目
Create new projects with full configuration for build and runtime settings.
创建新项目,配置完整的构建和运行时设置。
Project Types
项目类型
| Type | Description | Best For |
|---|---|---|
| GitHub-connected repository | Production apps with CI/CD |
| Docker container deployment | Pre-built images, complex deps |
| Direct file upload | Quick prototypes, static sites |
| 类型 | 描述 | 最佳适用场景 |
|---|---|---|
| 连接GitHub仓库 | 带CI/CD的生产应用 |
| Docker容器部署 | 预构建镜像、复杂依赖项 |
| 直接文件上传 | 快速原型、静态站点 |
VCS Project Creation
VCS项目创建
What it does: Links a GitHub repository for automatic deployments on push.
Why it's useful: Enables GitOps workflow — push to deploy with zero manual intervention.
How to implement:
json
CreateProject({
"uniqueName": "my-nextjs-app",
"displayName": "My Next.js Application",
"type": "vcs",
"source": {
"vcsName": "github",
"vcsInstallationId": "12345678",
"vcsRepoId": "98765432"
},
"settings": {
"framework": "nextjs",
"runtime": "node:20",
"port": 3000,
"directoryPath": ".",
"installCommand": "npm install",
"buildCommand": "npm run build",
"runCommand": "npm start",
"buildVars": {
"NODE_ENV": "production",
"NEXT_PUBLIC_API_URL": "https://api.example.com"
},
"runEnvs": {
"DATABASE_URL": "postgresql://...",
"SECRET_KEY": "..."
},
"ignoreBranches": ["develop", "feature/*"],
"hasDockerfile": false,
"useBuildAI": false
},
"appId": "optional-app-uuid",
"enabledSecurityScan": true
})Prerequisites:
- GitHub account connected via
InstallGithubApp - Repository access granted to CreateOS GitHub App
Potential pitfalls:
- Incorrect causes deployment failures
vcsRepoId - Missing setting results in health check failures
port - vs
buildVarsconfusion (build-time vs runtime)runEnvs
功能:链接GitHub仓库,推送时自动部署。
优势:启用GitOps工作流——推送代码即可部署,无需手动干预。
实现方式:
json
CreateProject({
"uniqueName": "my-nextjs-app",
"displayName": "My Next.js Application",
"type": "vcs",
"source": {
"vcsName": "github",
"vcsInstallationId": "12345678",
"vcsRepoId": "98765432"
},
"settings": {
"framework": "nextjs",
"runtime": "node:20",
"port": 3000,
"directoryPath": ".",
"installCommand": "npm install",
"buildCommand": "npm run build",
"runCommand": "npm start",
"buildVars": {
"NODE_ENV": "production",
"NEXT_PUBLIC_API_URL": "https://api.example.com"
},
"runEnvs": {
"DATABASE_URL": "postgresql://...",
"SECRET_KEY": "..."
},
"ignoreBranches": ["develop", "feature/*"],
"hasDockerfile": false,
"useBuildAI": false
},
"appId": "optional-app-uuid",
"enabledSecurityScan": true
})前提条件:
- 通过连接GitHub账户
InstallGithubApp - 授予CreateOS GitHub应用仓库访问权限
潜在陷阱:
- 错误会导致部署失败
vcsRepoId - 缺少设置会导致健康检查失败
port - 混淆和
buildVars(构建时 vs 运行时)runEnvs
Image Project Creation
镜像项目创建
What it does: Deploys pre-built Docker images without build step.
Why it's useful: Faster deployments, complex dependencies, existing CI pipelines.
json
CreateProject({
"uniqueName": "my-api-service",
"displayName": "My API Service",
"type": "image",
"source": {},
"settings": {
"port": 8080,
"runEnvs": {
"API_KEY": "secret",
"LOG_LEVEL": "info"
}
}
})Implications:
- No build logs (image already built)
- Must manage image registry separately
- Version control via image tags
功能:部署预构建的Docker镜像,无需构建步骤。
优势:部署速度更快,支持复杂依赖项,适配现有CI流水线。
json
CreateProject({
"uniqueName": "my-api-service",
"displayName": "My API Service",
"type": "image",
"source": {},
"settings": {
"port": 8080,
"runEnvs": {
"API_KEY": "secret",
"LOG_LEVEL": "info"
}
}
})注意事项:
- 无构建日志(镜像已提前构建)
- 需单独管理镜像仓库
- 通过镜像标签进行版本控制
Upload Project Creation
上传项目创建
What it does: Deploy by uploading files directly — no Git required.
Why it's useful: Quick prototypes, migrations, CI-generated artifacts.
json
CreateProject({
"uniqueName": "quick-prototype",
"displayName": "Quick Prototype",
"type": "upload",
"source": {},
"settings": {
"framework": "express",
"runtime": "node:20",
"port": 3000,
"installCommand": "npm install",
"buildCommand": "npm run build",
"buildDir": "dist",
"useBuildAI": true
}
})功能:直接上传文件部署——无需Git。
优势:快速原型开发、迁移、CI生成的产物部署。
json
CreateProject({
"uniqueName": "quick-prototype",
"displayName": "Quick Prototype",
"type": "upload",
"source": {},
"settings": {
"framework": "express",
"runtime": "node:20",
"port": 3000,
"installCommand": "npm install",
"buildCommand": "npm run build",
"buildDir": "dist",
"useBuildAI": true
}
})Skill: Update Project Settings
技能:更新项目设置
Modify build and runtime configuration without recreating projects.
json
UpdateProjectSettings(project_id, {
"framework": "nextjs",
"runtime": "node:22",
"port": 3000,
"installCommand": "npm ci",
"buildCommand": "npm run build",
"runCommand": "npm start",
"buildDir": ".next",
"buildVars": {"NODE_ENV": "production"},
"runEnvs": {"NEW_VAR": "value"},
"ignoreBranches": ["wip/*"],
"hasDockerfile": false,
"useBuildAI": false
})Edge cases:
- Changing triggers rebuild on next deployment
runtime - Changing requires redeployment to take effect
port - only affects future pushes
ignoreBranches
无需重新创建项目,即可修改构建和运行时配置。
json
UpdateProjectSettings(project_id, {
"framework": "nextjs",
"runtime": "node:22",
"port": 3000,
"installCommand": "npm ci",
"buildCommand": "npm run build",
"runCommand": "npm start",
"buildDir": ".next",
"buildVars": {"NODE_ENV": "production"},
"runEnvs": {"NEW_VAR": "value"},
"ignoreBranches": ["wip/*"],
"hasDockerfile": false,
"useBuildAI": false
})边缘情况:
- 更改会触发下一次部署时的重建
runtime - 更改需要重新部署才会生效
port - 仅影响未来的推送
ignoreBranches
Skill: Project Lifecycle Management
技能:项目生命周期管理
| Operation | Tool | Use Case |
|---|---|---|
| List projects | | Dashboard, search |
| Get details | | View full config |
| Update metadata | | Rename, toggle features |
| Delete | | Cleanup (async deletion) |
| Check name | | Validation before create |
| 操作 | 工具 | 使用场景 |
|---|---|---|
| 列出项目 | | 仪表板、搜索 |
| 获取详情 | | 查看完整配置 |
| 更新元数据 | | 重命名、切换功能 |
| 删除 | | 清理(异步删除) |
| 检查名称 | | 创建前验证 |
Skill: Project Transfer
技能:项目转移
Transfer project ownership between users.
1. Owner: GetProjectTransferUri(project_id) → returns {uri, token} (valid 6 hours)
2. Owner: Share URI with recipient
3. Recipient: TransferProject(project_id, token)
4. Audit: ListProjectTransferHistory(project_id)Security implications:
- Token expires after 6 hours
- Transfer is irreversible
- All environments and deployments transfer
在用户之间转移项目所有权。
1. 所有者:调用`GetProjectTransferUri(project_id)` → 返回{uri, token}(有效期6小时)
2. 所有者:将URI分享给接收方
3. 接收方:调用`TransferProject(project_id, token)`
4. 审计:调用`ListProjectTransferHistory(project_id)`安全注意事项:
- Token 6小时后过期
- 转移不可撤销
- 所有环境和部署都会被转移
Deployment Skills
部署技能
Skill: Trigger Deployments
技能:触发部署
For VCS Projects
针对VCS项目
Automatic (recommended): Push to GitHub triggers deployment automatically.
Manual trigger:
json
TriggerLatestDeployment(project_id, branch?)
// branch defaults to repo's default branch自动触发(推荐):推送到GitHub时自动触发部署。
手动触发:
json
TriggerLatestDeployment(project_id, branch?)
// branch默认使用仓库的默认分支For Image Projects
针对镜像项目
json
CreateDeployment(project_id, {
"image": "nginx:latest"
})
// Supports any valid Docker image reference:
// - nginx:latest
// - myregistry.com/myapp:v1.2.3
// - ghcr.io/org/repo:sha-abc123json
CreateDeployment(project_id, {
"image": "nginx:latest"
})
// 支持任何有效的Docker镜像引用:
// - nginx:latest
// - myregistry.com/myapp:v1.2.3
// - ghcr.io/org/repo:sha-abc123For Upload Projects
针对上传项目
Direct files:
json
UploadDeploymentFiles(project_id, {
"files": [
{"path": "package.json", "content": "{\"name\":\"app\",...}"},
{"path": "index.js", "content": "const express = require('express')..."},
{"path": "public/style.css", "content": "body { margin: 0; }"}
]
})Base64 files (for binary content):
json
UploadDeploymentBase64Files(project_id, {
"files": [
{"path": "assets/logo.png", "content": "iVBORw0KGgo..."}
]
})ZIP upload:
json
UploadDeploymentZip(project_id, {file: zipBinaryData})Limitations:
- Max 100 files per upload
- Use ZIP for larger projects
直接上传文件:
json
UploadDeploymentFiles(project_id, {
"files": [
{"path": "package.json", "content": "{\"name\":\"app\",...}"},
{"path": "index.js", "content": "const express = require('express')..."},
{"path": "public/style.css", "content": "body { margin: 0; }"}
]
})Base64文件上传(适用于二进制内容):
json
UploadDeploymentBase64Files(project_id, {
"files": [
{"path": "assets/logo.png", "content": "iVBORw0KGgo..."}
]
})ZIP上传:
json
UploadDeploymentZip(project_id, {file: zipBinaryData})限制:
- 每次上传最多100个文件
- 大型项目请使用ZIP上传
Skill: Deployment Lifecycle
技能:部署生命周期
┌─────────┐ ┌──────────┐ ┌───────────┐ ┌──────────┐
│ queued │ → │ building │ → │ deploying │ → │ deployed │
└─────────┘ └──────────┘ └───────────┘ └──────────┘
│ │
↓ ↓
┌────────┐ ┌──────────┐
│ failed │ │ sleeping │
└────────┘ └──────────┘| State | Description | Actions Available |
|---|---|---|
| Waiting for build slot | Cancel |
| Build in progress | Cancel, View logs |
| Pushing to infrastructure | Wait |
| Live and serving traffic | Assign to env |
| Build or deploy error | Retry, View logs |
| Idle timeout (cost saving) | Wake up |
┌─────────┐ ┌──────────┐ ┌───────────┐ ┌──────────┐
│ 排队中 │ → │ 构建中 │ → │ 部署中 │ → │ 已部署 │
└─────────┘ └──────────┘ └───────────┘ └──────────┘
│ │
↓ ↓
┌────────┐ ┌──────────┐
│ 失败 │ │ 休眠中 │
└────────┘ └──────────┘| 状态 | 描述 | 可用操作 |
|---|---|---|
| 等待构建插槽 | 取消 |
| 构建进行中 | 取消、查看日志 |
| 推送到基础设施 | 等待 |
| 已上线并处理流量 | 分配到环境 |
| 构建或部署错误 | 重试、查看日志 |
| 空闲超时(节省成本) | 唤醒 |
Skill: Deployment Operations
技能:部署操作
| Operation | Tool | Notes |
|---|---|---|
| List | | Max 20/page, paginate for more |
| Get details | | Full status, timestamps, URLs |
| Retry | | |
| Cancel | | Only |
| Delete | | Marks for async deletion |
| Wake | | Restarts sleeping deployment |
| Download | | Upload projects only |
| 操作 | 工具 | 说明 |
|---|---|---|
| 列出 | | 最多20条/页,分页查看更多 |
| 获取详情 | | 完整状态、时间戳、URL |
| 重试 | | |
| 取消 | | 仅适用于 |
| 删除 | | 标记为异步删除 |
| 唤醒 | | 重启休眠的部署 |
| 下载 | | 仅适用于上传项目 |
Skill: Debug with Logs
技能:使用日志调试
Build logs — Debug compilation/build failures:
json
GetBuildLogs(project_id, deployment_id, skip?)
// skip: number of lines to skip (for pagination)Runtime logs — Debug application errors:
json
GetDeploymentLogs(project_id, deployment_id, since-seconds?)
// since-seconds: look back window (default: 60)Environment logs — Aggregate logs for an environment:
json
GetProjectEnvironmentLogs(project_id, environment_id, since-seconds?)构建日志 — 调试编译/构建失败:
json
GetBuildLogs(project_id, deployment_id, skip?)
// skip: 跳过的行数(用于分页)运行时日志 — 调试应用错误:
json
GetDeploymentLogs(project_id, deployment_id, since-seconds?)
// since-seconds: 回溯时间窗口(默认:60秒)环境日志 — 环境的聚合日志:
json
GetProjectEnvironmentLogs(project_id, environment_id, since-seconds?)Environment Management Skills
环境管理技能
Skill: Create Environments
技能:创建环境
Environments provide isolated configurations for the same codebase.
Typical setup:
- — Live traffic, max resources
production - — Pre-production testing
staging - — Feature development
development
环境为同一代码库提供隔离的配置。
典型配置:
- — 处理实时流量,分配最大资源
production - — 预生产测试
staging - — 功能开发
development
VCS Project Environment (branch required)
VCS项目环境(需要分支)
json
CreateProjectEnvironment(project_id, {
"displayName": "Production",
"uniqueName": "production",
"description": "Live production environment",
"branch": "main",
"isAutoPromoteEnabled": true,
"resources": {
"cpu": 500,
"memory": 1024,
"replicas": 2
},
"settings": {
"runEnvs": {
"NODE_ENV": "production",
"DATABASE_URL": "postgresql://prod-db:5432/app",
"REDIS_URL": "redis://prod-cache:6379"
}
}
})json
CreateProjectEnvironment(project_id, {
"displayName": "生产环境",
"uniqueName": "production",
"description": "线上生产环境",
"branch": "main",
"isAutoPromoteEnabled": true,
"resources": {
"cpu": 500,
"memory": 1024,
"replicas": 2
},
"settings": {
"runEnvs": {
"NODE_ENV": "production",
"DATABASE_URL": "postgresql://prod-db:5432/app",
"REDIS_URL": "redis://prod-cache:6379"
}
}
})Image Project Environment (no branch)
镜像项目环境(无需分支)
json
CreateProjectEnvironment(project_id, {
"displayName": "Production",
"uniqueName": "production",
"description": "Live production environment",
"resources": {
"cpu": 500,
"memory": 1024,
"replicas": 2
},
"settings": {
"runEnvs": {
"NODE_ENV": "production"
}
}
})json
CreateProjectEnvironment(project_id, {
"displayName": "生产环境",
"uniqueName": "production",
"description": "线上生产环境",
"resources": {
"cpu": 500,
"memory": 1024,
"replicas": 2
},
"settings": {
"runEnvs": {
"NODE_ENV": "production"
}
}
})Skill: Resource Management
技能:资源管理
| Resource | Min | Max | Unit | Implications |
|---|---|---|---|---|
| CPU | 200 | 500 | millicores | Higher = faster processing |
| Memory | 500 | 1024 | MB | Higher = more data in memory |
| Replicas | 1 | 3 | instances | Higher = more availability |
json
UpdateProjectEnvironmentResources(project_id, environment_id, {
"cpu": 500,
"memory": 1024,
"replicas": 3
})Scaling considerations:
- Replicas > 1 requires stateless application design
- Memory limits cause OOM kills if exceeded
- CPU throttling occurs at limit (not killed)
| 资源 | 最小值 | 最大值 | 单位 | 影响 |
|---|---|---|---|---|
| CPU | 200 | 500 | millicores | 值越高,处理速度越快 |
| 内存 | 500 | 1024 | MB | 值越高,可在内存中存储的数据越多 |
| 副本数 | 1 | 3 | 实例数 | 值越高,可用性越高 |
json
UpdateProjectEnvironmentResources(project_id, environment_id, {
"cpu": 500,
"memory": 1024,
"replicas": 3
})扩容注意事项:
- 副本数>1需要应用为无状态设计
- 内存限制超出会导致OOM终止
- CPU达到限制时会被节流(不会终止)
Skill: Environment Variables
技能:环境变量
json
UpdateProjectEnvironmentEnvironmentVariables(project_id, environment_id, {
"runEnvs": {
"DATABASE_URL": "postgresql://...",
"API_KEY": "new-secret-key",
"LOG_LEVEL": "debug",
"FEATURE_FLAG_X": "enabled"
},
"port": 8080 // Image projects only
})Best practices:
- Never commit secrets to code — use
runEnvs - Use different values per environment
- Redeploy after changing vars for effect
json
UpdateProjectEnvironmentEnvironmentVariables(project_id, environment_id, {
"runEnvs": {
"DATABASE_URL": "postgresql://...",
"API_KEY": "new-secret-key",
"LOG_LEVEL": "debug",
"FEATURE_FLAG_X": "enabled"
},
"port": 8080 // 仅适用于镜像项目
})最佳实践:
- 永远不要将机密信息提交到代码中——使用存储
runEnvs - 每个环境使用不同的值
- 更改变量后需要重新部署才会生效
Skill: Deployment Assignment
技能:部署分配
Manually control which deployment serves an environment:
json
AssignDeploymentToProjectEnvironment(project_id, environment_id, {
"deploymentId": "deployment-uuid"
})Use cases:
- Rollback to previous deployment
- Blue-green deployment switching
- Canary releases (with multiple envs)
手动控制哪个部署为环境提供服务:
json
AssignDeploymentToProjectEnvironment(project_id, environment_id, {
"deploymentId": "deployment-uuid"
})使用场景:
- 回滚到之前的部署
- 蓝绿部署切换
- 金丝雀发布(配合多个环境)
Domain & Routing Skills
域名与路由技能
Skill: Add Custom Domains
技能:添加自定义域名
json
CreateDomain(project_id, {
"name": "api.mycompany.com",
"environmentId": "optional-env-uuid" // Assign immediately
})Response includes DNS instructions:
Add CNAME record:
api.mycompany.com → <createos-provided-target>json
CreateDomain(project_id, {
"name": "api.mycompany.com",
"environmentId": "optional-env-uuid" // 立即分配
})响应包含DNS配置说明:
添加CNAME记录:
api.mycompany.com → <createos提供的目标地址>Skill: Domain Verification Flow
技能:域名验证流程
1. CreateDomain → Status: pending
2. Configure DNS at your registrar
3. Wait for DNS propagation (up to 48 hours)
4. RefreshDomain → Status: active (if verified)json
RefreshDomain(project_id, domain_id)
// Only available when status is "pending"1. 调用CreateDomain → 状态:pending
2. 在域名注册商处配置DNS
3. 等待DNS传播(最多48小时)
4. 调用RefreshDomain → 状态:active(如果验证通过)json
RefreshDomain(project_id, domain_id)
// 仅当状态为"pending"时可用Skill: Domain-Environment Assignment
技能:域名-环境分配
Route domain traffic to specific environment:
json
UpdateDomainEnvironment(project_id, domain_id, {
"environmentId": "production-env-uuid"
})
// Set to null to unassignMulti-domain setup example:
- → production environment
app.example.com - → staging environment
staging.example.com - → development environment
dev.example.com
将域名流量路由到特定环境:
json
UpdateDomainEnvironment(project_id, domain_id, {
"environmentId": "production-env-uuid"
})
// 设置为null可取消分配多域名配置示例:
- → 生产环境
app.example.com - → 预发布环境
staging.example.com - → 开发环境
dev.example.com
Skill: Domain Operations
技能:域名操作
| Operation | Tool |
|---|---|
| List | |
| Verify | |
| Assign | |
| Delete | |
| 操作 | 工具 |
|---|---|
| 列出 | |
| 验证 | |
| 分配 | |
| 删除 | |
GitHub Integration Skills
GitHub集成技能
Skill: Connect GitHub Account
技能:连接GitHub账户
json
InstallGithubApp({
"installationId": 12345678,
"code": "oauth-code-from-github-redirect"
})Flow:
- User clicks "Connect GitHub" in CreateOS
- Redirected to GitHub for authorization
- GitHub redirects back with and
codeinstallationId - Call to complete connection
InstallGithubApp
json
InstallGithubApp({
"installationId": 12345678,
"code": "oauth-code-from-github-redirect"
})流程:
- 用户在CreateOS中点击“连接GitHub”
- 重定向到GitHub进行授权
- GitHub重定向回来并携带和
codeinstallationId - 调用完成连接
InstallGithubApp
Skill: Repository Discovery
技能:仓库发现
json
// 1. Get connected accounts
ListConnectedGithubAccounts()
// Returns: [{installationId, accountName, accountType}, ...]
// 2. List accessible repositories
ListGithubRepositories(installation_id)
// Returns: [{id, name, fullName, private, defaultBranch}, ...]
// 3. List branches for a repo
ListGithubRepositoryBranches(installation_id, "owner/repo", page?, per-page?, protected?)
// Returns: [{name, protected}, ...]
// 4. Get file tree (for monorepo path selection)
GetGithubRepositoryContent(installation_id, {
"repository": "owner/repo",
"branch": "main",
"treeSha": "optional-tree-sha"
})json
// 1. 获取已连接的账户
ListConnectedGithubAccounts()
// 返回:[{installationId, accountName, accountType}, ...]
// 2. 列出可访问的仓库
ListGithubRepositories(installation_id)
// 返回:[{id, name, fullName, private, defaultBranch}, ...]
// 3. 列出仓库的分支
ListGithubRepositoryBranches(installation_id, "owner/repo", page?, per-page?, protected?)
// 返回:[{name, protected}, ...]
// 4. 获取文件树(用于选择单体仓库的路径)
GetGithubRepositoryContent(installation_id, {
"repository": "owner/repo",
"branch": "main",
"treeSha": "optional-tree-sha"
})Skill: Auto-Deploy Configuration
技能:自动部署配置
Branch filtering — Ignore branches from auto-deploy:
json
UpdateProjectSettings(project_id, {
"ignoreBranches": ["develop", "feature/*", "wip/*"]
})Auto-promote — Automatically assign deployments to environment:
json
CreateProjectEnvironment(project_id, {
"branch": "main",
"isAutoPromoteEnabled": true,
// ... other settings
})When , successful deployments from the branch automatically become active in that environment.
isAutoPromoteEnabled: true分支过滤 — 忽略不需要自动部署的分支:
json
UpdateProjectSettings(project_id, {
"ignoreBranches": ["develop", "feature/*", "wip/*"]
})自动升级 — 自动将部署分配到环境:
json
CreateProjectEnvironment(project_id, {
"branch": "main",
"isAutoPromoteEnabled": true,
// ... 其他设置
})当时,该分支的成功部署会自动成为该环境的活跃部署。
isAutoPromoteEnabled: trueAnalytics & Monitoring Skills
分析与监控技能
Skill: Comprehensive Analytics
技能:综合分析
json
GetProjectEnvironmentAnalytics(project_id, environment_id, {
"start": 1704067200, // Unix timestamp (default: 1 hour ago)
"end": 1704070800 // Unix timestamp (default: now)
})Returns:
- Overall request counts
- Status code distribution
- RPM (requests per minute)
- Success percentage
- Top hit paths
- Top error paths
json
GetProjectEnvironmentAnalytics(project_id, environment_id, {
"start": 1704067200, // Unix时间戳(默认:1小时前)
"end": 1704070800 // Unix时间戳(默认:现在)
})返回内容:
- 总请求数
- 状态码分布
- RPM(每分钟请求数)
- 成功率
- 热门访问路径
- 热门错误路径
Skill: Individual Metrics
技能:单独指标
| Metric | Tool | Returns |
|---|---|---|
| Overall requests | | Total, 2xx, 4xx, 5xx counts |
| RPM | | Peak and average RPM |
| Success % | | (2xx + 3xx) / total |
| Time series | | Requests by status over time |
| Top paths | | Top 10 most accessed |
| Error paths | | Top 10 error-prone |
| Distribution | | Breakdown by status code |
| 指标 | 工具 | 返回内容 |
|---|---|---|
| 总请求数 | | 总数、2xx、4xx、5xx数量 |
| RPM | | 峰值和平均RPM |
| 成功率 | | (2xx + 3xx) / 总数 |
| 时间序列 | | 按状态码划分的请求时序数据 |
| 热门路径 | | 前10个最常访问的路径 |
| 错误路径 | | 前10个易出错的路径 |
| 分布 | | 按状态码细分的请求分布 |
Skill: Performance Monitoring
技能:性能监控
Identify issues:
- Check — drop indicates problems
SuccessPercentage - Review — find problematic endpoints
TopErrorPaths - Analyze — spot traffic patterns
RequestsOverTime - Monitor — detect traffic spikes
RPM
识别问题:
- 查看— 下降表示存在问题
SuccessPercentage - 查看— 找到有问题的端点
TopErrorPaths - 分析— 发现流量模式
RequestsOverTime - 监控— 检测流量峰值
RPM
Security Skills
安全技能
Skill: Vulnerability Scanning
技能:漏洞扫描
Enable scanning:
json
UpdateProject(project_id, {
"enabledSecurityScan": true
})Trigger scan:
json
TriggerSecurityScan(project_id, deployment_id)View results:
json
GetSecurityScan(project_id, deployment_id)
// Returns: {status, vulnerabilities, summary}Download full report:
json
GetSecurityScanDownloadUri(project_id, deployment_id)
// Only when status is "successful"
// Returns signed URL for report downloadRetry failed scan:
json
RetriggerSecurityScan(project_id, deployment_id)
// Only when status is "failed"启用扫描:
json
UpdateProject(project_id, {
"enabledSecurityScan": true
})触发扫描:
json
TriggerSecurityScan(project_id, deployment_id)查看结果:
json
GetSecurityScan(project_id, deployment_id)
// 返回:{status, vulnerabilities, summary}下载完整报告:
json
GetSecurityScanDownloadUri(project_id, deployment_id)
// 仅当状态为"successful"时可用
// 返回用于下载报告的签名URL重试失败的扫描:
json
RetriggerSecurityScan(project_id, deployment_id)
// 仅当状态为"failed"时可用Organization Skills (Apps)
组织技能(应用)
Skill: Group Projects
技能:分组项目
Apps provide logical grouping for related projects and services.
json
CreateApp({
"name": "E-Commerce Platform",
"description": "All services for the e-commerce system",
"color": "#3B82F6"
})应用为相关项目和服务提供逻辑分组。
json
CreateApp({
"name": "电商平台",
"description": "电商系统的所有服务",
"color": "#3B82F6"
})Skill: Manage App Contents
技能:管理应用内容
json
// Add projects to app
AddProjectsToApp(app_id, {
"projectIds": ["project-1-uuid", "project-2-uuid"]
})
// Remove projects
RemoveProjectsFromApp(app_id, {
"projectIds": ["project-1-uuid"]
})
// List projects in app
ListProjectsByApp(app_id, limit?, offset?)
// Same for services
AddServicesToApp(app_id, {"serviceIds": [...]})
RemoveServicesFromApp(app_id, {"serviceIds": [...]})
ListServicesByApp(app_id, limit?, offset?)json
// 将项目添加到应用
AddProjectsToApp(app_id, {
"projectIds": ["project-1-uuid", "project-2-uuid"]
})
// 移除项目
RemoveProjectsFromApp(app_id, {
"projectIds": ["project-1-uuid"]
})
// 列出应用中的项目
ListProjectsByApp(app_id, limit?, offset?)
// 服务同理
AddServicesToApp(app_id, {"serviceIds": [...]})
RemoveServicesFromApp(app_id, {"serviceIds": [...]})
ListServicesByApp(app_id, limit?, offset?)Skill: App Lifecycle
技能:应用生命周期
| Operation | Tool |
|---|---|
| List | |
| Update | |
| Delete | |
Note: Deleting an app sets on associated projects/services (doesn't delete them).
appId: null| 操作 | 工具 |
|---|---|
| 列出 | |
| 更新 | |
| 删除 | |
注意:删除应用会将关联的项目/服务的设置为(不会删除项目/服务)。
appIdnullAPI Key Management Skills
API密钥管理技能
Skill: Create API Keys
技能:创建API密钥
json
CreateAPIKey({
"name": "production-key",
"description": "API key for production CI/CD",
"expiryAt": "2025-12-31T23:59:59Z"
})
// Returns: {id, name, key, expiryAt}
// IMPORTANT: key is only shown once at creationjson
CreateAPIKey({
"name": "production-key",
"description": "生产环境CI/CD的API密钥",
"expiryAt": "2025-12-31T23:59:59Z"
})
// 返回:{id, name, key, expiryAt}
// 重要提示:key仅在创建时显示一次Skill: API Key Operations
技能:API密钥操作
| Operation | Tool |
|---|---|
| List | |
| Update | |
| Revoke | |
| Check name | |
| 操作 | 工具 |
|---|---|
| 列出 | |
| 更新 | |
| 撤销 | |
| 检查名称 | |
Skill: User & Quota Management
技能:用户与配额管理
json
GetCurrentUser()
// Returns: user profile information
GetQuotas()
// Returns: {projects: {used, limit}, apiKeys: {used, limit}, ...}
GetSupportedProjectTypes()
// Returns: current list of supported runtimes and frameworksjson
GetCurrentUser()
// 返回:用户资料信息
GetQuotas()
// 返回:{projects: {used, limit}, apiKeys: {used, limit}, ...}
GetSupportedProjectTypes()
// 返回:当前支持的运行时和框架列表Common Deployment Patterns
常见部署模式
Pattern: AI Agent Deployment
模式:AI Agent部署
json
CreateProject({
"uniqueName": "intelligent-agent",
"displayName": "Intelligent Agent",
"type": "vcs",
"source": {"vcsName": "github", "vcsInstallationId": "...", "vcsRepoId": "..."},
"settings": {
"runtime": "python:3.12",
"port": 8000,
"installCommand": "pip install -r requirements.txt",
"runCommand": "python -m uvicorn agent:app --host 0.0.0.0 --port 8000",
"runEnvs": {
"OPENAI_API_KEY": "sk-...",
"ANTHROPIC_API_KEY": "sk-ant-...",
"LANGCHAIN_TRACING": "true",
"AGENT_MEMORY_BACKEND": "redis"
}
}
})json
CreateProject({
"uniqueName": "intelligent-agent",
"displayName": "Intelligent Agent",
"type": "vcs",
"source": {"vcsName": "github", "vcsInstallationId": "...", "vcsRepoId": "..."},
"settings": {
"runtime": "python:3.12",
"port": 8000,
"installCommand": "pip install -r requirements.txt",
"runCommand": "python -m uvicorn agent:app --host 0.0.0.0 --port 8000",
"runEnvs": {
"OPENAI_API_KEY": "sk-...",
"ANTHROPIC_API_KEY": "sk-ant-...",
"LANGCHAIN_TRACING": "true",
"AGENT_MEMORY_BACKEND": "redis"
}
}
})Pattern: MCP Server Deployment
模式:MCP服务器部署
json
CreateProject({
"uniqueName": "my-mcp-server",
"displayName": "Custom MCP Server",
"type": "vcs",
"source": {"vcsName": "github", "vcsInstallationId": "...", "vcsRepoId": "..."},
"settings": {
"runtime": "node:20",
"port": 3000,
"installCommand": "npm install",
"runCommand": "node server.js",
"runEnvs": {
"MCP_TRANSPORT": "sse",
"MCP_PATH": "/mcp"
}
}
})MCP Endpoint:
https://{uniqueName}.createos.io/mcpjson
CreateProject({
"uniqueName": "my-mcp-server",
"displayName": "Custom MCP Server",
"type": "vcs",
"source": {"vcsName": "github", "vcsInstallationId": "...", "vcsRepoId": "..."},
"settings": {
"runtime": "node:20",
"port": 3000,
"installCommand": "npm install",
"runCommand": "node server.js",
"runEnvs": {
"MCP_TRANSPORT": "sse",
"MCP_PATH": "/mcp"
}
}
})MCP端点:
https://{uniqueName}.createos.io/mcpPattern: RAG Pipeline
模式:RAG流水线
json
CreateProject({
"uniqueName": "rag-pipeline",
"displayName": "RAG Pipeline Service",
"type": "vcs",
"settings": {
"runtime": "python:3.12",
"port": 8000,
"runCommand": "uvicorn main:app --host 0.0.0.0 --port 8000",
"runEnvs": {
"PINECONE_API_KEY": "...",
"PINECONE_ENVIRONMENT": "us-west1-gcp",
"OPENAI_API_KEY": "...",
"EMBEDDING_MODEL": "text-embedding-3-small",
"CHUNK_SIZE": "512",
"CHUNK_OVERLAP": "50"
}
}
})json
CreateProject({
"uniqueName": "rag-pipeline",
"displayName": "RAG Pipeline Service",
"type": "vcs",
"settings": {
"runtime": "python:3.12",
"port": 8000,
"runCommand": "uvicorn main:app --host 0.0.0.0 --port 8000",
"runEnvs": {
"PINECONE_API_KEY": "...",
"PINECONE_ENVIRONMENT": "us-west1-gcp",
"OPENAI_API_KEY": "...",
"EMBEDDING_MODEL": "text-embedding-3-small",
"CHUNK_SIZE": "512",
"CHUNK_OVERLAP": "50"
}
}
})Pattern: Discord/Slack Bot
模式:Discord/Slack机器人
json
CreateProject({
"uniqueName": "discord-bot",
"displayName": "Discord Bot",
"type": "image",
"source": {},
"settings": {
"port": 8080,
"runEnvs": {
"DISCORD_TOKEN": "...",
"DISCORD_CLIENT_ID": "...",
"BOT_PREFIX": "!",
"LOG_CHANNEL_ID": "..."
}
}
})
// Deploy with:
CreateDeployment(project_id, {"image": "my-discord-bot:v1.0.0"})json
CreateProject({
"uniqueName": "discord-bot",
"displayName": "Discord Bot",
"type": "image",
"source": {},
"settings": {
"port": 8080,
"runEnvs": {
"DISCORD_TOKEN": "...",
"DISCORD_CLIENT_ID": "...",
"BOT_PREFIX": "!",
"LOG_CHANNEL_ID": "..."
}
}
})
// 部署命令:
CreateDeployment(project_id, {"image": "my-discord-bot:v1.0.0"})Pattern: Multi-Agent System
模式:多Agent系统
┌─────────────────────────────────────────────────┐
│ App: Agent Swarm │
├─────────────────┬─────────────────┬─────────────┤
│ Orchestrator │ Worker Agent │ Worker Agent│
│ (coordinator) │ (researcher) │ (executor) │
└────────┬────────┴────────┬────────┴──────┬──────┘
│ │ │
└────── HTTP/gRPC communication ──┘json
// 1. Create app
CreateApp({"name": "Agent Swarm"})
// 2. Create orchestrator
CreateProject({
"uniqueName": "orchestrator",
"type": "vcs",
"appId": app_id,
"settings": {
"runEnvs": {
"WORKER_RESEARCHER_URL": "https://researcher.createos.io",
"WORKER_EXECUTOR_URL": "https://executor.createos.io"
}
}
})
// 3. Create workers
CreateProject({"uniqueName": "researcher", "appId": app_id, ...})
CreateProject({"uniqueName": "executor", "appId": app_id, ...})┌─────────────────────────────────────────────────┐
│ 应用:Agent集群 │
├─────────────────┬─────────────────┬─────────────┤
│ 编排器 │ 工作Agent │ 工作Agent │
│ (协调器) │ (研究员) │ (执行者) │
└────────┬────────┴────────┬────────┴──────┬──────┘
│ │ │
└────── HTTP/gRPC通信 ──┘json
// 1. 创建应用
CreateApp({"name": "Agent Swarm"})
// 2. 创建编排器
CreateProject({
"uniqueName": "orchestrator",
"type": "vcs",
"appId": app_id,
"settings": {
"runEnvs": {
"WORKER_RESEARCHER_URL": "https://researcher.createos.io",
"WORKER_EXECUTOR_URL": "https://executor.createos.io"
}
}
})
// 3. 创建工作Agent
CreateProject({"uniqueName": "researcher", "appId": app_id, ...})
CreateProject({"uniqueName": "executor", "appId": app_id, ...})Pattern: Blue-Green Deployment
模式:蓝绿部署
1. CreateProjectEnvironment "blue" with branch "main"
2. CreateProjectEnvironment "green" with branch "main"
3. CreateDomain "app.example.com" → assign to "blue"
4. Deploy new version to "green"
5. Test via green's environment URL
6. UpdateDomainEnvironment → switch to "green"
7. "blue" becomes the standby1. 创建名为"blue"的ProjectEnvironment,关联分支"main"
2. 创建名为"green"的ProjectEnvironment,关联分支"main"
3. 创建域名"app.example.com" → 分配到"blue"
4. 将新版本部署到"green"
5. 通过green的环境URL进行测试
6. 调用UpdateDomainEnvironment → 切换到"green"
7. "blue"成为备用环境Pattern: Rollback
模式:回滚
json
// 1. Find previous good deployment
ListDeployments(project_id, {limit: 10})
// Identify deployment_id of last known good
// 2. Assign to environment
AssignDeploymentToProjectEnvironment(project_id, environment_id, {
"deploymentId": "previous-good-deployment-id"
})json
// 1. 找到之前正常的部署
ListDeployments(project_id, {limit: 10})
// 确定最后一个正常的deployment_id
// 2. 分配到环境
AssignDeploymentToProjectEnvironment(project_id, environment_id, {
"deploymentId": "previous-good-deployment-id"
})Best Practices
最佳实践
Security
安全
- Never hardcode secrets — Use for all sensitive data
runEnvs - Enable security scanning — Catch vulnerabilities early
- Rotate API keys — Set reasonable expiry dates
- Use environment isolation — Different secrets per environment
- 永远不要硬编码机密信息 — 使用存储所有敏感数据
runEnvs - 启用安全扫描 — 尽早发现漏洞
- 轮换API密钥 — 设置合理的过期时间
- 使用环境隔离 — 每个环境使用不同的机密信息
Performance
性能
- Right-size resources — Start small, scale based on metrics
- Use replicas for availability — Min 2 for production
- Monitor analytics — Set up alerts for error rate spikes
- Optimize builds — Use over
npm cinpm install
- 合理分配资源 — 从小规模开始,根据指标扩容
- 使用副本保证可用性 — 生产环境至少2个副本
- 监控分析数据 — 为错误率峰值设置告警
- 优化构建 — 使用替代
npm cinpm install
Reliability
可靠性
- Enable auto-promote carefully — Test in staging first
- Keep previous deployments — Enable quick rollbacks
- Use health checks — Ensure matches app's listen port
port - Handle sleeping deployments — Wake or configure keep-alive
- 谨慎启用自动升级 — 先在预发布环境测试
- 保留之前的部署 — 启用快速回滚
- 使用健康检查 — 确保与应用监听端口一致
port - 处理休眠部署 — 唤醒或配置保活
Organization
组织
- Use Apps — Group related projects logically
- Naming conventions — pattern
{app}-{service}-{env} - Document environments — Clear descriptions for each
- Clean up unused — Delete old projects and deployments
- 使用应用分组 — 按逻辑分组相关项目
- 命名规范 — 使用模式
{app}-{service}-{env} - 记录环境信息 — 为每个环境添加清晰的描述
- 清理未使用的资源 — 删除旧项目和部署
Troubleshooting & Edge Cases
故障排除与边缘案例
Common Errors
常见错误
| Error | Diagnosis | Solution |
|---|---|---|
| Build failed | | Fix code errors, check dependencies |
| Runtime crash | | Check startup errors, missing env vars |
| Health check fail | App not responding on port | Verify |
| 502 Bad Gateway | App crashed after deploy | Check logs, increase memory if OOM |
| Domain pending | DNS not propagated | Wait 24-48h, verify CNAME record |
| Quota exceeded | | Upgrade plan or delete unused |
| Deployment sleeping | Idle timeout | |
| 错误 | 诊断 | 解决方案 |
|---|---|---|
| 构建失败 | 调用 | 修复代码错误,检查依赖项 |
| 运行时崩溃 | 调用 | 检查启动错误,缺失的环境变量 |
| 健康检查失败 | 应用未在指定端口响应 | 验证 |
| 502 Bad Gateway | 部署后应用崩溃 | 查看日志,若OOM则增加内存 |
| 域名pending | DNS未传播 | 等待24-48小时,验证CNAME记录 |
| 配额超出 | 调用 | 升级套餐或删除未使用的资源 |
| 部署休眠 | 空闲超时 | 调用 |
Edge Cases
边缘案例
High-load scenarios:
- Max 3 replicas per environment
- Consider external load balancer for higher scale
- Monitor RPM and adjust resources
Monorepo projects:
- Set to subdirectory
directoryPath - Use to explore structure
GetGithubRepositoryContent
Private npm/pip packages:
- Add auth tokens to
buildVars - Use or
.npmrcin repopip.conf
Long-running builds:
- Build timeout is 15 minutes
- Use for complex builds
hasDockerfile: true - Pre-build images for image projects
高负载场景:
- 每个环境最多3个副本
- 更高规模请考虑外部负载均衡器
- 监控RPM并调整资源
单体仓库项目:
- 设置为子目录
directoryPath - 使用探索结构
GetGithubRepositoryContent
私有npm/pip包:
- 将认证令牌添加到
buildVars - 在仓库中使用或
.npmrcpip.conf
长时间构建:
- 构建超时时间为15分钟
- 复杂构建使用
hasDockerfile: true - 为镜像项目预构建镜像
API Quick Reference
API快速参考
Project Lifecycle
项目生命周期
CreateProject → ListProjects → GetProject → UpdateProject → UpdateProjectSettings → DeleteProject
CheckProjectUniqueName | GetProjectTransferUri → TransferProject | ListProjectTransferHistoryCreateProject → ListProjects → GetProject → UpdateProject → UpdateProjectSettings → DeleteProject
CheckProjectUniqueName | GetProjectTransferUri → TransferProject | ListProjectTransferHistoryDeployment Lifecycle
部署生命周期
CreateDeployment | TriggerLatestDeployment | UploadDeploymentFiles | UploadDeploymentBase64Files | UploadDeploymentZip
ListDeployments → GetDeployment → AssignDeploymentToProjectEnvironment
RetriggerDeployment | CancelDeployment | DeleteDeployment | WakeupDeployment | DownloadDeployment
GetBuildLogs | GetDeploymentLogsCreateDeployment | TriggerLatestDeployment | UploadDeploymentFiles | UploadDeploymentBase64Files | UploadDeploymentZip
ListDeployments → GetDeployment → AssignDeploymentToProjectEnvironment
RetriggerDeployment | CancelDeployment | DeleteDeployment | WakeupDeployment | DownloadDeployment
GetBuildLogs | GetDeploymentLogsEnvironment Lifecycle
环境生命周期
CreateProjectEnvironment → ListProjectEnvironments → UpdateProjectEnvironment → DeleteProjectEnvironment
CheckProjectEnvironmentUniqueName | AssignDeploymentToProjectEnvironment
UpdateProjectEnvironmentEnvironmentVariables | UpdateProjectEnvironmentResources
GetProjectEnvironmentLogsCreateProjectEnvironment → ListProjectEnvironments → UpdateProjectEnvironment → DeleteProjectEnvironment
CheckProjectEnvironmentUniqueName | AssignDeploymentToProjectEnvironment
UpdateProjectEnvironmentEnvironmentVariables | UpdateProjectEnvironmentResources
GetProjectEnvironmentLogsDomain Lifecycle
域名生命周期
CreateDomain → ListDomains → RefreshDomain → UpdateDomainEnvironment → DeleteDomainCreateDomain → ListDomains → RefreshDomain → UpdateDomainEnvironment → DeleteDomainGitHub Integration
GitHub集成
InstallGithubApp → ListConnectedGithubAccounts
ListGithubRepositories → ListGithubRepositoryBranches → GetGithubRepositoryContentInstallGithubApp → ListConnectedGithubAccounts
ListGithubRepositories → ListGithubRepositoryBranches → GetGithubRepositoryContentAnalytics
分析
GetProjectEnvironmentAnalytics (comprehensive)
GetProjectEnvironmentAnalyticsOverallRequests | GetProjectEnvironmentAnalyticsRPM
GetProjectEnvironmentAnalyticsSuccessPercentage | GetProjectEnvironmentAnalyticsRequestsOverTime
GetProjectEnvironmentAnalyticsTopHitPaths | GetProjectEnvironmentAnalyticsTopErrorPaths
GetEnvAnalyticsReqDistributionGetProjectEnvironmentAnalytics (综合)
GetProjectEnvironmentAnalyticsOverallRequests | GetProjectEnvironmentAnalyticsRPM
GetProjectEnvironmentAnalyticsSuccessPercentage | GetProjectEnvironmentAnalyticsRequestsOverTime
GetProjectEnvironmentAnalyticsTopHitPaths | GetProjectEnvironmentAnalyticsTopErrorPaths
GetEnvAnalyticsReqDistributionSecurity
安全
TriggerSecurityScan → GetSecurityScan → GetSecurityScanDownloadUri
RetriggerSecurityScanTriggerSecurityScan → GetSecurityScan → GetSecurityScanDownloadUri
RetriggerSecurityScanApps
应用
CreateApp → ListApps → UpdateApp → DeleteApp
AddProjectsToApp | RemoveProjectsFromApp | ListProjectsByApp
AddServicesToApp | RemoveServicesFromApp | ListServicesByAppCreateApp → ListApps → UpdateApp → DeleteApp
AddProjectsToApp | RemoveProjectsFromApp | ListProjectsByApp
AddServicesToApp | RemoveServicesFromApp | ListServicesByAppAPI Keys & User
API密钥与用户
CreateAPIKey → ListAPIKeys → UpdateAPIKey → RevokeAPIKey
CheckAPIKeyUniqueName | GetCurrentUser | GetQuotas | GetSupportedProjectTypesCreateAPIKey → ListAPIKeys → UpdateAPIKey → RevokeAPIKey
CheckAPIKeyUniqueName | GetCurrentUser | GetQuotas | GetSupportedProjectTypesNaming Constraints
命名约束
| Field | Min | Max | Pattern |
|---|---|---|---|
| Project uniqueName | 4 | 32 | |
| Project displayName | 4 | 48 | |
| Description | 4 | 2048 | Any text |
| Environment uniqueName | 4 | 32 | |
| Environment displayName | 4 | 48 | |
| API key name | 4 | 48 | |
| Domain name | 3 | 255 | Valid domain |
Last updated: January 2025
| 字段 | 最小长度 | 最大长度 | 格式 |
|---|---|---|---|
| Project uniqueName | 4 | 32 | |
| Project displayName | 4 | 48 | |
| Description | 4 | 2048 | 任意文本 |
| Environment uniqueName | 4 | 32 | |
| Environment displayName | 4 | 48 | |
| API key name | 4 | 48 | |
| Domain name | 3 | 255 | 有效的域名 |
最后更新:2025年1月