Avoid repeating project and organization flags
Local development
Neon · Command
Saves Neon project, organization, and optionally branch context for later CLI commands. Use a default .neon file or select a named context file with --context-file.
The command stores project, organization, and optionally branch context in a default .neon file or a file selected with --context-file. Later CLI commands can use that context instead of repeating identifiers; running the command without options clears the current context.
neon set-context [options]| Name | Type | Description |
|---|---|---|
--branch-id | string | Branch ID to save in the context. |
--org-id | string | Organization ID to save in the context. |
--project-id | string | Project ID to save in the context. |
--context-file | string | Path to a context file other than the default .neon file. |
Creates or updates a context file; with no options, clears the current context.
.neon.--context-file option to choose a different context-file path.neon set-context --project-id patient-frost-50125040 --org-id org-bright-sky-12345678 --context-file .neon-devSaves project and organization identifiers in a named context file for subsequent CLI commands.
Local development
Multiple projects
Cleanup
It saves CLI context, such as a project or organization identifier, to a .neon file so later commands do not need those flags repeatedly. The default file is in the current directory unless --context-file selects another file.
Follow-up: How would you maintain separate contexts? Use different named files with --context-file, then pass the desired file to subsequent commands.
Use neon set-context --project-id <project-id> --org-id <org-id>. At least one of the project, organization, or branch options must be provided.
Follow-up: How can a branch be included? Add --branch-id <branch-id> to the command.
Run neon set-context with no options to clear the current context, or delete the default .neon file or the selected custom context file. This removes the stored context used by later commands.
Follow-up: How can a later command select a named context? Add --context-file <file> to that command.
neon branches listneon projects list--context-file