Skip to content

Contexts

Commands for managing named configuration contexts. Contexts allow you to maintain multiple daemon/registry configurations and switch between them — useful when working across development, staging, and production environments.

create

Create a new named context with connection details for a daemon socket and registry server.

bash
vmr context create <NAME> [OPTIONS]

Arguments

ArgumentDescription
NAMEName for the new context

Options

FlagShortDescription
--socket-url <URL>-sDaemon socket URL (unix:, tcp://, or ssh://)
--registry-url <URL>-rRegistry server URL
--description <TEXT>-dHuman-readable description of this context
--set-currentImmediately switch to this context after creation

Examples

bash
vmr context create dev \
  --socket-url unix:/run/vm-registry-daemon.sock \
  --registry-url http://127.0.0.1:8080 \
  --description "Local development environment" \
  --set-current

vmr context create staging \
  -s tcp://10.0.0.42:7846 \
  -r https://registry.staging.example.com \
  -d "Staging environment"

TIP

Use --set-current when creating a context you want to start using immediately. Otherwise, switch to it later with vmr context use.

update

Update the configuration of an existing context. Only the provided fields are modified — omitted fields retain their current values.

bash
vmr context update <NAME> [OPTIONS]

Arguments

ArgumentDescription
NAMEName of the context to update

Options

FlagShortDescription
--socket-url <URL>-sNew daemon socket URL
--registry-url <URL>-rNew registry server URL
--description <TEXT>-dNew description

Examples

bash
vmr context update staging \
  --registry-url https://registry-v2.staging.example.com

vmr context update dev -d "Local dev with S3 backend"

use

Switch the active context. All subsequent CLI commands will use the connection details from the selected context.

bash
vmr context use <NAME>

Arguments

ArgumentDescription
NAMEName of the context to activate

Examples

bash
vmr context use staging

vmr context use dev

ls

List all configured contexts, showing each context's name, socket URL, registry URL, description, and whether it is the currently active context.

bash
vmr context ls [OPTIONS]

Options

FlagShortDescription
--names-only-qPrint only context names, one per line

Output Fields

FieldDescription
NameContext name
Socket URLConfigured daemon socket URL
Registry URLConfigured registry server URL
DescriptionHuman-readable description
CurrentWhether this is the active context

Examples

bash
vmr context ls

vmr context ls -q

remove

Delete a named context. The currently active context cannot be removed unless --force is specified.

bash
vmr context remove <NAME> [OPTIONS]

Arguments

ArgumentDescription
NAMEName of the context to remove

Options

FlagShortDescription
--force-fForce removal even if this is the currently active context

Examples

bash
vmr context remove staging

vmr context remove dev -f

WARNING

Removing the active context with --force will leave no context selected. You must run vmr context use to select a new active context before executing further commands that require daemon connectivity.

current

Display the currently active context and its full configuration details.

bash
vmr context current

Examples

bash
vmr context current

Built with Go and Rust