Skip to main content
The Laravel Cloud CLI lets you deploy and manage your Laravel Cloud applications, environments, and resources from your terminal or a CI/CD pipeline. The CLI works with every stack Laravel Cloud runs, including PHP, Node.js, Bun, Deno, Python, Go, Ruby, and Rust.

Requirements

  • Node.js 22 or higher
  • Git
The GitHub CLI (gh) or the GitLab CLI (glab) is optional. When your project doesn’t have a Git remote yet, the ship and deploy commands can use either one, if you’re signed in, to create the repository for you. Repository creation is available only when running interactively. The CLI can’t create Bitbucket repositories, so if you use Bitbucket, create the repository yourself and add it as a remote before shipping.

Installation

You may install the CLI using Homebrew:
Or, using npm:

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, authenticate with your Laravel Cloud account. You can authenticate through your browser, provide an API token through an environment variable, or save API tokens on your machine.

Browser authentication

The most direct 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 CLI saves the token in ~/.config/cloud/config.json.

Token authentication

In CI/CD pipelines and other environments without a browser, provide an API token through the LARAVEL_CLOUD_TOKEN environment variable:
When LARAVEL_CLOUD_TOKEN is set, it takes precedence over any tokens saved in ~/.config/cloud/config.json, and the CLI writes nothing to disk. An empty value counts as unset, so you can bypass the variable for a single command without unsetting it:

Saving tokens

On a machine you return to, or when you need tokens for several organizations, you may save tokens to ~/.config/cloud/config.json using the auth:token command. You can pass the token using the --token option or pipe it to the command:
Piping the token keeps it out of your shell history and out of the process list. The --remove option accepts a token in the same way:
To list your tokens, along with the organization each one belongs to and where it was loaded from:
Listed tokens are masked to their last four characters. Pass --show-sensitive to print them in full. If you have saved tokens for multiple organizations, the CLI prompts you to select an organization when running commands. In non-interactive environments, set a default organization for your repository using cloud repo:config --organization instead. When LARAVEL_CLOUD_TOKEN is set, the --organization option becomes a check rather than a choice: repo:config fails if the token doesn’t belong to the organization you named.

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. The ship command detects your repository and prompts for a region and application name. It can also sync your .env variables, create databases or caches, and configure features like the scheduler, Laravel Octane, or WebSockets. You may skip some of the prompts by passing options to the ship command:
The following options are available: Each application belongs to a repository and a root directory. If an application already exists for the same repository and root directory, ship offers to deploy it instead. When running non-interactively, ship stops and prints the ID of the existing application, which you may pass to cloud deploy.

Starting a new application

To start a new application from a starter kit, run the new command:
The command creates a GitHub repository from the starter kit, creates the Laravel Cloud application, watches the first deployment, and then clones the repository to your machine. You may skip the prompts by passing options along with --no-interaction:
The --starter-kit option accepts laravel, laravel-react, laravel-vue, laravel-livewire, laravel-svelte, laravel-rust, laravel-go, agent-kit, nextjs, nuxt, express, go, django, fastapi, rails, or astro. The repository you pass to --repository must not exist yet. The command also accepts the --name, --path, --database, --database-preset, and --cluster options. The Laravel starter kits and agent-kit get a MySQL database by default, or Postgres where MySQL isn’t offered. Pass --database=none to skip it. The laravel-rust and laravel-go kits run on Rust and Go, so like the other kits they get no database unless you pass --database.

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:
To start a deployment and return immediately without waiting for it to finish, use the --no-wait option. The CLI prints the deployment ID so you can check on it later:
You can also monitor an active deployment separately:
If you run deploy non-interactively in a repository that doesn’t have a Laravel Cloud application yet, the CLI runs ship to create one. When running interactively, it asks before doing so. If the environment’s resources are still provisioning, Laravel Cloud queues the deployment and starts it once they’re ready. The CLI waits for the queued deployment to start and then monitors it as usual.

Pushing environment variables

To set variables from your local .env file on the Cloud environment before the deployment starts, pass the --push-env option. The CLI prompts you to choose which variables to push:
When running non-interactively, name the variables with the --push-env-keys option instead:

Deployment history

To list an environment’s deployments, view a deployment’s details, or view a deployment’s build and deploy logs:
The deployment:logs command shows each build and deploy step with its status, duration, and output, so you can see which step caused a failed deployment and why.

Repository configuration

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

Managing resources

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

Applications

Environments

When an environment has ten or more settings to choose from, environment:update lets you type to filter the list. A few settings work differently from the rest:
  • --bucket-keys attaches buckets as comma-separated KEY_ID:DISK entries. Add :default to at most one entry to make it the default disk, such as --bucket-keys=flsk-1:local:default,flsk-2:public. The option replaces every attached bucket, so when buckets are already attached, the command asks for confirmation, or requires --force when run non-interactively. Pass an empty string to detach them all. When you run the command interactively, it asks for each bucket, key, and disk in turn.
  • --build-addons sets the build add-ons to install, as comma-separated slugs such as ffmpeg. It replaces the installed add-ons, and an empty string removes them all. The change applies on the next deployment.
  • --aws-role-arn sets the IAM role the application assumes, for environments on a dedicated cluster in organizations that bring their own IAM role. Pass an empty string to remove it.
  • --model-gateway-key-id attaches a Model gateway key.
