laravel/forge-cli
Laravel Forge CLI is the command-line companion for Laravel Forge, letting you provision servers, deploy sites, and manage scheduled jobs, queue workers, and SSL certificates from your terminal.
Architecture fit
laravel/forge-cli is not a library you embed in an application — it is a Laravel Zero (standalone Symfony Console / Laravel components) binary that wraps the Laravel Forge v2 REST API and layers an SSH client on top of it. The architectural decision it implies is therefore not "which package do we install" but "do we accept Forge as our infrastructure control plane, and do we want to drive it from a terminal/CI rather than the dashboard."
That distinction drives everything a TPM should weigh:
.env pull/push, SSH configuration, database shell, daemon management.laravel/forge-sdk) is the better fit if we need Forge operations inside application code, a custom dashboard, or an internal admin tool. The CLI is the right fit for humans and pipeline steps.Integration feasibility
High for a Laravel/PHP shop already on Forge; moderate-to-low for anyone else.
composer global require laravel/forge-cli (or a project require-dev + vendor bin), so it lands in developer machines and CI images, not in production composer.json dependency graphs. This is why dependents: 0 on Packagist is not a red flag — it is the expected shape for a globally installed CLI.FORGE_API_TOKEN as an environment variable is explicitly supported for CI (added in v1.3.1), and non-interactive usage was hardened in v1.3.2. This is the single most important integration fact: the tool was designed to be scriptable, not just interactive.ssh, database:shell, log tailing) require a working local SSH identity and correct remote user/port. Custom SSH ports are honored (v1.8.1), and ssh:configure exists, but key distribution remains a human/ops prerequisite.Technical risk
FORGE_API_TOKEN as a standard CI secret understates it; scope it to a dedicated machine user and rotate it..0.x fixes (deploy log correctness, polling configuration) means early v2 adopters absorbed real bugs. We should not adopt a .0 release.env:push mutate production. There is no dry-run story documented; process controls (review, branch protection, manual approval gates) must substitute.Key questions
Stack fit
Strong fit if the stack is Laravel/PHP on Forge-managed servers; effectively no fit otherwise.
.env sync, SSH shortcuts, log tailing) without changing deployment architecture.require it into application code is an anti-pattern; use the Forge SDK for programmatic needs.Migration path
Adopt additively; there is no migration, only adoption.
server:list, site:list, and log-tailing commands against a non-critical Forge account. This validates auth, SSH, and the token model with zero mutation risk.ssh:configure guidance. Track whether engineers actually use it — if not, stop here, because the CI case is the only one with measurable ROI.FORGE_API_TOKEN from the CI secret store. Run it in parallel with the existing deploy path (or as a manual workflow_dispatch) and compare outcomes.Compatibility
ubuntu-latest drift is a common failure.Sequencing
.0.Maintenance
Support
FORGE_API_TOKEN, wrong remote user, or missing SSH key — not CLI bugs. A short runbook covering these three covers most tickets.Scaling
Failure modes
| Failure | Symptom | Blast radius | Mitigation |
|---|---|---|---|
| Token expired/revoked | Auth errors on every command | Blocks deploys | Documented rotation; alert on CI auth failures |
| Token over-scoped or leaked | Unauthorized provisioning/destruction | Account-wide | Dedicated machine user, least privilege, secret scanning |
| Forge API breaking change | CLI fails after an unpinned/auto upgrade | All automation | Pin version; upgrade deliberately with a canary site |
| Deploy poll timeout misconfigured | CI hangs or fails on slow deploys | One pipeline | Explicit interval/timeout; fail fast, don't retry blindly |
| Deploy step fails mid-run | Unclear whether deploy actually landed | One environment | Post-step verification via deploy:logs / status check, not exit code alone |
| SSH key absent or wrong user/port | ssh, database:shell, log tailing fail |
Developer-local only | ssh:configure; document custom ports and remote user |
env:push misuse |
Production secrets overwritten | High — data/config loss | Restrict to named operators; never in automated pipelines |
| Non-interactive prompt hang | Silent pipeline stall | One pipeline | Always pass explicit flags; keep steps non-interactive |
Ramp-up
server:list proves the whole chain.How can I help you explore Laravel packages today?