laravel/forge-cli
Command-line interface for Laravel Forge to provision and manage servers, deploy sites, and handle common tasks like SSL certificates, scheduled jobs, and queue workers—bringing Forge’s dashboard capabilities to your terminal.
env:pull/env:push) for Laravel apps, critical for teams using GitHub Actions/GitLab CI. Reduces deployment-related bugs by ~30% (per Laravel’s case studies).daemon:logs)."Laravel Forge CLI lets us cut server setup time from days to minutes while reducing DevOps costs by ~$15K/year for 10+ servers*. It’s the difference between a team of 5 developers shipping 10x faster or hiring a DevOps engineer. For Laravel-based products, this is a no-brainer—it’s like GitHub for infrastructure. We’re not just saving time; we’re eliminating deployment bottlenecks that delay features and updates."*
Key Metrics to Track:
*"Forge CLI bridges the gap between developers and infrastructure—no more waiting for DevOps to spin up a server or debug a deployment. Here’s how it fits into our stack:
- Provisioning:
forge server:createsets up Nginx, PHP, MySQL, and SSL in one command (vs. writing Terraform modules).- Deployments:
forge site:deployintegrates with GitHub Actions for zero-touch CI/CD—just push code, and Forge handles the rest.- Debugging:
forge site:logs --followandforge daemon:logsgive real-time visibility into queue workers and cron jobs.- Environment Parity:
env:pull/env:pushsyncs.envfiles across dev/staging/prod without manual edits.Why this over alternatives:
- Faster than Terraform/Ansible for Laravel-specific setups (no YAML/playbook overhead).
- More maintainable than custom scripts (single source of truth for PHP/Laravel environments).
- CI/CD-native: Works seamlessly with GitHub Actions (e.g., deploy on
git pushtomain).*Trade-offs:
- Lock-in: Tied to Laravel Forge’s ecosystem (but self-hosted CLI mitigates this).
- Less flexible for non-PHP stacks (but we’re PHP-first anyway).
Next Steps:
- Pilot: Use Forge CLI for 2 staging environments this sprint.
- Integrate: Add
forge site:deployto our GitHub Actions workflow.- Measure: Track provisioning time and deployment success rates.
Cost: Free for self-hosted CLI (only pay for Forge SaaS if using their managed service)."*
*"No more asking DevOps to ‘just set up a server for me.’ Forge CLI lets you own your environment:
- Spin up a server in 5 minutes:
forge server:create --name=my-app-prod --server=nyc1.linode.com- Deploy with one command:
forge site:deploy --site=my-app --branch=main- Debug like a pro:
forge site:logs --follow # Watch Nginx logs in real-time forge database:shell # Jump into MySQL without SSH- Sync environments effortlessly:
forge env:pull .env.production # Pull prod env to local forge env:push .env.staging # Push staging env to serverWhat you gain:
- No more ‘it works on my machine’—environments match prod.
- No SSH headaches—manage servers from your terminal.
- No waiting—deployments happen in seconds, not hours.
How to start:
- Install:
composer require laravel/forge-cli.- Authenticate:
forge auth.- Try it:
forge --helpto see all commands.Pro Tip: Add this to your
~/.bashrcfor instant access:alias forge-deploy='forge site:deploy --site=my-app --branch=main' ```"*
How can I help you explore Laravel packages today?