A PHP library for building beautiful, interactive command-line menus with an expressive DSL.
CLI Menu is a PHP library that enables developers to build interactive, visually appealing command-line menus. It solves the problem of creating user-friendly terminal interfaces by providing a rich set of components like menus, dialogues, and inputs through an expressive domain-specific language (DSL).
PHP developers building command-line applications, tools, or scripts that require interactive user input, such as installation wizards, configuration tools, or administrative consoles.
Developers choose CLI Menu for its balance of simplicity and power—its fluent builder API makes basic menus easy, while advanced features like custom styling, sub-menus, and input validation support complex use cases without external dependencies.
🖥 Build beautiful PHP CLI menus. Simple yet Powerful. Expressive DSL.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Uses a fluent, chainable builder pattern that makes menu creation intuitive and code highly readable, as demonstrated in the quick setup example with clear method chaining.
Includes a wide range of item types such as checkboxes, radio buttons, sub-menus, and split items, enabling complex menu layouts without external dependencies, supported by extensive examples.
Offers fine-grained control over colors (including 256-color support), borders, padding, and margins, allowing for professional-looking interfaces that can match application branding, as shown in the custom styles examples.
Provides interactive dialogues and inputs with built-in validation for text, numbers, and passwords, reducing boilerplate code for user input handling, detailed in the inputs section.
Requires ext-posix, which can be a barrier on Windows or minimal PHP installations, limiting cross-platform compatibility without additional configuration or workarounds.
While basic menus are easy, advanced customization like custom inputs or complex styling requires implementing interfaces or deeper API knowledge, as seen in the custom input and styling sections.
Although it has integrations with Symfony Console and Laravel, it remains a standalone library, necessitating extra setup for seamless use within larger CLI frameworks compared to native solutions.