Demo of symfony/console features to build rich command line utilities

Overview

Symfony Console Demo

This project is a demonstration of symfony/console features.

To run the project with Docker.

With bash:

docker build -t myconsole . && docker run -it --rm myconsole bash -l

Or with fish:

docker build -t myconsole . && docker run -it --rm myconsole fish -l

Examples

Progress Bar

Progress Bar

See example FarmingCommand

Interactive questions

Commands can be interactive: ask questions.

The best practice is to define all arguments and options, so that the command can be used without interaction, and ask for all missing values in Command::interact. This is the last place where you can ask for missing options/arguments before validation.

See example AskColorCommand

Also, Symfony Demo's AddUserCommand

Secret Input

Read stdin

"Make every program a filter" is the last precept of the UNIX Philosophy by Mike Gancarz. A filter is a program that gets most of its data from stdin and writes its main results to stdout.

STDIN is an always open stream of input data that can be used inside commands. But this needs to be wrapped into the StreamableInputInterface::getStream for testing.

$stdin = ($input instanceof StreamableInputInterface ? $input->getStream() : null) ?? STDIN;

See example HeadCommand.

Render table

Hyperlinks

Rendering clickable hyperlinks is one of the most important missing features of Console apps and commands. Although most of the terminal emulators auto-detect URLs and allow to click on them with some key combination, it's not possible to render clickable text that points to some arbitrary URL.

See example ReleasesCommand

Signal

Signals are an inter-process communication mechanism used by console commands. A signal is an asynchronous notification sent to a process (or to a specific thread within the same process) in order to notify it of an event that occurred. For example, when you press Ctrl + C in a command, the operating system sends the SIGINT signal to it.

See example SignalCommand

Lock

Symfony Style or Custom Style

Using option resolver

You might also like...
Command line of the website.
Command line of the website.

Deutsch English Svenska Command 0.8.42 Command line of the website. How to use the command line Open a terminal window. Go to your installation folder

RRR makes structured data for WordPress really rich, and really easy.
RRR makes structured data for WordPress really rich, and really easy.

Really Rich Results - JSON-LD Structured Data (Google Rich Results) for WordPress Search engines are putting more weight on structured data than ever

Simple Symfony currency exchange demo application (CLI)

Symfony currency exchange demo Keynotes Using a small Symfony installation as possible Using SQLite database for simplicity but with price of some cav

Messaging solutions for PHP - It contains advanced features build on top of a transport component

It contains advanced features build on top of a transport component. Client component kind of plug and play things or consumption component that simplify message processing a lot. Read more about it in documentation.

A set of utilities for working with vk api!

vk-utils Документация на русском языке Installation composer require labile/vk-utils How to use it? Simple example use Astaroth\VkUtils\Client; $api

Open-source library used in Gigadrive projects with common PHP utilities

PHP Commons This library provides PHP utilities used in Gigadrive projects, provided for the open-source community. Functions are registered globally

This is php utilities

PHP-UTILITY This is php utilities. Requirements PHP = 7.4 Curl extension for PHP7 must be enabled. Download Using Composer From your project director

Magento-bulk - Bulk Import/Export helper scripts and CLI utilities for Magento Commerce

Magento Bulk Bulk operations for Magento. Configuration Copy config.php.sample to config.php and edit it. Product Attribute Management List All Attrib

This library provides a collection of native enum utilities (traits) which you almost always need in every PHP project.

This library provides a collection of native enum utilities (traits) which you almost always need in every PHP project.

Owner
Jérôme Tamarelle
Lead Dev @PrismaMedia (Gala, Télé-Loisirs, Voici) // Je recrute ! // @Symfony core team
Jérôme Tamarelle
A collection of command-line utilities to aid in debugging browser engines.

Browser debug utilities This project contains several scripts that make the process of debugging browser engines much easier (some special cases excep

Clay Freeman 5 May 29, 2023
Utilities for the Contentful Rich Text

rich-text.php This library is built to help you with the parsing and rendering of the rich text field type in Contentful. It requires PHP 7.2 and up o

Contentful 8 Oct 1, 2022
Build lightning-fast and feature-rich websites with ProcessWire.

WIREKIT Core Build lightning-fast and feature-rich websites with ProcessWire. Website: wirekit.dev (in plans) Demo: start.wirekit.dev/core/ Updates: W

Ivan Milincic 10 Nov 3, 2022
Laravel Plans is a package for SaaS apps that need management over plans, features, subscriptions, events for plans or limited, countable features.

Laravel Plans Laravel Plans is a package for SaaS apps that need management over plans, features, subscriptions, events for plans or limited, countabl

ángel 2 Oct 2, 2022
The swiss army knife for Magento developers, sysadmins and devops. The tool provides a huge set of well tested command line commands which save hours of work time. All commands are extendable by a module API.

netz98 magerun CLI tools for Magento 2 The n98 magerun cli tools provides some handy tools to work with Magento from command line. Build Status Latest

netz98 758 Dec 28, 2022
m4b-tool is a command line utility to merge, split and chapterize audiobook files such as mp3, ogg, flac, m4a or m4b

m4b-tool m4b-tool is a is a wrapper for ffmpeg and mp4v2 to merge, split or and manipulate audiobook files with chapters. Although m4b-tool is designe

Andreas 798 Jan 8, 2023
Tango is a command-line tool for analyzing access logs 💃

Tango Tool to get insights from the server access logs Tango is a dependency-free command-line tool for analyzing access logs ?? Currently, work on th

Roman Glushko 94 Nov 22, 2022
TrovCMS command line installer.

Trov CMS Installer TrovCMS is a start kit for websites, built on Filament and Laravel. This install allows you to quickly spin up new sites to hit the

TrovCMS 12 Dec 26, 2022
🎮 A simple command line tool for installing and interacting with your leaf apps

Leaf CLI 2 A simple command line tool for creating and interacting with your leaf projects. You can do stuff like installing packages, interacting wit

Leaf Framework 7 Aug 24, 2022
Rugby schedules on the command-line

Rugby Schedule Rugby Schedule is a command-line tool that keeps you up to date with rugby tournament schedules. Install Requires PHP 8.0 or later Via

Owen Voke 0 Mar 17, 2022