Connect the CLI to 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.
- 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:
Verify the saved URL:
If the deployment requires authentication, log in after configuring the URL:
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:
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:
Switch the current context:
Verify the switch:
Inspect all saved connections:
To target a context for one command without switching, use the global --context option:
Connect to a local deployment
A local platform can coexist with remote contexts:
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.
Next Steps
- Review the configuration reference for fields and precedence.
- Run
nemo workspaces listto verify platform access. - Use CLI troubleshooting if the connection fails.