> ## Documentation Index
> Fetch the complete documentation index at: https://cloud.laravel.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Laravel Cloud CLI

> Deploy and manage your Laravel Cloud applications from the command line.

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](https://cli.github.com/) (`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:

```bash theme={null}
composer global require laravel/cloud-cli
```

*Note:* Make sure your global vendor binaries directory is in your `$PATH` environment variable, you can read more about this in the [Composer documentation](https://getcomposer.org/doc/03-cli.md#global).

### Shell completions

The CLI supports tab completions for Bash, Zsh, and Fish. To generate and install completions for your shell, run:

```bash theme={null}
cloud completions
```

You can also target a specific shell directly:

```bash theme={null}
cloud completions zsh
cloud completions bash
cloud completions fish
```

## 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:

```bash theme={null}
cloud auth
```

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:

```bash theme={null}
# Add a token
cloud auth:token --add

# List stored tokens
cloud auth:token --list

# Remove a token
cloud auth:token --remove
```

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:

```bash theme={null}
cloud ship
```

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:

```bash theme={null}
cloud deploy
```

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:

```bash theme={null}
cloud deploy --open
```

You can also monitor an active deployment separately:

```bash theme={null}
cloud deploy:monitor
```

## Repository configuration

To avoid specifying your application and environment on every command, you can save defaults for your repository:

```bash theme={null}
cloud repo:config
```

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

```bash theme={null}
cloud application:list
cloud application:get
cloud application:create
cloud application:update
```

### Environments

```bash theme={null}
cloud environment:list
cloud environment:get
cloud environment:create
cloud environment:update
cloud environment:delete
```

To update environment variables interactively or by using command options:

```bash theme={null}
cloud environment:variables
```

To view environment logs:

```bash theme={null}
cloud environment:logs
```

### Instances

```bash theme={null}
cloud instance:list
cloud instance:get
cloud instance:create
cloud instance:update
cloud instance:delete
cloud instance:sizes
```

### Databases

```bash theme={null}
cloud database-cluster:list
cloud database-cluster:get
cloud database-cluster:create
cloud database-cluster:update
cloud database-cluster:delete
```

You can manage individual databases within a cluster:

```bash theme={null}
cloud database:list
cloud database:get
cloud database:create
cloud database:delete
```

To connect to a database locally:

```bash theme={null}
cloud database:open
```

Database snapshots and restores are also available:

```bash theme={null}
cloud database-snapshot:list
cloud database-snapshot:get
cloud database-snapshot:create
cloud database-snapshot:delete
cloud database-restore:create
```

### Caches

```bash theme={null}
cloud cache:list
cloud cache:create
cloud cache:update
cloud cache:delete
cloud cache:types
```

### Object storage

```bash theme={null}
cloud bucket:list
cloud bucket:get
cloud bucket:create
cloud bucket:update
cloud bucket:delete
```

Bucket keys can be managed separately:

```bash theme={null}
cloud bucket-key:list
cloud bucket-key:get
cloud bucket-key:create
cloud bucket-key:update
cloud bucket-key:delete
```

### Domains

```bash theme={null}
cloud domain:list
cloud domain:create
cloud domain:update
cloud domain:delete
cloud domain:verify
```

### WebSockets

```bash theme={null}
cloud websocket-cluster:list
cloud websocket-cluster:get
cloud websocket-cluster:create
cloud websocket-cluster:update
cloud websocket-cluster:delete
```

WebSocket applications within a cluster:

```bash theme={null}
cloud websocket-application:list
cloud websocket-application:get
cloud websocket-application:create
cloud websocket-application:update
cloud websocket-application:delete
```

### Background processes

```bash theme={null}
cloud background-process:list
cloud background-process:get
cloud background-process:create
cloud background-process:update
cloud background-process:delete
```

### Commands

To run a one-off command on an environment:

```bash theme={null}
cloud command:run
```

To list previously executed commands:

```bash theme={null}
cloud command:list
cloud command:get
```

### 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:

```bash theme={null}
cloud tinker
```

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:

```bash theme={null}
cloud tinker --editor=code
```

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:

```bash theme={null}
cloud tinker --code="echo App\Models\User::count();"
```

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:

```bash theme={null}
cloud tinker --timeout=120
```

## Utility commands

Open your application in the Laravel Cloud dashboard:

```bash theme={null}
cloud dashboard
```

Open your application in the browser:

```bash theme={null}
cloud browser
```

Retrieve Laravel Cloud IP addresses by region:

```bash theme={null}
cloud ip:addresses
```

## 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.

```bash theme={null}
cloud skills:install
```

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:

```bash theme={null}
# Install globally (e.g. ~/.claude/skills)
cloud skills:install --global

# Install to the current project (e.g. .claude/skills)
cloud skills:install --project
```

### Specifying agents

To install skills for specific agents without being prompted:

```bash theme={null}
cloud skills:install --agent=claude --agent=cursor
```

### Overwriting existing skills

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

```bash theme={null}
cloud skills:install --force
```

## JSON output

Many commands support a `--json` flag for machine-readable output, which is useful for automation and CI/CD pipelines:

```bash theme={null}
cloud instance:list --json
cloud environment:variables --json --action=set --key=APP_ENV --value=production
```

In non-interactive environments (such as GitHub Actions), interactive prompts are disabled automatically.
