> ## Documentation Index
> Fetch the complete documentation index at: https://kawax.biz/llms.txt
> Use this file to discover all available pages before exploring further.

# Laravel Multiplex — a TUI that manages your local development processes

> An initial look at laravel/multiplex. The terminal UI used by Laravel 13's php artisan dev command that puts multiple processes into tabs, supports search, and restarts crashed processes automatically.

## Introduction

[`laravel/multiplex`](https://github.com/laravel/multiplex) is a terminal UI (TUI) for running multiple commands at once. Laravel 13's `php artisan dev` uses it under the hood, letting you manage the PHP development server, queue workers, log tail, Vite, and every other process needed for local development from a single terminal.

Each process gets its own tab where its output is displayed, and you can search and scroll through that output. When the command exits, each process's output is written back into the terminal's normal scrollback so you can still read the logs after leaving the TUI.

## Installation and direct usage

Because `php artisan dev` handles the required configuration for you, most Laravel applications never need to install Multiplex directly. To use it on its own, install it with npm on Node.js 22.13 or later.

```bash theme={null}
npm install -g @laravel/multiplex
```

Commands are passed in `label,command` form:

```bash theme={null}
multiplex 'server,php artisan serve' 'queue,php artisan queue:listen' 'vite,npm run dev'
```

## TUI and inline modes

If both standard input and standard output are TTYs, the tabbed TUI is launched. Press `s` to switch to a streaming view, `/` to search output, `r` to restart the selected process, and `q` to quit.

When there is no TTY — in CI, or when the output is piped — Multiplex switches to inline mode automatically. Each line is prefixed with its process label and rendered in the order the output arrives. Use `-i` to force inline mode explicitly:

```bash theme={null}
multiplex -i 'build,npm run build' 'test,npm test'
```

Inline mode exits when the last process ends and reports command failures through the exit code. To consume the results as structured data, use `--json`:

```bash theme={null}
multiplex --json 'build,npm run build' 'test,npm test'
```

## Automatic restart and shutdown

Crashed processes wait one second and are then restarted automatically, up to five times. A process that exits within one second of starting is not retried — this usually means the executable is missing or a port is in conflict, so the process never really came up in the first place. For one-shot commands such as builds or migrations, pass `--no-restart`:

```bash theme={null}
multiplex --no-restart 'build,npm run build'
```

Multiplex terminates the process group of every child process when it exits or receives a signal. Every process is stopped together, preventing situations where the development server keeps running and holds a port open.

## Caveats

Standard input is not forwarded to child processes. That means commands that need to read input, such as `php artisan tinker` or a migration confirmation prompt, cannot be run through Multiplex. Run interactive commands in a separate terminal.

Multiplex exposes a programmatic API as well, but commands are executed through `sh -c`. Do not embed untrusted values — configuration files, request data, and so on — directly into the command string.

## References

* [Laravel documentation: Artisan – The Dev Command](https://laravel.com/docs/13.x/artisan#the-dev-command)
* [laravel/multiplex README](https://github.com/laravel/multiplex)


## Related topics

- [Artisan console](/en/artisan.md)
- [Getting started with Laravel Nightwatch](/en/blog/nightwatch-introduction.md)
- [Package CHANGELOG and Release Management](/en/advanced/package-changelog.md)
- [Package Version Compatibility Management](/en/advanced/package-versioning.md)
- [Configuration](/en/configuration.md)
