- How do I use OmniTerm in a Laravel Artisan command?
- Add the `HasOmniTerm` trait to your command class. Then use methods like `$this->omni->success('Message')` or `$this->omni->table(['data'])` to render styled output. The trait injects the OmniTerm instance automatically.
- Does OmniTerm support Laravel 13?
- Yes, OmniTerm explicitly supports Laravel 11, 12, and 13. Check the [GitLab repo](https://gitlab.com/pdphilip/omniterm) for the latest version compatibility. PHP 8.2+ is required.
- Can I use custom colors like RGB or gradients?
- Absolutely. OmniTerm supports arbitrary RGB classes like `text-[255,0,0]` and gradients via `bg-gradient-to-r from-red-500 via-yellow-300 to-green-400`. It also auto-falls back to 256-color mode if truecolor isn’t supported.
- How do I test OmniTerm in PHPUnit/Pest?
- Use Pest’s `expectOutput()` or PHPUnit’s `expectOutputString()` with terminal emulation. For complex layouts, mock the ANSI output or verify rendered strings. Example: `expectOutput()->toContain('✅ Ready');`
- Will OmniTerm work in production terminals like iTerm2 or Windows Terminal?
- Yes, OmniTerm auto-detects terminal capabilities. Truecolor (16M colors) works in modern terminals, while older ones fall back to 256-color mode. Test your target environments to ensure compatibility.
- Can I integrate OmniTerm with Blade templates?
- Yes, OmniTerm supports Blade templates for reusable CLI views. Use `@omni('view.name', ['data'])` in your command’s `render()` method to render dynamic content with Tailwind-like syntax.
- What’s the performance impact of using OmniTerm?
- Minimal. ANSI generation is lightweight, but complex layouts (e.g., large tables) may introduce slight overhead. Benchmark in your specific use case—OmniTerm is optimized for readability over raw speed.
- Are there alternatives to OmniTerm for Laravel CLI styling?
- Yes, alternatives include Termwind (simpler, no gradients/RGB), Symfony Console (native but verbose), or custom ANSI scripts. OmniTerm stands out with Tailwind-like syntax, truecolor, and built-in components for Laravel.
- How do I create custom components or extend OmniTerm?
- Extend the `OmniTerm` class or create Blade views. Override the `render()` method to parse custom HTML/Tailwind classes. For reusable components, publish Blade templates via `omni:publish` (if supported).
- Does OmniTerm support live updates (e.g., progress bars) without full terminal redraws?
- Yes, use `$this->omni->liveView()` or `$this->omni->progressBar()` methods. These update only the necessary parts of the terminal, preserving state. Works well for real-time tasks like file processing or API calls.