cli: auto-run deploy command in node new / node edit when possible (#111)#116
Open
zjma wants to merge 1 commit into
Open
cli: auto-run deploy command in node new / node edit when possible (#111)#116zjma wants to merge 1 commit into
node new / node edit when possible (#111)#116zjma wants to merge 1 commit into
Conversation
#111) Today `node new` / `node edit` print the gcloud / docker command and ask the user to run it in another terminal, then prompt for the URL. If the relevant CLI is installed and reachable, offer to run the command inline. - New `cli/src/auto-deploy.ts`: * `gcloudReady()` — checks `gcloud --version` and that an ACTIVE account exists. * `dockerReady()` — checks `docker info`. * `maybeAutoRun(script, preflight, prompt)` — confirms with the user, runs via `bash -c`, streams stdio. * `captureCloudRunUrl(svc, project, region)` — pulls the auto-assigned URL post-deploy so `node new` can pre-fill the endpoint prompt. - Wired into: * `onboarding.ts` for `node new` (gcp-monolith, gcp-microservices, docker-monolith). For Cloud Run, the captured URL is passed as the default to `promptEndpoint`. * `commands/edit-node.ts` for `node edit` (same three schemes). The printed command is unchanged and remains the source of truth — if preflight fails or the user declines, the flow matches today's behavior. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Fixes #111. Today
node new/node editprint the gcloud (or docker) command and ask the user to run it in another terminal, then prompt for the URL. If the relevant CLI is installed and reachable, offer to run it inline.cli/src/auto-deploy.ts:gcloudReady()—gcloud --versionsucceeds ANDgcloud auth list --filter=status:ACTIVEreturns a non-empty account.dockerReady()—docker infosucceeds.maybeAutoRun(script, preflight, prompt)— confirms with the user, runs viabash -c, streams stdio.captureCloudRunUrl(svc, project, region)—gcloud run services describe ... --format='value(status.url)'to pre-fill the endpoint prompt innode new.onboarding.tsandcommands/edit-node.tsfor the three deploy-emitting schemes (gcp-monolith, gcp-microservices, docker-monolith).local-build-monolithwas already auto-spawned; unchanged.The printed command stays exactly as before and is the source of truth — if preflight fails or the user declines, the flow matches today's "run this yourself" behavior.
Test plan
pnpm typecheck/pnpm buildclean.gcloudReady()anddockerReady()smoke-tested viatsx -e— both{ ok: true }in my env.node new+node editagainst a throwaway GCP service (will verify when I next spin one up).node new+node editfor docker-monolith.🤖 Generated with Claude Code