Download the PHP package ajaxray/ansikit without Composer
On this page you can find all versions of the php package ajaxray/ansikit. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ajaxray/ansikit
More information about ajaxray/ansikit
Files in ajaxray/ansikit
Package ansikit
Short Description Tiny ANSI escape helper for terminal UIs (text styles, foreground & background colors, cursor positions, clearing) with table, progressbar, and more helpers.
License MIT
Informations about the package ansikit
AnsiKit
Tiny, easy-to-remember ANSI escape helper for building terminal UIs in PHP. Chainable API for styles/colors/cursor control, with a few handy components and utilities.
Works on any terminal that supports ANSI escapes (most modern terminals on macOS/Linux and Windows Terminal/ConEmu on Windows 10+).
Let's keep simple things simple. 😌
You don't need a whole framework to build a simple CLI app.
Why Choose AnsiKit?
Zero dependencies, PSR-12 with strict types, and a beautiful chainable API. Perfect for small CLI tools, deployment scripts, or any terminal-based app where you need style without the weight.
Features
🎨 Text Styling
- Standard 8/16 colors, 256-color palette, and truecolor (RGB, 24-bit)
- Bold, dim, italic, underline, inverse, hidden, strike-through styles
- Easy reset and chaining
📊 UI Components
- Table - Beautiful tables with borders and alignment
- Banner - Eye-catching banners for messages
- Progressbar - Progress tracking with customizable styles
- Spinner - Animated spinners for loading states
- Choice - Interactive selection prompts
- Panel - Flexible container layouts (vertical/horizontal) with borders and dividers
- PanelBlock - Individual content blocks that can be nested or standalone
⌨️ Input & Interactivity
- Input helpers - Line, multiline, and confirm prompts
- Keypress detection - Listen for arrow keys, ENTER, ESC, TAB, modifiers, and more
🎯 Cursor Control
- Move cursor to any position
- Save/restore cursor state
- Show/hide cursor
- Alternate screen buffer support
🛠️ Utilities
- ANSI-aware string length and stripping
- Memory writer for testing
- Tab title and bell helpers
See It In Action
Quick Start
Documentation
Core API
- AnsiTerminal - Styles, colors, cursor control
Components
- Table - Data tables with borders
- Banner - Message banners
- Progressbar - Progress tracking
- Spinner - Loading animations
- Choice - Interactive selection
- Panel - Container layouts with borders and dividers
- PanelBlock - Nested or standalone content blocks
Helpers
- Input - User input helpers
- Keypress - Keyboard event handling
- Str - ANSI-aware string utilities
- Util - Terminal helpers
More Examples
Compatibility
- PHP: >= 8.2
- Terminals: macOS/Linux native, Windows 10+ with Windows Terminal/ConEmu
- Fonts: Monospaced fonts recommended for best alignment
On Windows, ensure VT processing is enabled for ANSI sequences.
Contributing
Contributions are welcome! Please see CONTRIBUTING.md for guidelines.
License
MIT License — see LICENSE
Made with ❤️ for terminal builders. If you ship something with AnsiKit, I'd love to hear about it!