Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
notes about phar-composer

phar-composer example

Create a composer dir called pgit

Create a composer.json file inside this dir containing:

    "require": {
        "diversen/minimal-cli-framework": "^1.1"
    "bin": [

Create a pgit file inside the pgit dir, which should contain:

#!/usr/bin/env php

echo "hello world\n";

Build this using phar-composer (outside pgit dir)

phar-composer.phar build pgit

You now have an executable called


Execute it:


It should say: hello world

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment