Add --project-id/--org-id/--branch-id to neon init - #426
Closed
jeff-at-neon wants to merge 1 commit into
Closed
Conversation
Let returning users skip org/project discovery by naming an existing project up front. When --project-id is given, the getting-started flow collapses its org/project select-or-create chain into a single verified `neon link` step (infers org, records branch, writes .neon); --org-id alone scopes project selection to that org, and --branch-id targets a branch for env pull. Works in both agent and interactive modes. Co-authored-by: Isaac
Contributor
Author
|
Superseded by #428, which makes |
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
neon init—--project-id,--org-id,--branch-id— that streamline setup for users who already have a Neon project, in both agent and interactive modes.--project-idis provided, the getting-started flow collapses its org/project select-or-create-or-context chain into a single verifiedneon linkstep (verifies the IDs against the account, infers the org, records the branch, and writes.neon).--org-idalone scopes project selection to that org and skips org selection;--branch-idis recorded in.neonsoneon env pulltargets that branch.assertSafeIdinsrc/init/ids.ts) before any shell interpolation, so a malformed ID is rejected early in the caller's expected shape (JSON in agent mode).--data '{"step":"db"}'agent path also gainsbranchId, threaded into the connection-string command andproject_readypayload.Behavior
--project-idlink, then env pull--org-idalone--branch-id.neonso env pull targets that branchThe no-ID path is byte-identical to before (only the
--helpsnapshot changed, to list the new flags).Test plan
pnpm typecheck(tsc --noEmit)vitest runinit suites — 310/310 pass (agent_snapshot,init,route_command,orchestrate)--helpsnapshot (adds the three flags only)--help; malformed--project-idrejected as JSON in agent modeneonpackage releaseThis pull request and its description were written by Isaac.