Skip to content

Manage Xcode templates and code snippets using command line

License

Notifications You must be signed in to change notification settings

josefdolezal/xcman

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

Install

Brew
$ brew tap josefdolezal/formulae
$ brew install xcman
Compiling from source
$ git clone https://github.com/josefdolezal/xcman.git
$ cd xcman
$ swift build

Usage

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

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

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.

Dependencies

This tool is build on top following dependencies:

License

This repository is licensed under MIT.

About

Manage Xcode templates and code snippets using command line

Resources

License

Stars

Watchers

Forks

Packages

No packages published