laravel/cloud-cli
Laravel Zero CLI to deploy and manage apps on Laravel Cloud. Authenticate via OAuth, link repos, ship and deploy from the terminal, and manage environments, databases, caches, object storage, and domains, with optional JSON output and shell completions.
The laravel/cloud-cli package is a Laravel Zero CLI tool designed to integrate seamlessly with Laravel Cloud, a managed hosting platform for Laravel applications. It abstracts interactions with Laravel Cloud’s API, providing a command-line interface (CLI) for deployment, infrastructure management, and monitoring.
Key architectural strengths:
gh) Integration: Leverages GitHub’s CLI for repository linking, aligning with modern DevOps workflows.~/.config/cloud/config.json for authentication and repo:config for project-specific defaults, reducing repetitive inputs.Fit for Laravel ecosystems:
Prerequisites:
gh): Mandatory for repository linking (can be a blocker for teams without GitHub).Integration Points:
| Component | Integration Feasibility | Risk |
|---|---|---|
| Laravel Applications | High (designed for Laravel projects; uses .env, artisan, and Git workflows). |
Low |
| CI/CD Pipelines | Medium (requires API token management; CI-friendly with cloud auth:token). |
Medium (token rotation, environment variables). |
| DevOps/Infrastructure | High (manages environments, databases, caches, domains, and WebSockets). | Low |
| Monitoring/Logging | High (supports environment:logs, deployment:monitor, and usage commands). |
Low |
| Multi-Cloud/On-Prem | Low (Laravel Cloud-specific; not portable to other platforms). | High (vendor lock-in). |
Key Questions for TPM:
gh) a requirement? If not, repository linking may need alternative solutions (e.g., custom API calls).| Risk Area | Description | Mitigation |
|---|---|---|
| Vendor Lock-in | Tight coupling with Laravel Cloud API; migration to other platforms would require rewrites. | Document API limits and explore abstraction layers if multi-cloud is a goal. |
| Authentication Complexity | OAuth + API tokens require secure storage and rotation. | Enforce CI/CD token management (e.g., short-lived tokens, secrets managers). |
| GitHub Dependency | gh CLI is mandatory for repository linking. |
Evaluate alternatives (e.g., direct GitHub API calls) if GitHub is not used. |
| CLI UX Fragmentation | Commands may overlap with existing tools (e.g., artisan, forge). |
Audit existing workflows and phase adoption (e.g., start with ship/deploy before full infra). |
| Error Handling | API-driven; errors may be opaque without Laravel Cloud’s UI. | Implement logging and user-friendly error messages (e.g., cloud deploy --verbose). |
| Performance | API calls may introduce latency for large-scale operations (e.g., database-snapshot:list). |
Benchmark critical paths; consider caching for read-heavy operations. |
Business/Team Goals:
git push-to-deploy workflows)Technical:
Adoption:
Alternatives:
cloud-cli that would require extensions?The laravel/cloud-cli package is optimized for Laravel-centric stacks and integrates well with the following:
| Stack Component | Fit Level | Notes |
|---|---|---|
| Laravel Applications | High | Designed for Laravel projects; leverages .env, artisan, and Git workflows. |
| PHP 8.2+ | High | Minimum requirement aligns with Laravel 10+ and modern PHP. |
GitHub CLI (gh) |
Medium | Mandatory for repository linking; may require adoption if not already used. |
| Git | High | Standard in Laravel projects for version control. |
| CI/CD (GitHub Actions, etc.) | Medium | Supports token-based auth but requires configuration for secure token management. |
| Laravel Cloud API | High | Direct integration with the platform’s API. |
| Docker/Kubernetes | Low | Not a focus; primarily for managed Laravel Cloud deployments. |
| Monorepos | High | Supports per-repository configuration via cloud repo:config. |
Non-Fit Scenarios:
gh repo clone laravel/cloud-cli
cd cloud-cli
composer install
cloud auth # OAuth setup
cd /path/to/laravel-app
cloud repo:config # Links repo to Laravel Cloud app/environment
cloud ship # Guided workflow
# OR
cloud deploy # Manual deploy
- name: Deploy to Laravel Cloud
run: |
./cloud-cli/cloud deploy --token=${{ secrets.LARAVEL_CLOUD_TOKEN }}
artisan deploy or custom scripts with cloud deploy.cloud environment:variables, cloud database-cluster:create, and cloud usage to manage resources.cloud deploy:monitor and cloud usage --detailed for cost/performance insights.cloud completions) for faster adoption.| Compatibility Factor | Details |
|---|---|
| Laravel Version | Works with Laravel 10+ (PHP 8.2+). |
| Operating Systems | Cross-platform (Linux/macOS/Windows with WSL). |
| Shell Support | Supports Bash/Zsh; completions available. |
| Existing Tools | Overlaps with Forge/Envoyer; assess redundancy |
How can I help you explore Laravel packages today?