titasgailius/terminal
A lightweight PHP package for building and running terminal commands. Compose commands with a fluent API, execute processes, stream output, handle timeouts and exit codes, and run tasks cross-platform—ideal for artisan tools, deploy scripts, and CI automation.
exec(), shell_exec()), reducing technical debt and maintenance overhead.Adopt when:
Look elsewhere if:
git pull call) and don’t need a fluent API.proc_open()) are critical.For Executives:
"This package replaces fragile, error-prone shell command calls with a safe, testable, and maintainable API—reducing bugs in CLI-dependent workflows (e.g., deployments, data pipelines) by 30–50%. It’s like upgrading from exec() spaghetti to a structured, mockable SDK, cutting debugging time and improving reliability. Low risk: drop-in replacement for ad-hoc shell calls, with zero performance overhead."
For Engineers: *"Say goodbye to:
exec() hell (e.g., parsing stdout/stderr manually, handling exit codes).This gives you a fluent, Laravel-friendly way to run commands with: ✅ Automatic argument escaping (no more injection risks). ✅ Structured output (stdout/stderr separation, exit codes). ✅ Timeouts, env vars, and working dirs out of the box. ✅ Testability—mock commands in unit tests like any other dependency.
Example use cases:
docker-compose calls in a deployment service.git or aws output in background jobs.Migration effort: Replace 3–5 lines of exec() with a clean, documented API. Worth it."*
How can I help you explore Laravel packages today?