The Laravel Cloud API launched for general access at Laracon EU, giving every Laravel Cloud user a way to interact with their cloud hosting directly via a command-line interface.
During a recent live stream, Joe Tannenbaum, Open Source Lead Engineer at Laravel and the person who built the CLI, walked through the tool with DevRel Engineer Leah Thompson.
Read on for a snapshot of their conversation, or watch the entire stream.
What Is the Laravel Cloud CLI?
The Laravel Cloud CLI is a global Composer package that wraps the Laravel Cloud API. It gives you a terminal-native way to deploy Laravel apps, manage environment variables, stream logs, connect to databases, and run Artisan commands against live Cloud environments without opening the Laravel Cloud dashboard.
The Problem the CLI Solves
Every Laravel Cloud deploy used to require a browser. Push your code, open the dashboard, navigate to the right environment, confirm the deploy, and done. If you needed to update an environment variable or add a background process, you had to go through the same loop again.
Joe built the CLI to eliminate that context switching. "We want to make building and deploying your app to Laravel Cloud as easy as possible, he said during the stream. "We want to make that cycle very smooth, we want you to move as fast as you're thinking.”
The CLI is built directly on the Laravel Cloud REST API. Every action available in the dashboard has a corresponding command. "Everything you can do in the API, there is a CLI equivalent," he explained.
Installing the Laravel Cloud CLI
Install the CLI as a global Composer package:
Then add shell completions for your shell of choice:
Authenticate with your Laravel Cloud account:
One detail Joe built in from the start: if you skip authentication and run a command directly, the CLI handles the auth flow inline and then picks up where you left off. "If you said cloud ship, it'll first authenticate you and then just continue with the cloud ship flow," he said. "I was trying to really let people hit the ground running as fast as possible."
Deploying Your First Laravel App to the Cloud
cloud ship is precisely the entry point for new projects. It guides you through every step of the setup process, from repository creation to environment configuration to the first deploy.
"If your project is not on Laravel Cloud yet, I would just write cloud ship," Joe said. "It'll walk you through exactly what you need to do. It's a lot of pressing enter or checking things off, and that's kind of it."
During the stream, Joe demonstrated this live with a fresh Laravel app that was not yet a Git repository. cloud ship detected the GitHub CLI on his machine, offered to create and push the repository, prompted for a region, read custom variables from the .env file, and then asked whether to enable hibernation, a database cluster, Inertia SSR, and a WebSocket cluster, all based on what was actually installed in the project.
That last part is worth pausing on. The CLI reads your installed packages and makes intelligent recommendations. "If we detect that you are using Laravel Reverb, the likelihood that you need a WebSocket application just went up to 100%," Joe said. "So we can offer that to you and say, it looks like you're using Reverb, do you want to spin up a WebSocket cluster?"
Once the first Laravel Cloud deploy is complete, day-to-day redeployment is a single command:
Pass --open to open the deployment log in your browser once the push completes, or use cloud deploy:monitor to stream the deployment status directly in the terminal without switching tabs.
How the CLI Knows Which Laravel Cloud App You’re Working On
The most interesting behavior in the CLI, according to Joe, is what happens invisibly.
Every time you run a command, the CLI reads the Git information for your local repository and automatically matches it to the corresponding application in Laravel Cloud. You never need to specify which app you're working on.
"It automatically scopes down to the app that correlates to the Git repo in Cloud, and that's kind of an invisible detail," Joe said. "You just take it for granted because you're like, ‘Yeah, I'm in my app, I know this is my app.’ But otherwise, we'd have to have you select the application every single time."
If a repository is linked to multiple Cloud applications, the selection narrows to only the matching ones. If the CLI cannot make a determination at all, it displays the full list and asks you to choose.
You can also set a repo-level config file to pin the organization and application for a given project:
This writes a config to .cloud inside the repository, so the settings travel with the codebase, and the CLI never prompts for the organization again.
Laravel Cloud CLI Commands for Everyday Use
Joe describes the command surface as falling into two categories. The majority are what he calls "CRUD-dy" commands: direct one-to-one equivalents of API operations for applications, environments, databases, caches, buckets, domains, WebSocket clusters, and background processes.
Then, there are the orchestration commands, like cloud ship, cloud deploy, and cloud command:run, which do more than a single API call and are more opinionated about what you are probably trying to accomplish.
cloud command:run is a good example of the latter. It executes an Artisan command on your Cloud environment and waits for the response, which you can pipe directly to your clipboard from the terminal. During the stream, Joe ran php artisan route:list --json against a live Cloud environment and had the full JSON output on his clipboard within seconds.
For day-to-day use, a handful of commands cover most of what you need:
cloud environment:variablesto get or set environment variables without opening the dashboardcloud environment:logsto stream application logs in real timecloud database:opento connect directly to your Cloud database from the terminalcloud database-snapshot:createto take a snapshot before a migrationcloud browserto open the Cloud dashboard for the current environment directly from the terminal
"I'm very rarely in the dashboard anymore," Joe said. "I'm just kind of like firing off stuff from the terminal."
All list and get commands support a --json flag that returns structured output, making the CLI easy to compose with other scripts or pipe to jq.
Using the CLI with AI Agents
One of the more compelling use cases that emerged during the stream is pairing the CLI with an AI agent to manage Laravel cloud hosting through natural language.
Taylor Otwell used the API in his Laracon EU talk demo, and Florian Beer demonstrated how to deploy to Laravel Cloud via a custom bot. The CLI makes that kind of integration more accessible. "You can ask what went wrong with the last deploy, and the agent can now use the CLI to grab the last deploy and see what the error was, and then understand how to fix it," Joe said. “You can create this sort of self-healing loop."
His tip for getting clean results with agents: explicitly point them toward the CLI. "I just point it in the CLI's direction and say, ‘Hey, you have a tool called cloud on my computer, that's what you should be using whenever I say interact with Cloud.’ At that point, the agent is really good at figuring out which command corresponds with what you're asking."
The naming convention helps. Because commands follow a resource:action pattern, a model can usually infer the correct command from a description alone without consulting the documentation. Joe called the structure "grok-able," meaning an agent can navigate it predictably just by running cloud list to see the available commands.
For non-interactive use, such as when running cloud ship via an agent, the CLI applies an opinionated default configuration calibrated to the most cost-efficient setup for your app: hibernation enabled, instances sized to their smallest reasonable option, and resources matched to your installed packages.
What's Coming
The CLI launched one week before the stream, so refinements are ongoing. Support for detecting the Cloud CLI as a global Composer install via Laravel Boost is in progress, which will allow Boost to automatically suggest the relevant CLI skill when you run boost:install in a Cloud-connected project.
Scoped tokens with read-only access have also come up in the community, this time for the Laravel Cloud API. These would let you grant an AI agent visibility into settings and logs without the ability to make changes.
"I know that has been something that has been brought up," Joe said. "Tokens with different scopes. That's on our radar."
Get Involved
The CLI is open source, and Joe is actively welcoming bug reports and pull requests.
"I love building CLIs," he said. "This was a bit of a passion project, a lot of something we actually needed. And I'm really happy with the way it came out."
If something feels harder than it should, he wants to hear about it. "My whole job is to try to make things easier. If anything feels hard, hit me."
Report bugs and open pull requests at the laravel/cloud-cli repository on GitHub. Find Joe at @joetannenbaum on Twitter or at joe.codes.
To install the CLI and read the full command reference, visit the Laravel Cloud CLI documentation. For the REST API that the CLI is built on, see the Laravel Cloud API documentation.
Frequently Asked Questions
What is the Laravel Cloud CLI?
The Laravel Cloud CLI is a global Composer package that lets you deploy and manage Laravel cloud hosting from the terminal. It wraps the Laravel Cloud REST API and provides a resource:action command structure for every dashboard action.
How do I install the Laravel Cloud CLI?
Run composer global require laravel/cloud-cli, then authenticate with cloud auth. For CI environments, use cloud auth:token --add to generate a token without a browser.
How do I deploy a Laravel app from the terminal?
Run cloud ship for a first-time Laravel deployment. The CLI walks you through repository setup, environment configuration, and the first deploy. For subsequent deployments, run cloud deploy.
Does the Laravel Cloud CLI work with AI coding agents?
Yes. Because commands follow a predictable resource:action pattern, AI agents can navigate the CLI by running cloud list and inferring commands from plain-English descriptions, without consulting the documentation.
How do I stream Laravel logs from the terminal?
Run cloud environment:logs to stream real-time application logs for the current environment directly in your terminal.
Can I connect to my Laravel Cloud database from the terminal?
Yes. Run cloud database:open to open a direct connection to your Cloud database without opening the dashboard.
