An open API service indexing awesome lists of open source software.

https://github.com/wojciech-kulik/XcodeProjectCLI

A lightweight command-line tool for managing Xcode projects, built entirely in Swift. Also available as a Swift Package.
https://github.com/wojciech-kulik/XcodeProjectCLI

cli swift xcode xcodeproj

Last synced: 1 day ago
JSON representation

A lightweight command-line tool for managing Xcode projects, built entirely in Swift. Also available as a Swift Package.

Awesome Lists containing this project

README

          

[![Homebrew Version](https://img.shields.io/homebrew/v/xcp?color=FBB03F&logo=homebrew)](https://formulae.brew.sh/formula/xcp)
[![SPM](https://img.shields.io/github/v/release/wojciech-kulik/XcodeProjectCLI?color=F05138&logo=swift&logoColor=white&label=SPM)](https://github.com/wojciech-kulik/XcodeProjectCLI/releases)
[![min macOS](https://img.shields.io/badge/macOS-13.0+-silver?logo=apple)](#)
[![CI Status](https://img.shields.io/github/actions/workflow/status/wojciech-kulik/XcodeProjectCLI/build-and-test.yml?logo=githubactions&logoColor=white)](https://github.com/wojciech-kulik/XcodeProjectCLI/actions/workflows/build-and-test.yml)
[![codecov](https://codecov.io/gh/wojciech-kulik/XcodeProjectCLI/graph/badge.svg?token=KYAVYEWYU6)](https://codecov.io/gh/wojciech-kulik/XcodeProjectCLI)

# XcodeProjectCLI

A fast, lightweight command-line tool for managing Xcode projects, built entirely in Swift.

Easily integrate it into your development workflow or automate complex refactoring tasks with just a few commands.

💚 Powered by the excellent [XcodeProj](https://github.com/tuist/XcodeProj) library from [Tuist](https://github.com/tuist).

## 🚀 Features

```
OVERVIEW: XcodeProjectCLI

USAGE: xcp

OPTIONS:
--version Show the version.
-h, --help Show help information.

TARGET SUBCOMMANDS:
list-targets List project targets.
set-target Set target for existing file.

GROUP SUBCOMMANDS:
add-group Add group.
delete-group Delete group.
move-group Move group.
rename-group Rename group.

FILE SUBCOMMANDS:
add-file Add file to specified targets.
delete-file Delete file.
move-file Move file.
rename-file Rename file.

BUILD SETTINGS SUBCOMMANDS:
get-build-setting Get build setting.
set-build-setting Set build setting.

ASSETS SUBCOMMANDS:
add-image-asset Add image asset.
add-data-asset Add data asset.
add-color-asset Add color asset.
list-assets List all assets.
move-asset Move asset.
delete-asset Delete asset.

See 'xcp help ' for detailed help.
```

## 📦 Installation

```bash
brew install xcp
```

## 🛠️ Building from Source

1. Clone the repository.
2. Navigate to the project directory.
3. Build the project and install:

```bash
make install
```

4. Verify the installation:

```bash
xcp --version
```

## ⚙️ Use as a Library

You can also use XcodeProjectCLI as a library in your macOS Swift projects, enabling you to create your own automations.

Here's a simple example of how to integrate it:

```swift
import XcodeProject

let projectPath = "/path/to/YourProject.xcodeproj"
let xcodeProject = try Project(xcodeProjectPath: projectPath)

// Sample operation:
try project.groups.addGroup("path/relative/to/xcodeproj/NewGroup".asInputPath)
try project.save()
```

## 🤓 My Other Projects

- [Snippety](https://snippety.app) - Snippets manager for macOS & iOS
- [FlashSpace](https://github.com/wojciech-kulik/FlashSpace) - Fast virtual workspace manager for macOS
- [Smog Poland](https://smog-polska.pl) - Air quality monitoring app for Poland
- [xcodebuild.nvim](https://github.com/wojciech-kulik/xcodebuild.nvim) - Neovim plugin for building Xcode projects

[xcodebuild.nvim]: https://github.com/wojciech-kulik/xcodebuild.nvim