To stop an environment or start it again:
Stopping an environment takes it offline, so the command asks for confirmation, or requires --force when run non-interactively. Laravel Cloud won’t stop an environment while a deployment is in progress, so wait for the deployment to finish, or cancel it in the dashboard, first. Starting an environment deploys it. Pass --redeploy to deploy the commit of the latest deployment instead of the latest commit on the branch. If the environment’s resources are still provisioning, Laravel Cloud queues the deployment, and the CLI waits for it to start. To set an environment’s primary domain, pass a verified root domain’s ID or name, or pass --clear to unset it. The domain stays attached either way:
To update environment variables interactively or by using command options:
To view environment logs:
Each entry shows its type: access, application, exception, error, or system. Error logs also show the file that raised them. To change an environment’s laravel.cloud subdomain, pass only the first part of the domain. For example, --name=my-app gives my-app.laravel.cloud. The previous domain stops working right away, but the new domain takes effect only on the next deployment. Pass --deploy to deploy the environment right away. You can change the domain once every 30 minutes. When running non-interactively, the command requires the --force option:
To purge the environment’s edge cache, run environment:purge-edge-cache. By default, the command purges everything cached at the edge. To purge a single path, every path under a prefix, or a Cache-Tag value, use the --path, --prefix, or --tag option. Purging by tag requires a dedicated edge network:
To list the secrets attached to an environment, or to attach or detach them:
Detaching a secret leaves it in your organization, so you can attach it again later.

Instances

Databases

To stop a Laravel MySQL or Serverless Postgres cluster, or start it again:
A stopped cluster keeps its data, but environments can’t connect to it until you start it again, so database-cluster:stop asks for confirmation. Pass --force to skip it. A Serverless Postgres cluster gets a new hostname when it starts, so redeploy the environments that connect to it once it’s running. To manage individual databases within a cluster:
To manage a cluster’s database users:
The database-user:create command accepts the --username, --type, and --database options. The --type option accepts read_write or read_only. Repeat --database to give the user access to several databases. The CLI shows the new user’s password only once, so store it right away. JSON output, which CI and other non-interactive runs use by default, masks the password unless you also pass --show-sensitive. To open a database in your local database client:
To manage database snapshots and restores:

Caches

To stop a Laravel Valkey cache, or start it again:
Environments can’t connect to a stopped cache until you start it again, so cache:stop asks for confirmation. Pass --force to skip it.

Object storage

To manage bucket keys separately:

Domains

WebSockets

To stop a WebSocket cluster, or start it again:
A stopped cluster’s applications don’t accept connections until you start it again, so websocket-cluster:stop asks for confirmation. Pass --force to skip it. To manage WebSocket applications within a cluster:

Background processes

Scheduled commands

Scheduled commands belong to an instance:
The --schedule option takes a five-field cron expression, evaluated in UTC, or a shorthand such as @daily:

Deployment webhooks

Deployment webhooks send a signed POST request to your own endpoint when a deployment goes live, succeeds, or fails. To manage an environment’s webhook endpoints:
The webhook-endpoint:create command accepts the --url and --event options. Repeat --event to subscribe to several events: deployment.live, deployment.succeeded, deployment.failed, or deployment.post_deploy_failed. Pass --disabled to create the endpoint without sending it anything yet:
The CLI shows the new endpoint’s signing secret only once, so store it right away. JSON output masks the secret unless you also pass --show-sensitive. Commands that take an existing endpoint accept its ID or its URL. The webhook-endpoint:update command accepts --url, --event, and --enabled=true or --enabled=false. Passing --event replaces the endpoint’s current events. To send a test ping to an endpoint, list its 50 most recent deliveries, or generate a new signing secret:
The webhook-endpoint:test command exits with a non-zero status when the ping fails. When you rotate the secret, the old one stops working right away, so the command asks for confirmation. Pass --force to skip it.

Email

To attach Resend to an environment so it can send email, or to change its sender or detach it:
The resend:attach command creates a new sending key unless you pass --reuse-key-id. To list your sending domains, or the keys an environment can reuse:

Managed queues

Managed queues are a special kind of instance, so these commands accept an instance ID. If you don’t pass one, the CLI prompts you to select a queue:
The managed-queue:create command accepts the --name, --size, --max-workers, --visibility-timeout, --polling-interval, and --shutdown-timeout options, so you can create a queue non-interactively. The CLI sends the visibility and shutdown timeouts only when you pass them as options or answer their prompts. Otherwise, Laravel Cloud chooses them. Laravel Cloud applies custom timeouts only for organizations with the advanced managed queues entitlement. Pass --fifo to create a FIFO queue. Laravel Cloud appends .fifo to its name. To list, retry, or delete a managed queue’s failed jobs:
The pause, purge, and delete-failed-job commands accept the --force option to skip the confirmation prompt.

