← 返回 CLI 目录 抓取的
XcodeGen
$ xcodegen 社区开源 低风险 Yonas Kolb · 代码托管与研发协同 · MIT · macos
XcodeGen(xcodegen)根据声明式 project.yml 确定性地生成 .xcodeproj 工程包,从而消除 .pbxproj 的 git 合并冲突。支持 --quiet、--use-cache 与 --spec 无交互运行,但输出为纯文本且无 JSON 或空跑模式。
FCRS-1.0 综合评分
74 /100
可用但有局限
高置信度 (实测)
零摩擦安装命令
brew install xcodegen CLI vs MCP 选型建议 仅 CLI 可用
xcodegen 在 macOS 本地读取 project.yml 与源码目录并生成 .xcodeproj,不适用 MCP。
Agent 友好度体检单
本地探针实测证据 — 原生 JSON 输出
— 字段裁剪
✓ 无头非交互
— 支持 Dry-Run
— 只读模式开关
— 支持 NO_COLOR
✓ 自省/Schema 发现
— 官方 SKILL.md
实测版本
Version: 2.46.0
冷启动耗时
32 ms
退出码 (help / 非法参数)
0 / 1
NO_COLOR 无色码污染 / 无 TTY 不挂起
Yes / Safe
抓取的 --help 摘要
Usage: xcodegen [options]
Generate an Xcode project from a spec
Options:
--cache-path <value> Where the cache file will be loaded from and save to. Defaults to ~/.xcodegen/cache/{SPEC_PATH_HASH}
-h, --help Show help information
-n, --no-env Disable environment variable expansions
--only-plists Generate only plist files
-p, --project <value> The path to the directory where the project should be generated. Defaults to the directory the spec is in. The filename is defined in the project spec
-r, --project-root <value> The path to the project root directory. Defaults to the directory containing the project spec.
-q, --quiet Suppress all informational and success output
-s, --spec <value> The path to the project spec file. Defaults to project.yml. (It is also possible to link to multiple spec files by comma separating them. Note that all other flags will be the same.)
-c, --use-cache Use a cache for the xcodegen spec. This will prevent unnecessarily generating the project if nothing has changed FCRS-1.0 六维评分拆解
Agent 友好度 16 / 25
快速、确定且非交互,支持 --quiet、--spec、--use-cache 与 --no-env,但缺少 --json 与 --dry-run。
- Supports
--quiet,--use-cache, and explicit--spec <path>flags - Zero interactive prompts during generation
安全与权限边界 20 / 25
由声明式 YAML 确定性生成本地 .xcodeproj,--use-cache 可跳过不必要的重写。
- Writes only target
.xcodeprojand optional~/.xcodegen/cache/
安装与运行摩擦 10 / 15
可通过 brew install xcodegen 安装的 Swift 编译二进制,仅面向 macOS Apple 生态。
- macOS-only binary distributed via Homebrew and GitHub releases
能力覆盖与边际价值 13 / 15
彻底避免 Agent 直接修补充满 UUID 的 .pbxproj 文件,改用 project.yml 配合 xcodegen 后安全度大幅提升。
- Replaces error-prone
.pbxprojediting with declarative YAML
维护与来源背书 7 / 10
社区项目(yonaskolb/XcodeGen),采用 MIT 协议并在 iOS 团队中广泛使用。
- Maintained at
yonaskolb/XcodeGen(MIT)
文档与可验证性 8 / 10
仓库内的 ProjectSpec.md 与 Usage.md 文档清晰,且 --help 简洁明确。
- Structured YAML schema docs in
yonaskolb/XcodeGen
安全边界、鉴权与放权指南
鉴权方式
无需鉴权
凭证存储位置
无需身份认证;可选的规范缓存存储在 ~/.xcodegen/cache/。
潜在副作用
只读查询 本地写入
费用与配额提示
MIT 开源 CLI,免费使用。
可复制到 CLAUDE.md / AGENTS.md 的安全护栏
# XcodeGen (xcodegen) Agent Rules - Edit `project.yml` instead of hand-editing `.pbxproj` files, then run `xcodegen generate --use-cache --quiet`. - Confirm `.xcodeproj` is gitignored or cleanly diffed after regeneration.
Agent 高频安全命令配方
只读查询(安全推荐)
查看 CLI 参数与规范选项
xcodegen --help
打印 xcodegen 支持的 --spec、--project、--use-cache 与 --quiet 等参数。
受控写入与预演
使用缓存重新生成 Xcode 工程
xcodegen generate --spec project.yml --use-cache --quiet
仅在 project.yml 或源码树发生变化时重新生成 .xcodeproj,并抑制成功日志。
核心优势
- + 让 Agent 通过清晰的
project.yml管理 Xcode target、scheme 与文件,无需碰.pbxproj。 - +
--use-cache与--quiet让编辑后的重复生成既快又安静。 - + 无交互阻塞,也不依赖后台守护进程。
注意事项与踩坑点
- ! 仅限 macOS,且缺少
--dry-run或--json输出。 - ! 重新生成会覆盖直接在 Xcode UI 中对
.xcodeproj所做的手动修改。
已验证兼容的 Agent 宿主
Claude Code Codex CLI Gemini CLI