Skip to content

Contexts

Commands for managing named configuration contexts. Contexts allow you to maintain multiple daemon/registry/auth server 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, registry server, and auth server.

bash
vmr context create <NAME> [OPTIONS]

Arguments

ArgumentDescription
NAMEName for the new context

Options

FlagShortDescription
--socket-path <PATH>-sUnix socket path for the daemon
--registry-url <URL>-rRegistry server URL
--auth-server-url <URL>-aAuthentication server URL
--description <TEXT>-dHuman-readable description of this context
--set-current-cImmediately switch to this context after creation

Examples

bash
vmr context create dev \
  --socket-path /tmp/vm-registry-daemon.sock \
  --registry-url http://127.0.0.1:8080 \
  --auth-server-url http://127.0.0.1:4078 \
  --description "Local development environment" \
  --set-current

vmr context create staging \
  -s /var/run/vm-registry.sock \
  -r https://registry.staging.example.com \
  -a https://auth.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-path <PATH>-sNew Unix socket path
--registry-url <URL>-rNew registry server URL
--auth-server-url <URL>-aNew authentication 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, registry URL, auth server URL, description, and whether it is the currently active context.

bash
vmr context ls

Output Fields

FieldDescription
NameContext name
Registry URLConfigured registry server URL
Auth Server URLConfigured authentication server URL
DescriptionHuman-readable description
CurrentWhether this is the active context
Created AtWhen the context was created
Updated AtWhen the context was last modified

Examples

bash
vmr context ls

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