Skeletor

A simple universal project skeleton generator

#FORK ME ON GITHUB

Introduction

Skeletor is a universal project skeletor generator.

Skeletor is for those people that create new projects on a regular basis and often find themselves wasting time copying / writing boilerplate code.

Installation

Install the phar and the public key (required for self updates)

curl -o skeletor.phar https://dantleech.github.io/skeletor/skeletor.phar
curl -o skeletor.phar.pubkey https://dantleech.github.io/skeletor/skeletor.phar.pubkey

Now make the PHAR executable and maybe you want to move it somewhere in your path:

chmod a+x skeletor.phar
sudo mv skeletor.phar /usr/local/bin/skeletor
sudo mv skeletor.phar.pubkey /usr/local/bin/skeletor.pubkey

Generate a project

First you need to install a project template:

skeletor install dantleech/phplib.skel

Then you can generate a project interactively:

skeletor generate

Creating your own repositories

The easiest way to start is probably just to fork an existing repository

The configuration

Your repository should have a skeletor.json file in its project root:

{
    "title": "title for this skeleton",
    "description": "description for this skeleton",
    "params": {
        "param1": "default value 1",
        "param2": "default value 2",
        "file-name": "foobar"
    },
    "basedir": "skeletor",
    "files": {
        "lib": {
            "type": "dir"
        },
        "tests": { 
            "type": "dir"
        },
        "lib/my-dynamic-file.txt": {
            "type": "file",
            "path": "lib/myfile.txt",
            "dest": "lib/{{ file-name }}.txt"
        }
        "LICENSE": {}
        "lib/myfile.txt": {}
    },
    "post_install": [
        "copmoser require phpunit/phpunit"
    ]
}

Your directory structure should look like this:

/
  skeletor/
    lib/
      myfile.txt
      foobar.txt
    LICENSE
  skeletor.json

Note that in the configuration:

File types

Each file can have a type:

Both file and template types can have a dest key which can be tokenized.

Templates

Files defined with a template type should look something like this:

Hello {{ author.name }}
This is an example template, that was created in {{ date.year }}.

Standard parameters

The following parameters are automatically available:

Wisdom

Skeletor can also provide wisdom:
skeletor wisdom
skeletor wisdom -r

Changelog