From 51a0ddbaf81e4ef9cc123def1b49a03ff633603a Mon Sep 17 00:00:00 2001 From: Joe Tannenbaum Date: Mon, 30 Nov 2026 10:36:06 -0500 Subject: [PATCH 1/3] abandon package for npm version --- README.md | 11 +++++ app/Middleware/AnnouncesAbandonment.php | 35 ++++++++++++++++ app/Providers/AppServiceProvider.php | 2 + composer.json | 1 + skills/deploying-to-cloud/SKILL.md | 8 ++-- tests/Feature/AnnouncesAbandonmentTest.php | 49 ++++++++++++++++++++++ 6 files changed, 102 insertions(+), 4 deletions(-) create mode 100644 app/Middleware/AnnouncesAbandonment.php create mode 100644 tests/Feature/AnnouncesAbandonmentTest.php diff --git a/README.md b/README.md index 7fa5fafa..95ab8a86 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,16 @@ # Laravel Cloud CLI +> [!WARNING] +> This package is abandoned and will receive no more updates. Use [`@laravel/cloud-cli`](https://www.npmjs.com/package/@laravel/cloud-cli) instead: +> +> ```sh +> npm install -g @laravel/cloud-cli +> # or +> brew install laravel/tap/cloud +> ``` +> +> Remove this one with `composer global remove laravel/cloud-cli` or `composer remove --dev laravel/cloud-cli`. The new CLI reads the same `~/.config/cloud/config.json`, so your saved tokens carry over. + A Laravel Zero CLI for deploying and managing applications on [Laravel Cloud](https://cloud.laravel.com). Authenticate via OAuth, create and manage applications, environments, databases, caches, object storage, domains, and more—all from the terminal. ## Requirements diff --git a/app/Middleware/AnnouncesAbandonment.php b/app/Middleware/AnnouncesAbandonment.php new file mode 100644 index 00000000..ede7cde9 --- /dev/null +++ b/app/Middleware/AnnouncesAbandonment.php @@ -0,0 +1,35 @@ +laravel/cloud-cli is abandoned and will receive no more updates. + Install its replacement with npm install -g @laravel/cloud-cli or brew install laravel/tap/cloud. + Your saved tokens carry over. Learn more: https://www.npmjs.com/package/@laravel/cloud-cli + + TXT; + + public function handle($command, callable $next) + { + // JSON errors go to stderr, so the notice would corrupt them for machine readers. + if (! $this->isInternalCommand($command) && ! Renderer::$suppressOutput) { + $this->output()->writeln(self::MESSAGE); + } + + return $next(); + } + + protected function output(): OutputInterface + { + return (new ConsoleOutput)->getErrorOutput(); + } +} diff --git a/app/Providers/AppServiceProvider.php b/app/Providers/AppServiceProvider.php index bcc67192..1d4337ca 100644 --- a/app/Providers/AppServiceProvider.php +++ b/app/Providers/AppServiceProvider.php @@ -2,6 +2,7 @@ namespace App\Providers; +use App\Middleware\AnnouncesAbandonment; use App\Middleware\CommandMiddlewareManager; use App\Middleware\OffersSkillsInstall; use App\Middleware\RequiresAuthToken; @@ -82,6 +83,7 @@ protected function registerCommandMiddleware(): void $manager = $this->app->make(CommandMiddlewareManager::class); $manager->register(SuppressOutputIfJson::class); + $manager->register(AnnouncesAbandonment::class); $manager->register(RequiresAuthToken::class); $manager->register(OffersSkillsInstall::class); diff --git a/composer.json b/composer.json index a88bb82f..68186f40 100644 --- a/composer.json +++ b/composer.json @@ -8,6 +8,7 @@ ], "homepage": "https://cloud.laravel.com", "type": "project", + "abandoned": "https://www.npmjs.com/package/@laravel/cloud-cli", "license": "MIT", "support": { "issues": "https://github.com/laravel/cloud-cli/issues", diff --git a/skills/deploying-to-cloud/SKILL.md b/skills/deploying-to-cloud/SKILL.md index ac3577f9..8951f67a 100644 --- a/skills/deploying-to-cloud/SKILL.md +++ b/skills/deploying-to-cloud/SKILL.md @@ -7,7 +7,7 @@ metadata: --- # Deploying with Laravel Cloud -Use the [Laravel Cloud documentation](https://cloud.laravel.com/docs/llms.txt) for detailed, current feature behavior. Use the Cloud CLI for Cloud operations rather than guessing dashboard or API workflows. Install it in the project and invoke it as `./vendor/bin/cloud` by default; use a globally installed `cloud` command only as a fallback. Commands below are written as `cloud` for brevity; run them as `./vendor/bin/cloud` unless falling back to the global installation. +Use the [Laravel Cloud documentation](https://cloud.laravel.com/docs/llms.txt) for detailed, current feature behavior. Use the Cloud CLI for Cloud operations rather than guessing dashboard or API workflows. Install it globally from npm and invoke it as `cloud`. ## Application Setup @@ -57,11 +57,11 @@ Use the [Laravel Cloud documentation](https://cloud.laravel.com/docs/llms.txt) f ### Setup ```shell -composer require --dev laravel/cloud-cli -./vendor/bin/cloud auth -n +npm install -g @laravel/cloud-cli +cloud auth -n ``` -If a project-local installation is not available, install the CLI globally with `composer global require laravel/cloud-cli` and invoke it as `cloud`. +To run a single command without installing, as in a CI job, use `npx @laravel/cloud-cli `. The Composer package `laravel/cloud-cli` is abandoned; if a project still requires it, replace it with the npm package. `cloud auth` opens a browser. If a browser is unavailable, set `LARAVEL_CLOUD_TOKEN` in the environment. It overrides any saved token and writes nothing to disk. To save a token instead, run `cloud auth:token --add --token= -n` or pipe it with `echo "$TOKEN" | cloud auth:token --add -n`. diff --git a/tests/Feature/AnnouncesAbandonmentTest.php b/tests/Feature/AnnouncesAbandonmentTest.php new file mode 100644 index 00000000..4d5418d8 --- /dev/null +++ b/tests/Feature/AnnouncesAbandonmentTest.php @@ -0,0 +1,49 @@ +makePartial(); + $middleware->shouldAllowMockingProtectedMethods(); + $middleware->shouldReceive('output')->andReturn($output); + + return $middleware; +} + +it('points users to the npm package', function () { + $output = new BufferedOutput; + $called = false; + + abandonmentMiddleware($output)->handle('application:list', function () use (&$called) { + $called = true; + }); + + expect($called)->toBeTrue() + ->and($output->fetch()) + ->toContain('laravel/cloud-cli is abandoned') + ->toContain('npm install -g @laravel/cloud-cli'); +}); + +it('stays quiet for internal commands', function () { + $output = new BufferedOutput; + + abandonmentMiddleware($output)->handle('_complete', fn () => null); + + expect($output->fetch())->toBe(''); +}); + +it('stays quiet when output is JSON', function () { + Renderer::$suppressOutput = true; + $output = new BufferedOutput; + + abandonmentMiddleware($output)->handle('application:list', fn () => null); + + expect($output->fetch())->toBe(''); +}); From c61ea1c7830b75eab1eeca8d464484186cc5f99f Mon Sep 17 00:00:00 2001 From: Joe Tannenbaum Date: Mon, 30 Nov 2026 13:06:26 -0500 Subject: [PATCH 2/3] Update README.md --- README.md | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/README.md b/README.md index 95ab8a86..7fa5fafa 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,5 @@ # Laravel Cloud CLI -> [!WARNING] -> This package is abandoned and will receive no more updates. Use [`@laravel/cloud-cli`](https://www.npmjs.com/package/@laravel/cloud-cli) instead: -> -> ```sh -> npm install -g @laravel/cloud-cli -> # or -> brew install laravel/tap/cloud -> ``` -> -> Remove this one with `composer global remove laravel/cloud-cli` or `composer remove --dev laravel/cloud-cli`. The new CLI reads the same `~/.config/cloud/config.json`, so your saved tokens carry over. - A Laravel Zero CLI for deploying and managing applications on [Laravel Cloud](https://cloud.laravel.com). Authenticate via OAuth, create and manage applications, environments, databases, caches, object storage, domains, and more—all from the terminal. ## Requirements From 3a6dc440065a67f8fb519f47019a4a5d029d4f53 Mon Sep 17 00:00:00 2001 From: Joe Tannenbaum Date: Mon, 30 Nov 2026 13:10:57 -0500 Subject: [PATCH 3/3] Update AnnouncesAbandonment.php --- app/Middleware/AnnouncesAbandonment.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Middleware/AnnouncesAbandonment.php b/app/Middleware/AnnouncesAbandonment.php index ede7cde9..f6130437 100644 --- a/app/Middleware/AnnouncesAbandonment.php +++ b/app/Middleware/AnnouncesAbandonment.php @@ -12,7 +12,7 @@ class AnnouncesAbandonment implements CommandMiddleware use SkipsInternalCommands; public const MESSAGE = <<<'TXT' - laravel/cloud-cli is abandoned and will receive no more updates. + laravel/cloud-cli is abandoned and will no longer receive updates. Install its replacement with npm install -g @laravel/cloud-cli or brew install laravel/tap/cloud. Your saved tokens carry over. Learn more: https://www.npmjs.com/package/@laravel/cloud-cli