sincecutoff.com
← all changes

neonctl link binds a directory to a Neon project

Introduced 2026-06-04 · score 0.98

HOW TO USE IT

When you need subsequent `neonctl` commands in a directory or its subdirectories to use a Neon project context, run `neonctl link` there. Use interactive prompts, the documented flags or `--params` for scripts, or `--agent` for the JSON follow-up flow; the command writes `.neon` with organization, project, and default branch context.

neonctl link
neonctl link --org-id <org-id> --project-id <project-id>
neonctl link --params '{"orgId":"<org-id>","projectName":"<project-name>","regionId":"<region-id>"}'

WHY THIS HELPS

Link a repository directory to a Neon project so subsequent CLI commands can use that directory’s project context.

BEFORE THIS CHANGE

Use the lower-level `neonctl set-context` command to write project context manually; `link` is documented as a wrapper around that primitive.

REQUIREMENTS AND LIMITATIONS

  • Version: v2.22.2
  • --org-id: Organization ID; used to choose the organization for linking or project creation.
  • --project-id: Existing project ID to link.
  • --project-name: Name for a project to create and link.
  • --region-id: Region ID for the project being created; the agent flow can omit it to receive available regions.
  • --params: JSON payload form of the linking parameters; documented keys are `orgId`, `projectName`, and `regionId`.
  • --agent: Returns a JSON state-machine response with status, available options, and a follow-up command template.
  • Prerequisite: Install neonctl; the v2.22.2 README specifies Node.js 18.0 or higher for the npm installation.
  • Prerequisite: Authenticate with `neonctl auth` or provide a Neon API key with `--api-key` when running a CLI command.
  • Interactive mode is the default.
  • Non-interactive linking uses flags or `--params` JSON.
  • Agent mode returns a JSON object with a status discriminator, available options, and a follow-up command.

FIRST-PARTY EVIDENCE

Check the installed version and the source before using it. Entry JSON

Report a problem with this card