Herd Command Line Interface
The following commands are available in the Laravel Herd CLI tool. Each command allows you to manage development environment settings and configurations directly from the command line.Common Commands
You can get the full list of commands by runningherd list
in your terminal.
- herd composer
- herd coverage
- herd debug
- herd edit
- herd init
- herd ini
- herd isolate
- herd isolate-node
- herd isolated
- herd isolated-node
- herd link
- herd links
- herd log
- herd logs
- herd open
- herd park
- herd parked
- herd php
- herd restart
- herd secure
- herd secured
- herd share
- herd site-information
- herd start
- herd stop
- herd tinker
- herd unisolate
- herd unisolate-node
- herd unlink
- herd unsecure
- herd use
- herd which
- herd which-php
- herd init:fresh
herd composer
Theherd composer
command proxies composer calls to the isolated PHP version of a site. We recommend setting up an alias for your terminal so that running composer
on the command line always uses herd composer
and uses the correct PHP version for your site.
herd coverage
You can runherd coverage
to run PHP commands with Xdebug coverage enabled and it always uses the the isolated PHP executable.
herd debug
Runherd debug
and automatically load your debug.ini
for this command. The debug.ini
usually includes Xdebug so if you want to debug artisan commands, this is how to do it from your terminal.
herd edit
Theherd edit
command opens the current directory in the configured IDE.
herd ini
Theherd ini
command automatically opens the php.ini
file for your current global PHP version in your configured IDE.
When running this command in an isolated project path, Herd will open the php.ini file for the isolated PHP version.
You may also specify which version you want to use:
herd init
If aherd.yml
file is present in the directory, Herd configures your application according to the manifest file. Without a herd.yml
, the command starts the wizard to create one.
herd isolate
The command tells Herd to use a specific PHP version for this directory when serving sites or using theherd composer
or herd php
commands.
herd isolate-node
Similar to theherd isolate
comand for PHP, the herd isolate-node
command sets a specific Node.js version for a directory. The difference to the PHP version of the command is that herd isolate-node
creates and NVM config file that autoamtically switches the global node version if you enter this directory – so you can’t run multiple versions in different directories in parallel.
herd isolated
Theisolated
command lists all sites with isolated PHP versions and givey you a quick overview where they are.
herd isolated-node
Analog to the PHP command, theisolate-node
command lists all sites with isolated Node.js versions.
herd link
You can register applications outsite of a parked path via theherd link
command. It also supports linking multiple domains to a single application.
herd links
You can display all linked sites viaherd links
.
herd log
You can tail any logs from Herd via theherd log
command. If you run it without an argument, it displays all available log files and if your specify a service, it tails the logs of this service.
herd logs
If you’re using Herd Pro, you can open the Log Viewer viaherd logs
from your terminal.
herd open
Theherd open
command opens the current directory in a browser.
herd park
You can park additional directories via theherd park
command and make all subdirectories available via their .test
domains.
herd parked
Typeherd parked
to lists all sites in parked paths.
herd php
Theherd php
command runs PHP commands using the isolated executable for the site.
herd restart
You can restart all Herd services via theherd restart
command.
herd secure
Generate a trusted TLS certificate by runningherd secure
in the directory of am application.
herd secured
Runherd secured
to list all currently secured sites with the expiration date of the certificate.
herd share
You can share local applications via theherd share
command and Expose.
herd site-information
Theherd site-information
command displays information based on the driver of the application. For Laravel applications, this is the result of the php artisan about
command but you can replace that with a custom driver.
herd start
Start all Herd services withherd start
.
herd stop
Stop all Herd services – from nginx and dnsmasq to all Herd Pro services – viaherd stop
.
herd tinker
You can hop into a tinker session with your Laravel application viaherd tinker
. If Herd detects Tinkerwell on your machine, it automatically opens the application in Tinkerwell.
herd unisolate
If you’ve isolated the application at your current terminal path to a specific PHP version and want to use the global version again, you can runherd unisolate
to remove the isolation.
herd unisolate-node
Likeherd isolate
, the unisolate-node
command removes the isolation to a specific Node.js version. The command uses Herd’s nvm under the hood so make sure to have that installed first.
herd unlink
You can remove the configuration for a linked site by running theherd unlink
command in the linked directory.
herd unsecure
Runherd unsecure
to remove the TLS certificate of the domain and the automated redirect to HTTPS from nginx. Make sure to restart your browser session or clear your redirect cache because your browser will still try to send you to the HTTPS URL instead of simply serving the site via HTTP.
herd use
The commandherd use
changes the global PHP version that Herd uses to serve all sites that don’t have an isolated version.
herd which
In case that you are debugging issues with your custom Herd driver, you can runherd which
to see which driver Herd detects for the application at your current terminal path.
herd which-php
You can runherd which php
to see which PHP binary Herd uses to serve the application at your current terminal path.
herd init:fresh
Initializes a fresh Herd manifest file. Herd also ships with the Forge CLI and you can runforge
commands like forge ssh
from any local site that you link via the Forge Integration without specifying a server.