Weave Code
Code Weaver
Helps Laravel developers discover, compare, and choose open-source packages. See popularity, security, maintainers, and scores at a glance to make better decisions.
Feedback
Share your thoughts, report bugs, or suggest improvements.
Subject
Message

Cloud Cli Laravel Package

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.

View on GitHub
Deep Wiki
Context7

Technical Evaluation

Architecture Fit

The laravel/cloud-cli package is a Laravel Zero application, meaning it is a lightweight, self-contained CLI tool built on Laravel’s ecosystem. This aligns well with Laravel-based projects, particularly those leveraging Laravel Cloud for hosting, as it provides a native integration with the platform’s API and workflows. The CLI abstracts complex API interactions (e.g., OAuth, environment management, deployments) into human-readable commands, reducing cognitive load for developers.

Key architectural strengths:

  • Modular design: Commands are grouped by resource type (e.g., application, environment, database), enabling granular control over Laravel Cloud infrastructure.
  • Laravel Zero foundation: Leverages Laravel’s artisan-like CLI patterns, making it intuitive for Laravel developers.
  • Interactive + programmatic: Supports both interactive prompts (e.g., cloud ship) and machine-readable JSON output (e.g., cloud environment:list --json), catering to CI/CD pipelines and automation.
  • GitHub CLI (gh) dependency: Tightly couples with GitHub for repo linking, assuming projects are version-controlled via GitHub (common for Laravel projects).

Integration Feasibility

Integration feasibility depends on the target stack:

  1. Laravel Projects:

    • High feasibility: The CLI is purpose-built for Laravel Cloud, with commands like cloud deploy and cloud ship designed for Laravel applications. Assumes:
      • Use of Laravel’s deployment artifacts (e.g., artisan commands, .env files).
      • Compatibility with Laravel Cloud’s runtime environment (PHP 8.2+, Composer, etc.).
    • Repo configuration: The cloud repo:config command links a Git repo to a Laravel Cloud app, enabling context-aware deployments (e.g., auto-selecting the correct app/environment).
  2. Non-Laravel Projects:

    • Low feasibility: The CLI is Laravel-specific in its assumptions (e.g., .env files, artisan hooks). While it could theoretically manage infrastructure (e.g., databases, caches), it lacks generality for non-Laravel stacks.
  3. CI/CD Pipelines:

    • High feasibility: Supports JSON output and API token management, making it suitable for automation. Example:
      # GitHub Actions example
      - name: Deploy to Laravel Cloud
        run: php vendor/bin/cloud deploy --json
      
    • Token handling: Uses cloud auth:token for CI-friendly authentication (avoids browser-based OAuth).

Technical Risk

Risk Area Assessment Mitigation Strategy
Dependency Lock-in Relies on Laravel Cloud API and GitHub CLI. Changes to either could break the CLI. Monitor Laravel Cloud API deprecations; abstract API calls behind interfaces if extending the CLI.
GitHub Dependency Requires gh CLI for repo linking. Projects not on GitHub (e.g., GitLab, Bitbucket) are unsupported. Document workaround (e.g., manual repo config) or explore GitLab CLI alternatives.
PHP Version Requires PHP 8.2+. Older Laravel projects may not be compatible. Enforce PHP 8.2+ in CI/CD; provide downgrade guidance if needed.
Authentication OAuth flow requires browser access (problematic for headless CI). Use cloud auth:token with pre-generated tokens in CI.
Repo Configuration Assumes Git repo structure. Non-standard repos (e.g., monorepos) may cause issues. Validate repo structure in cloud repo:config; add error handling for edge cases.
Laravel-Specific Commands like cloud deploy assume Laravel’s deployment workflow (e.g., artisan commands). Non-Laravel apps may need custom scripting. Provide hooks for custom deployment scripts; document limitations.
Shell Integration Requires manual alias setup (~/.zshrc/~/.bashrc). Offer composer global installation option or package as a laravel-zero global command.

