# Artisan, Composer and commands

Source: https://laraport.app/docs/artisan/

> Run Artisan, Composer, npm scripts and your own commands in a Docker container, with autocomplete and live output, locally or over SSH.

## Artisan

**Artisan** lists every command of the app with its description. Type to filter, `tab` completes, `enter` runs it. The output streams live; commands that ask questions take your input.

`ctrl+t` (or `alt+enter`) runs the command in the terminal instead, for commands with prompts such as `make:filament-user` or Laravel Prompts. The output stays until you press `enter`.

### Recent commands

The commands you run are remembered per server and container. They are listed under **recent** above the commands, newest first, even while the list is still loading. Typing filters them too. Move to one with `↓` and press `enter` to run it again, or edit it first: arguments are kept, such as `queue:work --queue=default`. Running a command again moves it to the top. `ctrl+d` forgets the selected one.

Composer and npm scripts keep their own recent commands the same way. The history is stored in `~/.config/laraport/history.json` with the [history settings](https://laraport.app/docs/configuration/#settings).

laraport finds `artisan` in the configured `root_path`, or in `/var/www/html` and `/app`.

Commands that change things are recorded in the [journal](https://laraport.app/docs/journal/). On a [read-only server](https://laraport.app/docs/read-only/) only known reads run, such as `about`, `route:list` and `migrate:status`.

For migrations, `optimize`, a worker restart and maintenance mode, the Laravel tab has ready-made [deploy commands](https://laraport.app/docs/deploy/).

## Composer

**Composer** lists and runs Composer commands. If the container has no `composer`, laraport uses the app's own `composer.phar`, or downloads one once into `/tmp/laraport` in the container with the verified installer. It never writes into the app directory. A failed download says why: no network, TLS, or `allow_url_fopen` turned off.

## npm scripts

**npm scripts** lists the scripts of `package.json` and runs them.

## Your commands

**Commands** shows the command groups from your config: the container's own first, then the global ones. See [Custom commands](https://laraport.app/docs/configuration/#custom-commands).

## Custom command

**Custom command** runs any shell command in the container, with live output and input.
