xcman
is an command line tool written in Swift for managing Xcode file templates and code snippets.
Move from this:
$ git clone https://github.com/me/my-templates.git
$ cd my-templates
$ ./install
zsh: permission denied: ./install
$ chmod +x ./install
$ ./install
To this:
$ xcman templates install me/my-templates
Brew
$ brew tap josefdolezal/formulae
$ brew install xcman
Compiling from source
$ git clone https://github.com/josefdolezal/xcman.git
$ cd xcman
$ swift build
xcman
supports managing of both file templates and code snippets. These functions are namespaced using templates
and snippets
subcommands. Run the tool with --help
option to see documentation.
Templates are managed using caching git repositories inside your home directory. For each installed group of templates, new folder is created inside Xcode templates directory. This new folder contains links to your fetched git folder.
Supported commands:
install
$ xcman templates install [--use-url] [--name <name>] <repo>
Installs templates from given repository to Xcode. By default, given repository is interpreted as GitHub handle. If you would like to install from other source, use --use-url
flag. Templates group name visible in Xcode may configured using --name
option.
Examples:
# Install templates from GitHub repository with custom group name
$ xcman templates install --name "My Templates" me/my-templates
# Install templates from arbitrary url
$ xcman templates install --use-url https://gitlab.com/company/repo.git
list
$ xcman templates list
Lists all installed templates groups.
remove
$ xcman templates remove <group>
Removes given templates group from Xcode.
Snippets are managed similary as file templates using repository cache inside your home directory. Xcode currently does not support structured format for snippets, so the file system structure is flat.
install
$ xcman snippets install [--use-url] <repo>
Installs templates from given GitHub repository. By default, the repository argument is interpreted as GitHub handle. Use --use-url
to install templates from arbitrary git repository.
This tool is build on top following dependencies:
- Commander, licensed under BSD 3-Clause
This repository is licensed under MIT.