The most common usage of PHP is development of web applications. The PHP CLI SAPI - server application programming interface provides development of command line applications.
You can use PHP to write command-line applications as well.
Some useful libraries:
- Cilex - Light-weight framework for creating command-line applications
- CLImate
- Hoa\Console
- PHP Shell Framework
- Symfony Console Component
- Webmozart Console