Key Questions for Stakeholders

  1. Target Audience:

    • Is the primary use case Laravel developers deploying to Laravel Cloud, or will this be used by DevOps teams managing multi-language stacks?
    • If the latter, how will non-Laravel deployments be handled?
  2. CI/CD Strategy:

    • Will authentication be managed via OAuth tokens (CI-friendly) or browser-based OAuth (developer-friendly)?
    • Are there existing CI/CD pipelines that need to integrate with this CLI?
  3. Git Hosting:

    • Are all projects hosted on GitHub, or will alternatives (GitLab, Bitbucket) require workarounds?
  4. Deployment Workflow:

    • Does the team use Laravel’s default deployment artifacts (e.g., artisan commands), or are custom scripts needed?
    • Are there pre/post-deploy hooks required beyond what the CLI provides?
  5. Scaling:

    • Will this CLI manage multiple Laravel Cloud accounts (e.g., staging/production)? If so, how will context switching be handled?
    • Are there plans to extend the CLI for custom resources (e.g., third-party databases)?
  6. Maintenance:

    • Who will monitor Laravel Cloud API changes and update the CLI accordingly?
    • Is there a fallback plan if the CLI becomes deprecated or unsupported?

Integration Approach

Stack Fit

The laravel/cloud-cli is optimized for Laravel-based stacks using Laravel Cloud. It fits best in the following scenarios:

Stack Component Fit Level Notes
Laravel Applications High Native support for Laravel’s deployment workflows (e.g., artisan, .env files). Commands like cloud ship and cloud deploy are Laravel-aware.
Laravel Cloud Native Direct API integration for managing apps, environments, databases, caches, etc.
GitHub Repositories High Uses gh CLI for repo linking; assumes GitHub-hosted code.
PHP 8.2+ High Minimum requirement aligns with modern Laravel versions.
Composer High Installed as a Composer dependency or global CLI tool.
CI/CD (GitHub Actions) High Supports JSON output and token-based auth for automation.
Non-Laravel Apps Low Limited utility; infrastructure management (e.g., databases) is possible but lacks Laravel-specific optimizations.
GitLab/Bitbucket Low No native support; workarounds required for repo linking.

Migration Path

If adopting this CLI, follow this phased migration approach:

Phase 1: Evaluation (1-2 weeks)

  1. Install and Test:

    • Clone and install the CLI in a non-production Laravel project:
      gh repo clone laravel/cloud-cli
      cd cloud-cli
      composer install
      
    • Set up authentication and repo config:
      cloud auth
      cd /path/to/laravel-app
      cloud repo:config
      
  2. Test Core Workflows:

    • Deploy a staging environment using cloud ship or cloud deploy.
    • Verify environment variables, databases, and domains can be managed via CLI.
    • Test CI/CD integration with a sample workflow (e.g., GitHub Actions).
  3. Document Gaps:

    • Identify missing features (e.g., custom deployment scripts, non-GitHub repos).
    • Assess compatibility with existing deployment tools (e.g., Forge, Envoyer).

Phase 2: Pilot (2-4 weeks)

  1. Select a Pilot Project:
    • Choose a low-risk Laravel application (e.g., internal tool, non-critical service).
  2. Replace Manual Deployments:
    • Migrate from manual ssh/scp deployments to cloud deploy.
    • Automate post-deploy tasks (e.g., database migrations, cache warming) using cloud command:run.
  3. Integrate with CI/CD:
    • Replace custom deployment scripts with cloud deploy --json in pipelines.
    • Example GitHub Actions workflow:
      - name: Deploy to Laravel Cloud
        run: php vendor/bin/cloud deploy --json
        env:
          CLOUD_TOKEN: ${{ secrets.LARAVEL_CLOUD_TOKEN }}
      
  4. Monitor and Iterate:
    • Track deployment success rates, failure modes, and developer feedback.
Weaver

How can I help you explore Laravel packages today?

Conversation history is not saved when not logged in.
Prompt
Add packages to context
No packages found.
calmfox/watch-sylius
damienfern/grpc-symfony-bundle
atoolo/index-bundle
atoolo/genai-bundle
coprotoai/laravel-ticket
davidjln/llm-carbon-bundle
cryonighter/valid-request-bundle
coolms/taxonomy-bundle
coolms/field-bundle
articulate-orm/symfony
aaix/laravel-tall-architect
ephoto/akeneo-connector
emmanuelballery/eb-plantumlbundle
emielburgman/symfony-visitor-beacon
emielburgman/symfony-visit-storage
emielburgman/symfony-security-headers
emielburgman/symfony-log-viewer
emarref/xdebug-bundle
emarref/pubnub-bundle
elriseio/finance-money-bundle