{"_id":"@ainame/xcodeproj-cli","_rev":"2-a79895421dfb143fa5bc4c1148347230","name":"@ainame/xcodeproj-cli","dist-tags":{"latest":"0.2.2"},"versions":{"0.2.1":{"name":"@ainame/xcodeproj-cli","version":"0.2.1","keywords":["xcode","xcodeproj","ios","macos","swift","build","cli"],"author":{"name":"ainame"},"license":"MIT","_id":"@ainame/xcodeproj-cli@0.2.1","maintainers":[{"name":"ainame","email":"s.namai.09@gmail.com"}],"homepage":"https://github.com/ainame/xcodeproj-cli","bugs":{"url":"https://github.com/ainame/xcodeproj-cli/issues"},"os":["darwin","linux"],"bin":{"xcodeproj":"bin/xcodeproj.js"},"cpu":["x64","arm64"],"dist":{"shasum":"8283882d43bc004a0147115ef3c6436341fd89bd","tarball":"https://registry.npmjs.org/@ainame/xcodeproj-cli/-/xcodeproj-cli-0.2.1.tgz","fileCount":3,"integrity":"sha512-wEByRUB2mJXcjwO5AwsNU+UWekD4tWl0w2ycadlgosgxd1A0HQBnbTCdiWp/Hw2pzZn94RVj3NbmiR3+zzTxoA==","signatures":[{"sig":"MEYCIQDcpt+odf8iXRGAQI5ktrmbKs21RXm2YFcstfALCTkZkwIhANvgbzVJte//RH+rxs8n39nMGWtU0mcxPEj9nrSjw0nm","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":7464},"type":"module","engines":{"node":">=18.0.0"},"gitHead":"402d0c4ed3ea3957e7ad1332e9ed89218675b62e","scripts":{"postinstall":"node postinstall.js"},"_npmUser":{"name":"ainame","email":"s.namai.09@gmail.com"},"repository":{"url":"git+https://github.com/ainame/xcodeproj-cli.git","type":"git"},"_npmVersion":"10.8.2","description":"Command-line tool for manipulating Xcode project files","directories":{},"_nodeVersion":"20.19.3","_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/xcodeproj-cli_0.2.1_1753136705673_0.6408245098788292","host":"s3://npm-registry-packages-npm-production"}},"0.2.2":{"name":"@ainame/xcodeproj-cli","version":"0.2.2","description":"Command-line tool for manipulating Xcode project files","keywords":["xcode","xcodeproj","ios","macos","swift","build","cli"],"homepage":"https://github.com/ainame/xcodeproj-cli","bugs":{"url":"https://github.com/ainame/xcodeproj-cli/issues"},"repository":{"type":"git","url":"git+https://github.com/ainame/xcodeproj-cli.git"},"license":"MIT","author":{"name":"ainame"},"type":"module","bin":{"xcodeproj":"bin/xcodeproj.js"},"scripts":{"postinstall":"node postinstall.js"},"os":["darwin","linux"],"cpu":["x64","arm64"],"engines":{"node":">=18.0.0"},"_id":"@ainame/xcodeproj-cli@0.2.2","gitHead":"7474f1364f6ed4613ef0ad023c28d3fab108a9fd","_nodeVersion":"20.19.3","_npmVersion":"10.8.2","dist":{"integrity":"sha512-h/j5f7lUyKwhIvq9D0R5QZsDvh7ugRNZsnFHN8R1HzNzSwFFxbYxmVj2ZQe5fbPIMR91Ncz2i9tdCjmq5G3mFg==","shasum":"a3b2b60d35c2cdbcb4b784bfcddacde3e937ce1c","tarball":"https://registry.npmjs.org/@ainame/xcodeproj-cli/-/xcodeproj-cli-0.2.2.tgz","fileCount":5,"unpackedSize":17019,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIEozVy27/YyiBxhwYZ2W6Prxi0kvPND3mXUVzb/rXGQtAiA5M2JOgVvm140jY6WThGcwEJvaG9Gzt9No97yXGVjwkA=="}]},"_npmUser":{"name":"ainame","email":"s.namai.09@gmail.com"},"directories":{},"maintainers":[{"name":"ainame","email":"s.namai.09@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/xcodeproj-cli_0.2.2_1753139512092_0.5627326558473285"},"_hasShrinkwrap":false}},"time":{"created":"2025-07-21T22:25:05.568Z","modified":"2025-07-21T23:11:52.485Z","0.2.1":"2025-07-21T22:25:05.850Z","0.2.2":"2025-07-21T23:11:52.293Z"},"bugs":{"url":"https://github.com/ainame/xcodeproj-cli/issues"},"author":{"name":"ainame"},"license":"MIT","homepage":"https://github.com/ainame/xcodeproj-cli","keywords":["xcode","xcodeproj","ios","macos","swift","build","cli"],"repository":{"type":"git","url":"git+https://github.com/ainame/xcodeproj-cli.git"},"description":"Command-line tool for manipulating Xcode project files","maintainers":[{"name":"ainame","email":"s.namai.09@gmail.com"}],"readme":"# xcodeproj CLI\n\nA command-line tool for manipulating Xcode project files (.xcodeproj) using Swift. This tool provides comprehensive functionality to create, modify, and manage Xcode projects programmatically. This is especially handy when writing code with coding agent such as Claude Code, Gemini CLI, or Codex.\n\n## Motivation\n\nThis project was inspired by a [YouTube video](https://youtu.be/nfOVgz_omlU?si=WqrwS-kxpN9dUbkb&t=1118) that recommended using  command-line tools instead of Model Context Protocol (MCP) servers for certain workflows. While MCP servers can take advantage of context and are excellent for interactive use, CLI tools offer distinct advantages:\n\n- **Speed and Efficiency**: CLI tools start instantly without server overhead\n- **User-Friendly**: Simple, straightforward command syntax\n- **Agent-Friendly**: Perfect for use with AI coding agents that can quickly execute commands\n- **No Context Dependency**: Each command is self-contained and explicit\n- **Automation-Ready**: Easy to integrate into scripts, CI/CD pipelines, and development workflows\n\nBy converting the functionality from an MCP server to a standalone CLI, we get the best of both worlds: the comprehensive Xcode project manipulation capabilities with the speed and simplicity that developers expect from command-line tools.\n\n## Features\n\n### Core Operations\n- **create** - Create new Xcode projects with custom configuration\n- **list-targets** - List all targets in a project\n- **list-build-configurations** - List all build configurations\n- **list-files** - List files in specific targets\n- **get-build-settings** - Retrieve build settings for targets\n\n### File Management\n- **add-file** - Add files to projects and targets\n- **remove-file** - Remove files from projects\n- **move-file** - Move or rename files within projects\n- **create-group** - Create groups in the project navigator\n\n### Target Management\n- **add-target** - Create new targets with various product types\n- **remove-target** - Remove existing targets\n- **duplicate-target** - Duplicate targets with all configurations\n- **add-dependency** - Add dependencies between targets\n\n### Build Configuration\n- **set-build-setting** - Modify build settings for targets\n- **add-framework** - Add system and custom framework dependencies\n- **add-build-phase** - Add custom run-script and copy-files build phases\n\n### Swift Package Management\n- **list-swift-packages** - List all Swift Package dependencies\n- **add-swift-package** - Add Swift Package dependencies with version requirements\n- **remove-swift-package** - Remove Swift Package dependencies\n\n## Installation\n\n### npm\n\nCross-platform installation for any environment:\n\n```bash\nnpm install -g @ainame/xcodeproj-cli\n```\n\n**Supported platforms:**\n- **macOS**: Intel (x64) and Apple Silicon (arm64)  \n- **Linux**: x86_64 and aarch64 (ARM64)\n\nPerfect for CI/CD pipelines, Docker containers, AI coding assistants, and development machines. The appropriate binary is automatically downloaded during installation.\n\n### Homebrew (macOS only)\n\n```bash\nbrew tap ainame/xcodeproj-cli https://github.com/ainame/xcodeproj-cli\nbrew install xcodeproj\n```\n\n### Build from Source\n\n<details>\n\n```bash\ngit clone https://github.com/ainame/xcodeproj-cli.git\ncd xcodeproj-cli\nswift build -c release\n\n# Option 1: Copy to a directory in your PATH\ncp .build/release/xcodeproj /path/to/your/bin/\n\n# Option 2: Add to PATH in your shell profile\necho 'export PATH=\"$PATH:/path/to/xcodeproj-cli/.build/release\"' >> ~/.zshrc\nsource ~/.zshrc\n\n# Option 3: Create an alias\necho 'alias xcodeproj=\"/path/to/xcodeproj-cli/.build/release/xcodeproj\"' >> ~/.zshrc\nsource ~/.zshrc\n```\n\n</details>\n\n## Usage\n\n### Basic Commands\n\n```bash\n# Create a new Xcode project\nxcodeproj create MyApp --organization-name \"My Company\" --bundle-identifier \"com.mycompany.myapp\"\n\n# List all targets in a project\nxcodeproj list-targets MyApp.xcodeproj\n\n# Add a file to a target\nxcodeproj add-file MyApp.xcodeproj MyApp Sources/NewFile.swift\n\n# Create a new target\nxcodeproj add-target MyApp.xcodeproj MyFramework framework com.mycompany.myframework\n\n# Add a dependency between targets\nxcodeproj add-dependency MyApp.xcodeproj MyApp MyFramework\n\n# Add a framework dependency\nxcodeproj add-framework MyApp.xcodeproj MyApp UIKit\n\n# Add a Swift Package dependency\nxcodeproj add-swift-package MyApp.xcodeproj https://github.com/apple/swift-argument-parser \"from: 1.0.0\" --target-name MyApp\n\n# Set build settings\nxcodeproj set-build-setting MyApp.xcodeproj MyApp SWIFT_VERSION 5.9\n\n# Add a run script build phase\nxcodeproj add-build-phase run-script MyApp.xcodeproj MyApp \"SwiftLint\" \"swiftlint\"\n\n# Duplicate a target\nxcodeproj duplicate-target MyApp.xcodeproj MyApp MyApp-Staging --new-bundle-identifier com.mycompany.myapp.staging\n```\n\n### Advanced Usage\n\n#### Swift Package Version Requirements\n\nThe tool supports various Swift Package version requirement formats:\n\n```bash\n# Exact version\nxcodeproj add-swift-package MyApp.xcodeproj https://github.com/realm/realm-swift \"10.45.0\"\n\n# From version (up to next major)\nxcodeproj add-swift-package MyApp.xcodeproj https://github.com/realm/realm-swift \"from: 10.0.0\"\n\n# Up to next minor version\nxcodeproj add-swift-package MyApp.xcodeproj https://github.com/realm/realm-swift \"upToNextMinor: 10.45.0\"\n\n# Branch reference\nxcodeproj add-swift-package MyApp.xcodeproj https://github.com/realm/realm-swift \"branch: main\"\n\n# Specific revision\nxcodeproj add-swift-package MyApp.xcodeproj https://github.com/realm/realm-swift \"revision: abc123\"\n```\n\n#### Build Phase Management\n\nAdd custom build phases with various types:\n\n```bash\n# Run script build phase\nxcodeproj add-build-phase run-script MyApp.xcodeproj MyApp \"Code Generation\" \"scripts/generate_code.sh\"\n\n# Copy files build phase\nxcodeproj add-build-phase copy-files MyApp.xcodeproj MyApp \"Copy Resources\" resources --files config.plist assets.bundle\n```\n\n### Getting Help\n\n```bash\n# General help\nxcodeproj --help\n\n# Command-specific help\nxcodeproj create --help\nxcodeproj add-swift-package --help\n```\n\n## Development\n\n### Testing\n\nRun test:\n\n```bash\nscripts/test.sh\n```\n\n## Contributing\n\nContributions are welcome! Please feel free to submit issues, feature requests, or pull requests.\n\n### Requirements\n\n- Swift 6.1+ and Xcode 16.4+ (for building from source)\n- Universal binary supports both Apple Silicon and Intel Macs\n\n## License\n\nThis project is available under the MIT License. See the LICENSE file for more details.\n\n## Acknowledgments\n\nThis project builds upon the excellent work of these open-source projects and their contributors:\n\n- **[giginet/xcodeproj-mcp-server](https://github.com/giginet/xcodeproj-mcp-server)** - Created by @giginet, this Model Context Protocol (MCP) server provided the initial inspiration and reference implementation for many of the commands in this CLI tool. The MCP server's comprehensive feature set and well-structured codebase served as an excellent foundation for porting functionality to a standalone command-line interface.\n- **[tuist/XcodeProj](https://github.com/tuist/XcodeProj)** - The foundational library that enables reading, updating, and writing Xcode project files. Created and maintained by the Tuist team, this library provides the core functionality that makes xcodeproj CLI possible.\n","readmeFilename":"README.md"}