- How do I install Laravel Cloud CLI for Laravel deployments?
- Clone the repo with `gh repo clone laravel/cloud-cli`, run `composer install`, then add a shell alias like `alias cloud="php /path/to/cloud-cli/cloud"` to your `.bashrc` or `.zshrc`. Ensure PHP 8.2+ and GitHub CLI (`gh`) are installed first.
- Can I use this CLI for Laravel Vapor deployments?
- Yes, the CLI supports Laravel Cloud, which includes Vapor deployments. Use `cloud ship` for guided setup or `cloud deploy` for manual deployments. Vapor-specific configurations (like serverless functions) are managed via the same workflows.
- What Laravel versions does the Cloud CLI support?
- The CLI itself requires PHP 8.2+, but it works with any Laravel version deployed to Laravel Cloud. Check your Laravel app’s compatibility with Cloud’s runtime environment (e.g., PHP 8.2+) via `cloud ship` or the [Laravel Cloud docs](https://cloud.laravel.com).
- How do I authenticate the CLI for CI/CD pipelines?
- Use `cloud auth:token` to generate a machine-readable token and store it as a CI secret. Avoid browser OAuth in CI. For security, restrict tokens to specific permissions (e.g., `cloud auth:token --scopes=deploy,read`).
- Does the CLI support multi-environment deployments?
- Yes. Run `cloud repo:config` to link your repo to a Laravel Cloud app, then specify environments with `--environment=staging` or set defaults. Use `cloud deploy --environment=production` to target specific environments during CI/CD.
- How do I monitor billing usage for Laravel Cloud apps?
- Use the new `cloud billing:usage` command to fetch cost data for apps/environments. Filter by time (e.g., `--month=january`) or output JSON for scripts. Requires `billing:read` permissions—audit your Laravel Cloud account’s access levels first.
- Will this CLI work if I don’t use GitHub?
- GitHub CLI (`gh`) is only required for OAuth and repo linking. Billing commands (`cloud billing:usage`) work without GitHub if you’re already authenticated. For non-GitHub workflows, use `cloud auth` with a browser-based OAuth flow.
- Are there rate limits for billing API calls?
- Yes, billing endpoints may have stricter rate limits than deployment APIs. Test high-frequency usage in CI/CD with `--json` output to avoid throttling. Monitor Laravel Cloud’s API status page for updates. For bulk exports, script multiple calls with delays.
- Can I integrate billing data with external tools like QuickBooks?
- The CLI outputs billing data in JSON format (`--json`), which you can parse into CSV or APIs. For automation, use scripts to aggregate data across projects. Laravel Cloud’s web dashboard may offer better export tools for financial systems—check their API docs.
- What alternatives exist for Laravel Cloud deployments?
- For deployments, consider Laravel Forge (for traditional servers) or direct Laravel Cloud API calls. For billing, third-party tools like Stripe or Paddle may integrate better if you’re not using Laravel Cloud’s native billing. The CLI is ideal if you prefer terminal workflows and Laravel Cloud’s unified ecosystem.