Home

Awesome

CLITool Boilerplate

Simple boilerplate for build your command line tool.

Requirement

Installation

composer create-project jaceju/clitool-boilerplate myapp -s dev

Change application information

Change the constants below in src/App/Application.php:

    const NAME = 'App';
    const BIN_NAME = 'app';
    const REPOSITORY = 'vendor-name/app-repository';

Rename output phar in box.json:

    "output": "bin/app.phar",

Finally, change the name, description, authors and scripts in composer.json.


Here is a example of README.md below for authors of the package. I suppose package name is app in this example.

You can remove all description above and this line.

App

Requirement

Installation

Add ~/.composer/vendor/bin/ to PATH environment variable first. Then can install the package by:

composer global require vendor-name/app-repository

And app command should be executable.

Build executable phar

You can build the phar file by:

composer build

Self Updating

Update app to latest version:

app self-update

Zsh auto-completion

You can create an auto-completion of app for zsh by:

app zsh --bind app > ~/.zsh/app

Then add the line below to your .zshrc file:

source ~/.zsh/app

Same steps as above in bash auto-completion.

Powered by

License

MIT