pdphilip/omniterm
OmniTerm is a Laravel terminal UI toolkit that renders HTML + Tailwind-style classes into ANSI output. Includes truecolor with fallback, gradients, arbitrary RGB classes, and content-repeat fills, plus ready-made components like status messages, tables, progress bars, spinners, tasks, and a split-pa...
OmniTerm is a highly specialized CLI rendering engine for Laravel, designed to replace traditional Symfony Console output with HTML/Tailwind-like syntax rendered as ANSI escape sequences. Its architecture fits well in Laravel-centric applications where:
Key strengths:
Potential misfit:
| Aspect | Feasibility | Notes |
|---|---|---|
| Laravel Compatibility | High | Explicit support for Laravel 11/12/13; minimal version constraints. |
| Artisan Commands | High | Designed for HasOmniTerm trait integration into existing commands. |
| Symfony Console | Medium | Underlying Symfony Console components are used, but OmniTerm abstracts most of this. |
| Blade Templates | High | Seamless integration with Laravel’s view system for reusable CLI outputs. |
| Testing | Medium | Requires terminal emulation (e.g., Pest’s expectOutput() or custom test doubles). |
| Customization | High | Extensible via render()/parse() methods or custom Blade templates. |
Key dependencies:
| Risk Area | Severity | Mitigation |
|---|---|---|
| Terminal Compatibility | Medium | Test on target terminals (e.g., iTerm2, Windows Terminal, Linux xterm). Fallback to 256-color. |
| Performance Overhead | Low | ANSI generation is lightweight; benchmark in production-like CLI loops. |
| Breaking Changes | Low | Version 3.x dropped Laravel 10, but future changes are likely backward-compatible. |
| Learning Curve | Medium | Tailwind syntax may require adjustment for teams unfamiliar with CSS-in-JS-like patterns. |
| Debugging | Medium | Complex layouts may need ANSI escape sequence inspection (e.g., cat -v or less -R). |
| State Management | Low | Live updates (e.g., liveView()) require careful handling of terminal state. |
Critical questions for adoption:
Use Case Alignment:
Integration Strategy:
Testing:
Maintenance:
Alternatives:
symfony/console) meet needs with less overhead?OmniTerm is optimized for Laravel’s stack and integrates tightly with:
HasOmniTerm trait (minimal boilerplate).resources/views/cli/).OmniTerm instance.Non-Laravel compatibility:
OmniTerm to a container).Command class is tightly coupled).| Phase | Actions | Tools/Examples |
|---|---|---|
| Assessment | Audit existing CLI outputs (Artisan commands, scripts) for complexity. | Review artisan commands; categorize by output type (tables, progress, status). |
| Pilot | Replace 1–2 commands with OmniTerm (e.g., a migration or queue worker). | Use omniterm:status-messages or omniterm:progress-bars as templates. |
| Incremental Rollout | Migrate commands by output type: | |
- Status messages → success()/error() methods. |
||
- Progress bars → progressBar() fluent API. |
||
- Tables → tableHeader()/tableRow() methods. |
||
- Custom layouts → Blade templates + render(). |
||
| Blade Migration | Move static CLI outputs to Blade templates (e.g., resources/views/cli/). |
Example: Convert a hardcoded progress bar to a Blade file rendered via view(). |
| Testing | Test on all target terminals; verify fallbacks for 256-color. | Use Pest’s expectOutput() or custom terminal emulators. |
| Deprecation | Phase out legacy ANSI scripts/Console components. | Add deprecation warnings in old CLI code. |
Backward Compatibility:
| Component | Compatibility | Notes |
|---|---|---|
| Laravel 11/12/13 | Full | Explicit support; no configuration needed. |
| PHP 8.2+ | Full | Enums (e.g., Spinner) require PHP 8.2+. |
| Symfony Console | Partial | OmniTerm abstracts most Console features but relies on Laravel’s Artisan layer. |
| Blade Templates | Full | Seamless integration; can use Laravel’s view system. |
| Terminals | Partial | Truecolor preferred; 256-color fallback required for older terminals (e.g., Apple Terminal). |
| CI/CD Pipelines | Medium | May need terminal emulators (e.g., xvfb for headless Linux, GitHub Actions’ terminal env). |
Known Limitations:
migrate/rollback) → Use progressBar() and statusSuccess().queue:work) → Use liveTask() for realHow can I help you explore Laravel packages today?