Forge CLI is a command-line tool that you may use to manage your Forge resources from the command-line.
Requires PHP 8.0+You may install the Forge CLI as a global Composer dependency:
forge
command from the command-line:
FORGE_API_TOKEN
environment variable in your CI build environment.
server:current
command. Typically, most of the commands you execute using the Forge CLI will be executed against the active server.
server:switch
command:
server:list
command:
forge
user to your servers so that you can securely connect to them. You may have already done this via the Forge UI. You may test that SSH is configured correctly by running the ssh:test
command:
ssh:configure
command. The ssh:configure
command accepts a --key
option which instructs the CLI which public key to add to the server. In addition, you may provide a --name
option to specify the name that should be assigned to the key:
ssh
command to create a secure connection to your server:
site:list
command:
deploy
command:
env:pull
and env:push
commands. The env:pull
command may be used to pull down an environment file for a given site:
env:push
command to push the variables back to your site:
site:logs
command:
deploy:logs
command. If the deploy:logs
command is called with no additional arguments, the logs for the latest deployment will be displayed. Or, you may pass the deployment ID to the deploy:logs
command to display the logs for a particular deployment:
command
command will prompt you for the command you would like to run. The command will be run relative to the site’s root directory.
tinker
command:
{resource}:status
command:
{resource}:logs
command:
{resource}:restart
command:
{resource}:shell
command to quickly access a command line shell that lets you interact with a given resource: