Make neon init minimal: install tooling, then hand off to the agent - #428
Open
jeff-at-neon wants to merge 13 commits into
Open
Make neon init minimal: install tooling, then hand off to the agent#428jeff-at-neon wants to merge 13 commits into
neon init minimal: install tooling, then hand off to the agent#428jeff-at-neon wants to merge 13 commits into
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
`neon init` now authenticates and installs the Neon tooling (MCP server, agent skills, and the editor extension in a VS Code–based IDE), then hands off to the agent. It no longer selects an org/project, links the directory, pulls env vars, asks which features to enable, or provisions Auth / Object Storage / Functions / AI Gateway — the installed Neon skill drives that from here (or run `neon link` yourself). - Removed flags: --preview, --project-id, --org-id, --branch-id, --skip-migrations. - Agent --data steps reduced to auth, setup, mcp, skills (getting-started, db, migrations, neon-auth, status, finalize removed). - Interactive init no longer scaffolds templates or configures Neon Auth. - Deleted phases/support: getting_started, neon_auth (phase only; the top-level `neon neon-auth` command stays), migrations, db, cleanup, status, resolve_context, ids. - The standalone `neon bootstrap` command is unaffected. Co-authored-by: Isaac
6 tasks
`neon init` no longer emits the getting-started org/project/env sequence, so
the e2e that drove `{step:"getting-started"}` (and asserted the emitted
`orgs list` / `projects create` / `env pull` commands) no longer applies —
it was hitting the "Unknown step" error and exiting 1.
Replace it with a credential-free check that the `setup` step still answers
with an `agent_check` and installs nothing into the working directory just by
being asked, and keep the unknown-step guard.
Co-authored-by: Isaac
`neon init` installs the Neon CLI (ensureNeonctl), so once a `neon` binary is on PATH the flow now emits bare `neon ...` for the commands it hands to agents/users — driving the installed CLI directly instead of paying npx's resolution cost on every command. When nothing is installed yet (a first run started with `npx neon init`, before setup installs the CLI), it falls back to `npx -y neon` so the emitted command still works. Detection runs per call, at response-build time, so the prefix reflects the machine's current state. Regenerated the agent_snapshot fixtures: the hermetic run has a `neon` stub on PATH, so the emitted prefix is now `CI= neon`. Co-authored-by: Isaac
`neon init` now installs and version-checks the `neon` npm package (its binary, `npm view`, and the local-dev-symlink guard all target `neon`) instead of `neonctl`. This lines up with the command prefix the flow emits (`neon`), so the CLI it installs is the one the agent is told to run. Updated the agent_snapshot PATH stub to version `neon` (rather than `neonctl`) and regenerated the fixtures — the only change is the recorded subprocesses (`neon --version` / `npm view neon version`). Co-authored-by: Isaac
The defaults option now reads "Use defaults (MCP: global, skills:project-level, install extension later) (Recommended)". Regenerated the agent_snapshot fixtures for the new label. Co-authored-by: Isaac
- Factor the `neon` vs `npx -y neon` choice into a shared neonBin() helper and use it for the `neon init` chaining commands too (enrich_output), not just neonctlCmd — so a first run started with `npx neon init` doesn't emit chaining commands that fail before the CLI is installed. - Correct the neonctlCmd doc (the neon package ships only the `neon` binary). - Recognize a bare bin symlink in isLocalDevSymlink: a `neon` symlink resolving outside node_modules is a developer build, so skip the global install instead of failing with EEXIST when npm can't overwrite it. Gated on the bin being a symlink so real installs and test stubs still take the normal path. Co-authored-by: Isaac
Co-authored-by: Isaac
Reconciles the minimal-init rewrite with main's independent rework of the same init subsystem: - --profile: adopt main's #447 behavior (init honors --profile/--config-dir via auth.ts + profile_cli.ts) and drop this branch's refusal block. - MCP install: adopt main's #440 add-mcp library (installNeonMcpServer) in both the setup phase and the interactive flow, replacing the direct `npx add-mcp` calls. - neonBin(): folded into profile_cli's neonInitAgentCmd and neonctlCmd so emitted commands use the installed `neon` binary when present, else `npx -y neon`. - interactive.ts: re-derived minimal on main's AgentType API — installs tooling, then hands off to the agent (no template scaffolding, feature selection, Neon Auth, or link/pull). - skills.ts / neonctl.ts: took main's supersets (preview param unused by minimal init; neon-package install already on main). - Removed the status/resolve_context modules and status.test.ts; updated tests that referenced the removed steps. Co-authored-by: Isaac
`enrich_output` stays real in this test, so the emitted command runs through `neonBin()`, which prefers an installed `neon` on PATH and falls back to `npx -y neon`. Mock `which` so the assertion is stable whether or not the test machine has `neon` installed globally (it passed locally with a dev symlink on PATH, but CI has none), and expect the `npx -y neon` form to match. Co-authored-by: Isaac
- interactive.ts: remove the unused `homeDir` guard carried over from main's version — the minimal flow never reads it (agent selection uses detectInstalledAgents, skills install reads HOME internally). - route_command.test.ts: the setup phase installs MCP through the add-mcp library now, not `npx add-mcp`; update the mock comment accordingly. Co-authored-by: Isaac
…on editor change - setup.ts: the manual skills-install fallback (shown when auto-install fails) built `skills add --agent <raw agentId>`, but the skills CLI expects the mapped skills-agent name (e.g. vscode → github-copilot). Use getSkillsAgentName(agentId) so the printed commands actually work — matching the mapping the real install (ensureSkillsUpToDate) and phases/skills.ts use. - interactive.ts: when the user picks "Configure a different agent", re-check whether the extension is installed for the newly chosen editors. Previously `extensionAlreadyInstalled` kept the value from the initial agent set, so the extension prompt could be wrongly shown or suppressed after switching. Co-authored-by: Isaac
Drops vsix.ts, extension.ts, scripts/set-vsx-gallery.mjs, and the generated build_config.ts entirely. Removes the installExtension option, extension_installed check, and the install step from the agent setup flow. Interactive mode no longer offers the extension prompt or install loop. Collapses the now-identical defaults/customize branches in handleSetupPhase and simplifies mergeCliInspection (no longer needs inspectProject). Stale snapshot deleted; will regenerate on next build+test. Co-authored-by: Isaac <no-reply@databricks.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
Makes
neon initminimal: it authenticates and installs the Neon tooling (MCP server, agent skills, and — in a VS Code–based IDE — the editor extension), then hands off to the agent. It no longer selects an organization or project, links the directory, pulls environment variables, asks which features to enable, or provisions Auth / Object Storage / Functions / AI Gateway. Connecting a database and configuring features is driven by the installed Neon skill (or a manualneon link).Changes
orchestrate.ts): reduced toauth → inspect(mcp + skills) → setup(install) → hand-off. No.neonreads/writes, no connection-string resolution.phases/setup.ts): installs the Neon CLI, MCP server, skills, and (optionally) the editor extension, then returns a terminal hand-off. Dropped feature selection, preview mode, template scaffolding, and.neonwrites.interactive.ts): installs tooling, then directs the user to finish in their agent or runneon link. Removed the template picker, feature prompt, and Neon Auth handling.neon init:--preview,--project-id,--org-id,--branch-id,--skip-migrations.--dataprotocol reduced toauth,setup,mcp, andskills. Removed thegetting-started,db,migrations,neon-auth,status, andfinalizesteps.getting_started,neon_auth(the phase only — the top-levelneon neon-authcommand is unchanged),migrations,db,cleanup,status,resolve_context,ids.neon bootstrapcommand is unaffected.Tests
orchestrate,setup,route_command, andinitunit tests for the minimal flow and pruned theagent_snapshotmatrix (removed-step cases dropped, snapshot regenerated).setupstep still answers with anagent_checkand installs nothing into the project just by being asked; the unknown-step guard is kept.This pull request and its description were written by Isaac.