From 124377ccf5d1704e2f1e436b2a644e4495a775fe Mon Sep 17 00:00:00 2001 From: Hafiz Muhammad Moaz Date: Fri, 28 Aug 2026 03:42:28 +0500 Subject: [PATCH] docs: replace boilerplate README intro with real component overview (fixes #5) --- README.md | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 414fafa..df1a34c 100644 --- a/README.md +++ b/README.md @@ -5,9 +5,31 @@ Webisters CLI Library This library is designed for reuse in Composer-based PHP applications. ## What It Provides -- Command-line friendly workflows for local automation and maintenance tasks. -- Reusable PHP components intended for integration into larger applications. -- Clean interfaces and extension points to support maintainable implementations. + +A lightweight PHP library for building command line applications. It has three core components: + +### `Framework\CLI\CLI` +A static toolkit for terminal output and input: +- `write()`, `style()`, `success()`, `info()`, `error()`, `box()`, `newLine()` for formatted output with optional `Framework\CLI\Styles\ForegroundColor`, `BackgroundColor` and `Format` styling +- `progress()`, `spinner()`, `liveLine()` for live terminal feedback +- `prompt()`, `getInput()`, `secret()` for reading user input +- `table()` for rendering tabular data +- `getWidth()`, `wrap()`, `strlen()`, `clear()`, `beep()` and terminal helpers +- ANSI control with `setAnsi()` and quiet mode with `setQuiet()` +- Signal handling with `onSignal()`, `onSigint()` and `restoreSignal()` when pcntl is available + +### `Framework\CLI\Command` +The abstract base class for every console command. Extend it and implement `run()`: +- `$name`, `getDescription()`, `setGroup()`, `setUsage()` and `setAliases()` describe the command and its help output +- `getOptions()` defines the options a command accepts +- `activate()` / `deactivate()` control availability + +### `Framework\CLI\Console` +Discovers, registers and runs commands: +- `addCommand()` / `addCommands()` accept Command instances or class names +- `run()` parses argv, matches the requested command (including aliases) and dispatches to `exec()` +- Unknown commands fall back to `Index` (which lists available commands) and suggest the closest matching command name +- `getArgument()`, `getArguments()`, `getOption()` and `getOptions()` expose the parsed command line ## Installation ```bash