CLI & Remote Agents
CLI Servers & Credentials
The CLI can keep credentials for more than one Unmeshed server at a time. It tracks one active server and uses that server for commands such as run, call, search, update, and upload.
Log in to a server
The login command can run interactively or non-interactively.
Examples:
The current login flow:
- Reads the instance URL and API key from flags, environment variables, stdin, or prompts
- Verifies the credentials by calling
/api/namespaces - Stores the credentials using the configured credential store
- Saves the server and sets it as active
Supported login inputs:
--url--api-key--api-key-stdinreads the API key from stdin--non-interactivefails instead of prompting when required login inputs are missing
If you need to disable TLS verification for a specific server entry, use:
That flag is stored with the server record, so later CLI calls to that server use the same TLS mode.
Work with multiple servers
Show or switch the active server
Use:
Behavior to expect:
unmeshed server activeprints the active server and whether SSL verification is enabled or disabled for it.unmeshed server listis interactive in a terminal. You can move through the configured servers and press Enter to make one active.- In non-interactive output,
unmeshed server listprints the configured servers and marks the active one.
Log out
Use one of these patterns:
Current behavior:
- With one configured server,
unmeshed logoutremoves that server directly. - With multiple configured servers,
unmeshed logoutopens an interactive selection list. unmeshed logout --alldeletes the credential file after confirmation.
Default credential storage
The CLI defaults to local-file storage when no external credential store is configured.
The default credentials file is:
The CLI writes that file with restrictive 0600 permissions.
When you stay on the default storage mode, ~/.unmeshed.ini holds:
- the active server
- the configured server URLs
- the API keys
- each server's
disable_ssl_verificationsetting
When no external credential store is configured, unmeshed login stores credentials in this local file automatically.
Configure credential storage
Run:
The current storage choices are:
local-fileazure-key-vault
Local-file behavior
When local-file is selected:
- API keys stay in
~/.unmeshed.ini - no external vault is required
- the CLI reads the API key directly from the file
Azure Key Vault behavior
When azure-key-vault is selected:
- the CLI expects the host to already have Azure credentials that can access the target vault
- the CLI performs a connectivity test by writing and reading a temporary secret
- the API key for each server is stored in Azure Key Vault
- the CLI keeps server metadata locally in
~/.unmeshed.ini
With Azure Key Vault enabled, the local file still stores:
- the active server
- each server URL
- the Key Vault configuration
- each server's
disable_ssl_verificationsetting - the local reference to the secret name (
api_key_secret_ref)
The actual API key value lives in Key Vault. At runtime, the CLI resolves the secret and loads the current value before making API calls. That means you can rotate the secret outside the CLI and the CLI will read the updated value when it needs it.
Automation note
For automation, unmeshed login can be scripted with flags, environment variables, or stdin. Even so, avoid depending on interactive server switching. Use separate runners or separate home directories per environment instead, and let each environment keep its own ~/.unmeshed.ini with the right active server already selected.