系列教程
35 节
DeepSeek Harness 教程
按顺序阅读,循序渐进掌握相关 AI 工具与实战方法。
从「DeepSeek Harness 教程:开篇导读」开始
Codex 支持与多种开发工具和平台集成,扩展其能力和应用场景。
Codex 与 GitHub 深度集成,可以在 PR 中直接进行代码审查。
| 功能 | 说明 |
|---|---|
| PR 审查 | 在 PR 评论中 @codex review 获取审查 |
| 自动审查 | 每个新 PR 自动触发审查 |
| CI 修复 | @codex fix the CI failures |
| 云端任务 | 其他 @codex 指令启动云端任务 |
# 在 PR 评论中输入 @codex review # 指定审查重点 @codex review for security issues # 审查性能问题 @codex review for performance regressions
Codex 会:
在仓库的 AGENTS.md 中定义审查规则:
## Review guidelines - Don't log PII (个人身份信息) - Verify authentication middleware wraps every route - Check for SQL injection vulnerabilities - Ensure error messages don't leak sensitive info - Treat typos in docs as P1 issues
Codex 默认只标记 P0 和 P1 问题,可在 AGENTS.md 中调整。
通过 Slack 集成,团队成员可以在频道中直接使用 Codex。
# 在 Slack 频道中 @codex review this PR: https://github.com/xxx/pull/123 # 解释代码 @codex explain this function # 下发任务 @codex fix the bug in auth module
Linear 是项目管理工具,Codex 可以与之联动处理 Issue。
| 场景 | 说明 |
|---|---|
| Issue 处理 | 根据 Issue 自动创建代码修改 |
| 审查结果同步 | 将审查发现添加到 Issue |
| 状态更新 | 自动更新 Issue 状态 |
| 评论回复 | 在 Issue 评论中 @codex |
MCP 是连接 Codex 与外部工具的协议。
# ~/.codex/config.toml # STDIO 服务器 [mcp_servers.filesystem] command = "npx" args = ["-y", "@modelcontextprotocol/server-filesystem", "./docs"] # HTTP 服务器 [mcp_servers.api] url = "https://api.example.com/mcp" bearer_token_env_var = "API_TOKEN"
| 服务器 | 功能 |
|---|---|
| filesystem | 文件系统访问 |
| github | GitHub API |
| postgres | PostgreSQL 数据库 |
| fetch | 网页抓取 |
| openai-docs | OpenAI 文档 |
# 工具白名单 [mcp_servers.filesystem] enabled_tools = ["read_file", "write_file"] # 工具黑名单 disabled_tools = ["delete_file"] # 工具审批模式 [mcp_servers.filesystem.tools.write_file] approval_mode = "ask" # ask | approve | deny
某些 MCP 服务器需要 OAuth 认证:
[mcp_servers.figma] url = "https://api.figma.com/mcp" scopes = ["file:read"] oauth_resource = "codex-integration" # OAuth 回调端口 mcp_oauth_callback_port = 8080 # 凭证存储 mcp_oauth_credentials_store = "keyring"
需要 Codex Cloud 订阅(Plus 或以上)。
可以在设置中选择性授权仓库。
大多数 MCP 服务器通过 npm 安装,Codex 会自动管理。
Codex 持续添加新集成,关注官方更新。