Skip to content
This repository was archived by the owner on Nov 30, 2026. It is now read-only.

Add cache:start and cache:stop - #305

Closed
joetannenbaum wants to merge 2 commits into
mainfrom
api-sync/caches
Closed

joetannenbaum wants to merge 2 commits into
mainfrom
api-sync/caches

Conversation

@joetannenbaum

@joetannenbaum joetannenbaum commented Nov 25, 2026 •

Copy link
Copy Markdown
Collaborator

Adds cache:start and cache:stop for the two cache endpoints in the current API spec that the CLI didn't cover.

Findings

Endpoint Spec CLI before
POST /caches/{cache}/start Starts a stopped Laravel Valkey cache; answers 200 with CacheResource No request class or command
POST /caches/{cache}/stop Stops a Laravel Valkey cache, after which environments can't connect to it until it's started again; answers 200 with CacheResource No request class or command

Neither takes a request body. Both need the cache.edit permission.

Changes

  • StartCacheRequest / StopCacheRequest, plus start() and stop() on CachesResource.
  • cache:start {cache?} and cache:stop {cache?} {--force}. They resolve the cache the way cache:get does (ID or name, picker when interactive) and print the returned cache with --json, using the same Cache DTO as cache:get.
  • Stopping cuts environments off from the cache, so cache:stop goes through confirmDestructive() and needs --force when non-interactive. cache:start doesn't confirm.
  • README command table and the client README request list.

Tests

tests/Feature/CacheStartStopTest.php covers the request each command sends, the --json shape, and that cache:stop refuses to run headlessly without --force. The full suite (PromptFallbackTest skipped locally), PHPStan and Pint pass, re-run after rebasing on the current main.

Demo

This session could not embed the GIFs inline: image markdown was stripped on its way to GitHub, so they are plain links. Add a ! before each to make it play inline.

cloud cache:start

cache:start with no argument: pick a stopped cache, then it starts.

cloud cache:stop

cache:stop with no argument: pick a cache, confirm, then it stops.


Generated by Claude Code

The API can now start and stop a Laravel Valkey cache
(POST /caches/{cache}/start and /stop). Both commands resolve the cache
like cache:get and output the updated cache with --json. Stopping cuts
environments off from the cache, so cache:stop confirms and needs --force
when non-interactive.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T1Sq4Y2hkEm7aPHvpU9eP2
A long label overflows the confirm box on narrower terminals. The
README already explains what stopping does.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01T1Sq4Y2hkEm7aPHvpU9eP2
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants