PHPackages                             tarsana/command - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. tarsana/command

ActiveLibrary[CLI &amp; Console](/categories/cli)

tarsana/command
===============

A framework to build command line applications and share them with the world

2.0.0(5y ago)1677859[1 PRs](https://github.com/tarsana/command/pulls)1MITPHPPHP &gt;=7.3CI failing

Since Sep 3Pushed 3y ago7 watchersCompare

[ Source](https://github.com/tarsana/command)[ Packagist](https://packagist.org/packages/tarsana/command)[ RSS](/packages/tarsana-command/feed)WikiDiscussions master Synced yesterday

READMEChangelog (7)Dependencies (4)Versions (10)Used By (1)

Tarsana Command
===============

[](#tarsana-command)

[![Build Status](https://camo.githubusercontent.com/ec8200611984f2086d23e3f73cbf3c2f605c9a4be7622f194f5b10fc226435f7/68747470733a2f2f7472617669732d63692e6f72672f74617273616e612f636f6d6d616e642e7376673f6272616e63683d6d6173746572)](https://travis-ci.org/tarsana/command)[![Coverage Status](https://camo.githubusercontent.com/ef95cbef967b29d57ffc68ba92456f552f88c679bdd19dae744db94f64ed126e/68747470733a2f2f636f766572616c6c732e696f2f7265706f732f6769746875622f74617273616e612f636f6d6d616e642f62616467652e7376673f6272616e63683d6d6173746572)](https://coveralls.io/github/tarsana/command?branch=master)[![Code Quality](https://camo.githubusercontent.com/0852dce95912fabb0eba9e787f5e61543de36d7f5db2be6845e41dc1d31419e6/687474703a2f2f63616e6c6c702e63612f7363727574696e697a65722f7175616c6974792f672f74617273616e612f636f6d6d616e64)](https://scrutinizer-ci.com/g/tarsana/command)[![Donate](https://camo.githubusercontent.com/604e3db9c8751116b3f765aad0353ec7ded655bbe8aaacbc38d8c4a6b784b3ed/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f446f6e6174652d50617950616c2d677265656e2e737667)](https://www.paypal.me/webneat)[![Software License](https://camo.githubusercontent.com/f251623e510f5909f16ae3f4e6e548dac11340b9fde1a99be26b015b39272c00/68747470733a2f2f696d672e736869656c64732e696f2f62616467652f6c6963656e73652d4d49542d627269676874677265656e2e7376673f7374796c653d666c6174)](https://github.com/tarsana/command/blob/master/LICENSE)

A library to build command line applications using PHP. This is part of the [Tarsana Project](https://github.com/tarsana/specs).

Table of Contents
=================

[](#table-of-contents)

- [Installation](#installation)
- [Your First Command](#your-first-command)
- [Initializing The Command](#initializing-the-command)
- [Showing The Help And Version Of A Command](#showing-the-help-and-version-of-a-command)
- [Reading &amp; Writing to The Console](#reading--writing-to-the-console)
- [Defining Arguments and Options](#defining-arguments-and-options)
- [Reading Arguments and Options Interactively](#reading-arguments-and-options-interactively) **Since version 1.1.0**
- [Handeling The Filesystem](#handeling-the-filesystem)
- [Loading Configuration](#loading-configuration) **New on version 1.2.0**
- [Rendering Templates](#rendering-templates)
- [Adding SubCommands](#adding-sub-commands)
- [Testing Commands](#testing-commands)
- [What's Next](#whats-next)
- [Development Notes](#development-notes)

Installation
============

[](#installation)

Install it using Composer

```
composer require tarsana/command

```

Your First Command
==================

[](#your-first-command)

Let's write a "Hello World" command. Create a file `hello.php` with the following content:

```
