Skip to content

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

License

Notifications You must be signed in to change notification settings

wojciech-kulik/XcodeProjectCLI

Repository files navigation

GitHub Release min macOS CI Status codecov

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 library from Tuist.

🚀 Features

OVERVIEW: XcodeProjectCLI

USAGE: xcp <subcommand>

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 <subcommand>' for detailed help.

📦 Installation

brew install wojciech-kulik/tap/xcp

🛠️ Building from Source

  1. Clone the repository.

  2. Navigate to the project directory.

  3. Build the project and install:

    make install
  4. Verify the installation:

    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:

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

About

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

Topics

Resources

License

Stars

Watchers

Forks

Sponsor this project

 

Languages