-
Notifications
You must be signed in to change notification settings - Fork 20
feat(cli): improve multi-context UX and Config.write API #1072
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
anastasia-nesterenko
merged 2 commits into
main
from
anesterenko/aircore-931-document-nemo-config-cli-command-for-remote-access
Aug 7, 2026
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,97 @@ | ||
| --- | ||
| title: "Connect the CLI to Deployments" | ||
| description: "Configure, authenticate, and switch between NeMo Platform deployments." | ||
| --- | ||
|
|
||
| Use named CLI contexts to connect to one or more local or remote NeMo Platform deployments. | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| - Install the NeMo CLI as described in [Setup](/documentation/get-started). | ||
| - Obtain the base URL for each deployment. | ||
| - For an authenticated deployment, obtain an account that can complete its login flow. | ||
|
|
||
| ## Connect to a remote deployment | ||
|
|
||
| Save the deployment URL in the current CLI context: | ||
|
|
||
| ```bash | ||
| nemo config set --base-url https://nmp.example.com | ||
| ``` | ||
|
|
||
| Verify the saved URL: | ||
|
|
||
| ```bash | ||
| nemo config view | ||
| ``` | ||
|
|
||
| If the deployment requires authentication, log in after configuring the URL: | ||
|
|
||
| ```bash | ||
| nemo auth login | ||
| ``` | ||
|
|
||
| You can also run `nemo setup`. During interactive onboarding, setup offers to connect to a remote deployment when the configured platform is unreachable. It verifies and saves the URL, then runs the same authentication flow. | ||
|
|
||
| ## Connect to multiple deployments | ||
|
|
||
| A context is a user-defined name for a set of connection settings. Names such as `staging`, `production`, and `local` are labels you choose. Each context keeps its own URL, authentication credentials, workspace, and output preferences. | ||
|
|
||
| Create a context for each deployment. Use `--activate` to make one of them current: | ||
|
|
||
| ```bash | ||
| nemo config set --context staging --base-url https://nmp.staging.example.com | ||
| nemo config set --context production --base-url https://nmp.example.com --activate | ||
| ``` | ||
|
|
||
| If the saved configuration has no current context, the next written context becomes current automatically. Otherwise, creating another context does not switch the current context. | ||
|
|
||
| For authenticated deployments, log in to each context separately: | ||
|
|
||
| ```bash | ||
| nemo auth login --context staging | ||
| nemo auth login --context production | ||
| ``` | ||
|
|
||
| Switch the current context: | ||
|
|
||
| ```bash | ||
| nemo config use-context staging | ||
| ``` | ||
|
|
||
| Verify the switch: | ||
|
|
||
| ```bash | ||
| nemo config current-context | ||
| nemo config view | ||
| ``` | ||
|
|
||
| Inspect all saved connections: | ||
|
|
||
| ```bash | ||
| nemo config view --all-contexts | ||
| ``` | ||
|
|
||
| To target a context for one command without switching, use the global `--context` option: | ||
|
|
||
| ```bash | ||
| nemo --context production models list | ||
| ``` | ||
|
|
||
| ## Connect to a local deployment | ||
|
|
||
| A local platform can coexist with remote contexts: | ||
|
|
||
| ```bash | ||
| nemo config set --context local --base-url http://localhost:8080 | ||
| ``` | ||
|
|
||
| <Note> | ||
| `NMP_BASE_URL` and `NMP_CURRENT_CONTEXT` override saved configuration for all contexts. If switching contexts does not change the target deployment, unset those variables or update them for the current shell. | ||
| </Note> | ||
|
|
||
| ## Next Steps | ||
|
|
||
| - Review the [configuration reference](/documentation/reference/cli-reference/configuration) for fields and precedence. | ||
| - Run `nemo workspaces list` to verify platform access. | ||
| - Use [CLI troubleshooting](/documentation/reference/cli-reference/troubleshooting) if the connection fails. |
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
Uh oh!
There was an error while loading. Please reload this page.