Secrets

Secrets are encrypted values shared across your organization. You can attach them to environments:
The secret:create and secret:update commands read the secret’s value from STDIN when you don’t pass the --value option. Reading from STDIN keeps the value out of your shell history:
The CLI encrypts values on your machine before sending them to Laravel Cloud, so Laravel Cloud never receives them in plain text.

Model gateway

The Model gateway lets your applications call models from many AI providers with one key. To manage your organization’s gateway keys:
The model-gateway-key:create command accepts the --name, --access-level, and --budget options. The --access-level option accepts external, the default, or internal. The --budget option sets the most the key may spend each billing period, in dollars. The CLI shows the new key only once. To use the key locally right away, pass --save-env, and the CLI writes it to your project’s env file as LARAVEL_CLOUD_MODEL_GATEWAY_API_KEY, the same variable Laravel Cloud injects. The CLI warns you if Git doesn’t ignore that file:
To give an environment a key, run environment:update with the --model-gateway-key-id option. The environment receives it as LARAVEL_CLOUD_MODEL_GATEWAY_API_KEY from its next deployment. Pass an empty string to detach it. The model-gateway-key:update command accepts --name, --access-level, --budget, and --no-budget. Revoking a key also detaches it from every environment and can’t be undone. To list the models you can call, or view a model’s ID and endpoint:
The model-gateway-model:list command accepts --provider and --format filters, each comma-separated. To view your organization’s credits, buy more, or view the requests, tokens, and cost across your keys:
The model-gateway:top-up command charges your organization’s card, so it asks for confirmation, or requires --force when run non-interactively. It accepts the --amount option, in dollars. To top up again whenever the balance falls to a set amount, pass --auto-top-up=true and --threshold:
The logs and metrics commands cover the past 24 hours by default. Use the --period option to choose 1h, 24h, 7d, or 30d.

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. It’s available for PHP environments; for other languages, run commands with cloud command:run. You can execute PHP code directly against your running application:
By default, the CLI presents a multi-line text input in your terminal where you can type and submit PHP code. The CLI sends each submission to your Cloud environment for execution and displays the result 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:
The CLI opens a temporary file in your editor. Every time you save the file, the CLI sends the code to your Cloud environment for execution and displays the result in your terminal. The session ends when you close the file. Common editor values include code, subl, vim, and phpstorm. If you don’t give a value, the CLI uses the VISUAL or EDITOR environment variable.

Non-interactive mode

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

Timeout

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

Metrics and usage

To view metrics for an environment, database cluster, cache, WebSocket cluster, or WebSocket application:
Metrics cover the past 24 hours by default. Use the --period option to choose 1h, 6h, 24h, 3d, 7d, or 30d:
To view your organization’s usage and billing summary for the current billing period:
Pass --detailed for a full breakdown by application, resource, and add-on. Pass --environment to filter usage by environment, or --period to view a different billing period. The --period option accepts current, previous, 1, 2, or 3:

Utility commands

Open your application in the Laravel Cloud dashboard:
Open your application in the browser:
The browser command, deploy --open, and deploy:monitor open the environment’s primary custom domain once its hostname and SSL certificate are verified, and its laravel.cloud domain until then. Retrieve Laravel Cloud IP addresses by region:
List your organization’s dedicated clusters:
List your organization’s edge networks, including the shared edge network:

Agent skills

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

Global vs. project installation

By default, the CLI installs skills globally when you installed the CLI globally, and to the current project when the CLI is one of the project’s dependencies. You can override this behavior:

Specifying agents

To install skills for specific agents without being prompted:

Overwriting existing skills

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

Sending feedback

If the CLI, API, or documentation got in your way, such as a wrong result, a confusing error, a gap in the docs, or a missing endpoint, you can tell the Laravel Cloud team directly from your terminal:
If you don’t provide a message, the CLI prompts you for one. Messages may be up to 4,000 characters. To ask a question the docs and CLI could not answer, pass --type=question. You can also use the --tool option to name the CLI command, API endpoint, or MCP tool the feedback is about, and the --environment option to reference a specific environment by its ID:
Each organization and each user can send up to 20 feedback submissions per day.

JSON output

Many commands support a --json flag for machine-readable output, which is useful for automation and CI/CD pipelines:
The CLI writes JSON output to STDOUT and errors to STDERR, so you can pipe the output to tools like jq without filtering out error messages. Sensitive values, such as environment variables, database and cache passwords, bucket secret keys, WebSocket application secrets, and API tokens, are masked by default. To reveal them, pass --show-sensitive:
Passing --json also disables interactive prompts. In non-interactive environments, such as GitHub Actions and other CI services, prompts are disabled and output is formatted as JSON automatically. Destructive commands, such as environment:delete, require the --force option when run without a terminal, so they never run without your explicit approval. List commands return at most the first 2,000 results. When a list reaches this limit, the CLI prints a warning.