Everything the app does is also a laramonster command, for terminals, scripts and servers without a desktop. Commands that take a site name use the site of the folder you're in when you leave the name out.
The command is installed with the app on Linux (~/.local/bin) and added to your terminal by setup's Terminal commands option on every system. Run laramonster --help, or laramonster <command> --help for any command's flags.
Engine
| Command | What it does |
start [-b] | Start LaraMonster in the foreground, or in the background with -b |
stop | Stop LaraMonster and every service it runs |
restart | Restart it in the background |
reload | Re-read the config and reload sites and PHP |
status [--json] | Show what's running: sites, PHP pools, services, ports, warnings |
dashboard [on|off] [--browser] | Open the app, or turn the browser dashboard on or off (alias ui) |
logs [name] [-f] [-n 100] | Show a log (laramonster, caddy, php84-fpm, mysql…); with no name, list them |
$ laramonster start -b
✓ LaraMonster is running
$ laramonster logs caddy -f # follow the web server's log
$ laramonster status --json | jq '.sites[].url'
Sites
| Command | What it does |
park [dir] | Serve every folder inside a directory as <folder>.<tld> |
forget [dir] | Stop serving a parked directory |
paths | List parked directories |
link [name] | Serve the current directory as <name>.<tld> |
unlink [name] | Remove a linked site |
sites | List every site with its folder, PHP and address (alias links) |
open [name] | Open a site in your browser |
edit [name] | Open a site in your editor |
secure [name] / unsecure [name] | Serve a site over HTTPS, or plain HTTP again |
isolate <version> / unisolate | Pin the current site to a PHP version, or back to the default |
new <name> | Create a project; see its flags |
share [name] | Open a public link (--user, --password, --minutes) |
unshare [name] | Close a site's public link |
$ cd ~/Code/shop
$ laramonster secure && laramonster open # https://shop.localhost:8443
$ laramonster isolate 8.3
$ laramonster share --minutes 60
PHP
| Command | What it does |
php [args…] | Run PHP: the version of the site you're in |
composer [args…] | Run Composer with the site's PHP version |
php:list | List installed PHP versions |
php:available | List PHP versions you can install |
php:install <version…> | Download and install PHP versions, e.g. php:install 8.4 8.3 |
php:uninstall <version> | Remove a PHP version LaraMonster installed |
use <version> | Set the default PHP version, e.g. use 8.4 or use [email protected] |
which | Show which site and PHP the current directory uses |
Services & tools
| Command | What it does |
services | List services (databases, cache, mail, search) and their state |
service start|stop|restart <name> | Control a service now |
service enable|disable <name> | Start it with LaraMonster, or not |
service install <name> | Download or install it |
service env <name> | Print its .env values |
service port <name> [port] | Show or change its port |
tools | List developer tools and whether they're installed |
tools install <id…> | Install tools, e.g. tools install node postgres git |
Service names: mysql, postgres, redis, mailpit, meilisearch.
$ laramonster service start postgres && laramonster service env postgres >> .env
System
| Command | What it does |
setup [--no-path] [--no-autostart] | One-time setup: php/composer shims on PATH, start at login, start the engine |
trust / untrust | Trust LaraMonster's certificate authority, or remove it; see HTTPS |
dns status|setup|remove | Name resolution for *.test; see DNS |
tld [tld] | Show or set the domain ending (localhost, test…) |
port [port] [--https] | Show or set the HTTP (or HTTPS) port |
autostart [on|off] | Start LaraMonster when you log in |
Scripting
status --json prints everything the dashboard knows, which makes LaraMonster easy to script. For example, wait until the engine is up in a CI-like setup script:
#!/usr/bin/env sh
laramonster start -b
laramonster park "$HOME/Code"
laramonster service start mysql
laramonster status --json | jq -r '.ports_busy | if length > 0 then "busy ports: \(.)" else "ready" end'
Environment variables. LARAMONSTER_HOME moves LaraMonster's home folder (handy for a throwaway test install).