Connect the CLI to Deployments

View as Markdown

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:

$nemo config set --base-url https://nmp.example.com

Verify the saved URL:

$nemo config view

If the deployment requires authentication, log in after configuring the URL:

$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:

$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:

$nemo auth login --context staging
$nemo auth login --context production

Switch the current context:

$nemo config use-context staging

Verify the switch:

$nemo config current-context
$nemo config view

Inspect all saved connections:

$nemo config view --all-contexts

To target a context for one command without switching, use the global --context option:

$nemo --context production models list

Connect to a local deployment

A local platform can coexist with remote contexts:

$nemo config set --context local --base-url http://localhost:8080

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