Skip to main content
The Laravel Cloud CLI provides a powerful command-line interface for managing your applications, environments, and resources on Laravel Cloud. Whether you are deploying from your terminal or integrating with a CI/CD pipeline, the CLI gives you full control over your Laravel Cloud account.

Requirements

  • PHP 8.2 or higher
  • Composer
  • Git
The GitHub CLI (gh) is optional but recommended. It is used by the ship command to create a GitHub repository if your project doesn’t already have one.

Installation

Install the CLI globally:
Note: Make sure your global vendor binaries directory is in your $PATH environment variable, you can read more about this in the Composer documentation.

Shell completions

The CLI supports tab completions for Bash, Zsh, and Fish. To generate and install completions for your shell, run:
You can also target a specific shell directly:

Authentication

Before using the CLI, you need to authenticate with your Laravel Cloud account. The CLI supports two authentication methods: browser-based OAuth and manual token entry.

Browser authentication

The simplest way to authenticate is through your browser:
This command opens your default browser, prompts you to authorize the CLI, and stores the resulting API token locally. The token is saved in ~/.config/cloud/config.json.

Token authentication

You can also manage API tokens directly. This is useful for CI/CD environments or when you prefer to provide tokens manually:
If you have tokens for multiple organizations, the CLI will prompt you to select which organization to use when running commands.

Quick start

The fastest way to get an application running on Laravel Cloud is the ship command. From inside your project directory, run:
This guided flow walks you through creating an application, configuring your environment, and deploying — all in a single command. It detects your repository, prompts for a region and application name, and optionally syncs your .env variables, creates databases or caches, and configures features like the scheduler, Octane, or WebSockets.

Deploying

To deploy your application, run the deploy command from your project directory:
The CLI resolves the target application and environment automatically using your repository configuration. After the deployment starts, the CLI monitors its progress and reports the result in real time. To open your application in the browser after a successful deployment:
You can also monitor an active deployment separately:

Repository configuration

To avoid specifying your application and environment on every command, you can save defaults for your repository:
This creates a .cloud/config.json file in your project root that stores the application_id and organization_id. Subsequent commands will use these defaults automatically.

Managing resources

The CLI provides full CRUD operations for Laravel Cloud resources. Command examples below show the most common operations.

Applications

Environments

To update environment variables interactively or by using command options:
To view environment logs:

Instances

Databases

You can manage individual databases within a cluster:
To connect to a database locally:
Database snapshots and restores are also available:

Caches

Object storage

Bucket keys can be managed separately:

Domains

WebSockets

WebSocket applications within a cluster:

Background processes

Commands

To run a one-off command on an environment:
To list previously executed commands:

Tinker

The tinker command opens an interactive PHP REPL connected to your Laravel Cloud environment, allowing you to execute PHP code directly against your running application:
By default, a multi-line text input is presented in your terminal where you can type and submit PHP code. Each submission is sent to your Cloud environment for execution, and the result is displayed in your terminal. The session remains open so you can continue executing code.

Editor mode

If you prefer to write code in your editor, use the --editor option:
This opens a temporary file in your editor. Every time you save the file, the code is automatically sent to your Cloud environment for execution and the result is displayed in your terminal. The session ends when you close the file. Common editor values include code, subl, vim, and phpstorm. If no value is given, the VISUAL or EDITOR environment variable is used.

Non-interactive mode

To execute a single snippet of PHP code without entering the interactive session, use the --code option:
This is useful for scripting and CI/CD pipelines.

Timeout

By default, code execution will time out after 60 seconds. You can adjust this with the --timeout option:

Utility commands

Open your application in the Laravel Cloud dashboard:
Open your application in the browser:
Retrieve Laravel Cloud IP addresses by region:

Agent skills

The CLI can install Laravel Cloud skills for your AI coding agents. Skills are fetched from the laravel/agent-skills repository and installed into the appropriate directory for each agent.
The command auto-detects which agents you have configured and prompts you to select which ones to install skills for. Supported agents include Claude, Cursor, Junie, GitHub Copilot, and a generic agent format.

Global vs. project installation

By default, skills are installed globally if you are outside a Laravel Cloud project, or to the current project if the Cloud CLI is detected as a local dependency. You can override this behavior:

Specifying agents

To install skills for specific agents without being prompted:

Overwriting existing skills

If skills have already been installed, use the --force flag to overwrite them:

JSON output

Many commands support a --json flag for machine-readable output, which is useful for automation and CI/CD pipelines:
In non-interactive environments (such as GitHub Actions), interactive prompts are disabled automatically.