Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Terminal Laravel Package

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.

View on GitHub
Deep Wiki
Context7
1.2.0
1.1.0
1.0.1

PHP 8 Support

To use Terminal with PHP 8.x, please upgrade Terminal to the ^1.0 version.

  1. Update your composer.json to use the latest version of the terminal: "titasgailius/terminal": "^1.0".
  2. Note that the Builder::retry is now a protected method. It's very unlikely that you were was using this method..
0.5.0

Alternatively you can also check that a given command was not executed. You may accomplish this by calling the Terminal::assertNotExecuted method after calling Terminal::fake.

Terminal::fake();

Terminal::assertNotExecuted('php artisan migrate');
0.4.0

TTY

You may enable or disable TTY mode:

Terminal::enableTty()->run(...);

Terminal::disableTty()->run(...);

Idle Timeout

You may specify max allowed time since last output:

// Seconds.
Terminal::idleTimeout(20)->run(...);

// Carbon.
Terminal::idleTimeout(Carbon::now()->addSeconds(20))->run(...);

// DateInterval.
Terminal::idleTimeout(new DateInterval('PT20S'))->run(...);
0.3.1
0.3.0

Output via Laravel Artisan Command

If you run Terminal from the Laravel's Artisan command, you may send the output to the console by passing an instance of the Command to the output method:

public function handle()
{
    Terminal::output($this)->run('echo Hello, World');
}

Output via Symfony Console Command

If you run Terminal from the Symfony's Console command, you may send the output to the console by passing an instance of the OutputInterface to the output method:

protected function execute(InputInterface $input, OutputInterface $output)
{
    Terminal::output($output)->run('echo Hello, World');
}
0.2.7
0.2.6
0.2.5
  • Reset captured commands after each test.
  • Introduce a test that checks if a command passed as an array is executed correctly.
  • Implemented the "toString" method that returns the current (or a given) command as a string.
0.2.4

Fixes a bug with "retries" option.

0.2.3

There was a typo when proxying missing methods of the Builder instance to the Process instance.

PR: https://github.com/TitasGailius/terminal/pull/6

0.2.2

This release makes it possible to set input for the Symfony Process:

Terminal::input($input)->run('rm -rf vendor');
0.2.0

Data

If you need to pass any data to your command line, it's better to bind it using the with method. Terminal can escape and prepare the values for you. Reference these values using the {{ $key }} syntax.

Terminal::with([
    'firstname' => 'John',
    'lastname' => 'Doe',
])->run('echo Hello, {{ $firstname}} {{ $lastname }}');

Alternatively, you may pass the key-value pair in separate parameters.

Terminal::with('greeting', 'World')
        ->run('echo Hello, {{ $greeting }}');
0.1.0

Initial release

Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
hamzi/corewatch
minionfactory/raw-hydrator
hexters/coinpayment
rjcodes/rjcms
act-training/laravel-permissions-manager
alimarchal/laravel-chart-of-accounts
babenkoivan/elastic-scout-driver
mkwebdesign/filament-watchdog-v5
renatomarinho/laravel-page-speed
zedmagdy/filament-business-hours
renatovdemoura/blade-elements-ui
devgeek/beacon-admin
benjamin-rqt/data-watcher-bundle
atriumphp/atrium
sandermuller/package-boost-laravel
sandermuller/boost-skills
redaxo/core
yusufgenc/filament-api-forge
l3aro/rating-star-for-filament
leek/filament-subtenant-scope