{"id":20214234,"url":"https://github.com/masterminds/fortissimo-cli-base","last_synced_at":"2026-03-27T04:25:28.749Z","repository":{"id":4049151,"uuid":"5151522","full_name":"Masterminds/Fortissimo-CLI-Base","owner":"Masterminds","description":"A skeleton for creating Fortissimo CLI applications.","archived":false,"fork":false,"pushed_at":"2012-12-12T15:36:14.000Z","size":120,"stargazers_count":11,"open_issues_count":0,"forks_count":3,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-24T12:48:02.980Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Masterminds.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-07-23T12:34:22.000Z","updated_at":"2019-07-06T18:19:03.000Z","dependencies_parsed_at":"2022-09-03T02:21:23.606Z","dependency_job_id":null,"html_url":"https://github.com/Masterminds/Fortissimo-CLI-Base","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Masterminds%2FFortissimo-CLI-Base","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Masterminds%2FFortissimo-CLI-Base/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Masterminds%2FFortissimo-CLI-Base/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Masterminds%2FFortissimo-CLI-Base/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Masterminds","download_url":"https://codeload.github.com/Masterminds/Fortissimo-CLI-Base/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248232171,"owners_count":21069475,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-14T06:14:44.954Z","updated_at":"2026-03-27T04:25:28.691Z","avatar_url":"https://github.com/Masterminds.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Fortissimo CLI Base\nThis is a skeleton project for building CLI applications using [PHP](http://php.net), [Fortissimo](http://github.com/Masterminds/Fortissimo), and [Composer](http://getcomposer.org).\n\nFortissimo is a chain-of-command based framework. This means you create reusable configurable parts called command containing some logic. Each callback (in the case of a CLI application we have CLI commands) executes a chain of these commands. Different callbacks can share commands. Yeah, I know this is a little abstract. More real world examples coming soon.\n\n## Using the Skeleton\nThere are two ways you get started using this skeleton project. The simplest is to use `composer create-project` in a manner like:\n\n    \u003e composer create-project masterminds/fortissimo-cli-base foo-project-name\n\nThis will get you right up and going. Alternately you can grab this project right out of git. Then from the root of the project run `composer install` to install all the project dependencies. You should also update the `composer.json` file to include any dependencies of your own and add your psr-0 config component for autoloading.\n\n## The Project Structure\nThis project is structured so you can hit the ground running. The usage expectation is the following:\n\n### The src directory\nThis is where all your custom code should go. Ideally it would be placed in here using a PSR-0 layout and the root composer.json file would be updated for this so you can use the composer autoloader.\n\n### The test directory\nThis is where tests for your code should go. Test driven development is a great practice, right?!?!\n\n### The bin directory\nThis directory contains a number of important files to get you right up and going.\n\n* _compile.php_ - This file is a Phar compiler. It takes the application here and compiles it into a Phar file so you can distribute this as one file. If you open this file and edit it you'll see a number of configurable options such as the name of the file, what files and folders to include, etc.\n* *_shared.php* - This file is the application script. This is shared between the Phar and non-Phar execution version. This is the file to update for the application. Out of the box this file should be about ready to use for most applications.\n* _app.php_ - This is the application execution script in a non-Phar form. This is what should be called in testing, etc. It sets up the environment for the file system before calling *_shared.php*.\n* *_phar.php* - This the Phar stub that works in a similar manner to *app.php*. The difference is this file sets up the environment for a Phar file before calling *_shared.php*.\n\nFor most applications only the *_shared.php* and *compile.php* files will need to be altered here and in most cases just for the custom name of the application.\n\n### The config directory\nI tend to think of the chain-of-command pattern like piping in PHP. Something like Yahoo Pipes but coded in PHP. This is where the chains are configured.\n\nWhen the application bootstraps it includes each of the PHP files in this directory in alphabetical order to load the config options. The initial file 000-init.php is named so it is included first. This does some initial setup.\n\nIn files in this directory you write chains of commands. More detail and some examples coming soon.\n\n## Compiling A Phar\nWho wants a CLI application that's really a bunch of files and you have to call to some internal file? Not me. I prefer things with nice simple names and one file I can distribute. PHP Phar files let us do this as they can contain an entire project in a single file.\n\nTo execute these Phar files you'll need PHP and any dependencies on your operating system. Working on a Mac, everything I need is already bundled and available on that system.\n\nOnce you are ready to convert you application into a single file open up `bin/compile.php` so that it contains the name and proper location for your application. Then execute this file with `php bin/compile.php` and it will generate a Phar file for you.\n\nLike composer these files can be run with php in fort of them or as self executing files.\n\n_Naming note: I often see phar files have the extension .phar. This is optional. You can create phar files with no extension and all. This along with self execution means you could write a CLI app like `AwesomeSauce` and just call that from the CLI. How you do this is entirely up to you. I'm just saying there are options._\n\n## License\nThis project is licensed under the MIT License.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasterminds%2Ffortissimo-cli-base","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmasterminds%2Ffortissimo-cli-base","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmasterminds%2Ffortissimo-cli-base/lists"}