Skip to content

Releases: Octave-Energy/mender-cli

v3.6.1

Choose a tag to compare

@github-actions github-actions released this 04 Aug 12:33

v3.6.1

Date: 2026-08-04
Previous release: v3.6.0

Summary

Adds focused CSV export via --include-inventory-keys and --include-tag-keys
flags on export report.

Highlights

  • Filtered inventory columns: Pass --include-inventory-keys thing_name,sn_device
    to export only the named [inventory] attributes as columns. All other scopes
    ([identity], [tags], etc.) are unaffected.
  • Filtered tag columns: Pass --include-tag-keys name,customer to export only
    the named [tags] attributes as columns.
  • Both flags are optional and independent. When omitted, all keys in the
    respective scope are exported (existing default behaviour unchanged).
  • Missing keys produce empty cells, not misaligned rows — alignment is always
    correct regardless of how many devices have a given attribute.

Example Usage

# Export only specific inventory attributes
mender-cli export report --include-inventory-keys thing_name,sn_device,site_id

# Export only specific tags
mender-cli export report --include-tag-keys name,customer

# Focused export combining both filters
mender-cli export report --include-inventory-keys thing_name,site_id --include-tag-keys name,customer -o focused.csv

Upgrading

  • No breaking changes. Both new flags are purely additive and optional.

v3.6.0

Choose a tag to compare

@github-actions github-actions released this 28 Jul 21:40

v3.6.0

Date: 2026-07-28
Previous release: v3.5.1

Summary

Adds exec command for non-interactive command execution on one or more
devices.

Highlights

  • exec command: Execute shell commands on devices non-interactively,
    capturing output and exit codes. Unlike terminal, exec runs a command
    (or chained commands), captures the output, and returns.
  • Multi-device support: Target multiple devices using the same flexible
    options as deployments create: --device (repeatable), --filter-multi,
    --group, or --all.
  • Sequential execution: Devices are processed one at a time with
    per-device output blocks and a summary at the end.
  • Confirmation dialog: Shows target count before executing. Use --yes
    to skip for automation.
  • Timeout control: Per-device timeout with --timeout (default 60s).
  • Dry-run mode: Use --dry-run to preview targeted devices without
    executing.
  • JSON output: Use --raw for machine-readable JSON output.

Example Usage

# Execute on a single device by ID
mender-cli exec --command 'hostname' --device abc123

# Execute on a device matching a filter
mender-cli exec --command 'uptime' -f hostname=my-gateway

# Execute on all devices in a group
mender-cli exec --command 'cat /etc/os-release' --group production

# Execute on all devices matching a filter (multi-device)
mender-cli exec --command 'df -h' --filter-multi device_type=gateway

# Execute on all accepted devices
mender-cli exec --command 'date' --all --yes

# Chained commands (use && to proceed only if previous succeeds)
mender-cli exec --command 'apt update && apt upgrade -y' --group staging --timeout 5m

# Dry run to preview targets
mender-cli exec --command 'hostname' --group production --dry-run

# JSON output for scripting
mender-cli exec --command 'hostname' --device abc123 --yes --raw

Notes

  • Command wrapping: Commands are automatically terminated with ; exit $?
    to capture the exit code. Trailing semicolons are stripped to avoid syntax
    errors.
  • Exit codes: CLI exits 0 if all devices succeed, 1 if any fail. A summary
    table shows per-device exit codes.
  • Mutually exclusive targeting: --device, -f/--filter, --filter-multi,
    --group, and --all cannot be combined.

Upgrading

  • No breaking changes. The new exec command is purely additive.

v3.5.1

Choose a tag to compare

@github-actions github-actions released this 27 Jul 23:06

v3.5.1

Date: 2026-07-28
Previous release: v3.5.0

Summary

Adds --filter-multi flag to deployments create for targeting multiple
devices via inventory filters.

Highlights

  • --filter-multi flag: Target all devices matching inventory filters
    instead of requiring exactly one match. Useful for deploying to device
    classes (e.g. --filter-multi "device_type=gateway").
  • Confirmation dialog: Shows matched device count before creating
    deployment. Use --yes to skip for automation.

Example Usage

# Deploy to all gateways
mender-cli deployments create --release v2.0 --filter-multi "device_type=gateway"

# Combine multiple filters (AND logic)
mender-cli deployments create --release v2.0 \
    --filter-multi "device_type=gateway" \
    --filter-multi "tags/environment=production"

# Skip confirmation for automation
mender-cli deployments create --release v2.0 --filter-multi "device_type=gateway" --yes

Notes

  • Existing --filter unchanged: The -f/--filter flag still requires
    exactly one matching device, showing matched IDs in the error message when
    multiple devices match.
  • Mutually exclusive: --filter-multi cannot be combined with --device,
    -f/--filter, --group, or --all.

Upgrading

  • No breaking changes. The new --filter-multi flag is purely additive.

v3.5.0

Choose a tag to compare

@github-actions github-actions released this 27 Jul 21:38

v3.5.0

Date: 2026-07-27
Previous release: v3.4.0

Summary

Adds a new export report command for exporting comprehensive device reports
in CSV format, including inventory attributes, group membership, and deployment
history.

Highlights

Device Report Export

  • mender-cli export report: Export all devices with their complete
    inventory, group assignment, and latest deployment status to CSV.
  • Dynamic column discovery: Automatically includes all inventory attributes
    found across the fleet as columns. Devices missing an attribute have an empty
    cell — no schema definition required.
  • Pipe-delimited CSV: Uses | as the field delimiter to avoid conflicts
    with comma-containing inventory values (e.g. update_modules).
  • Fixed columns: ID, LastSeen, Group, LatestDeploymentName,
    LatestDeploymentArtifact, LatestDeploymentStatus,
    LatestDeploymentCreated, LatestDeploymentFinished.
  • Inventory columns: All attributes are included, sorted alphabetically and
    prefixed with their scope (e.g. [inventory]artifact_name, [identity]mac,
    [tags]environment).
  • Filtering: Supports --group to export only devices in a specific group.
  • Output: Writes to stdout by default; use -o/--output to write to a file.

Example Usage

# Export all devices to stdout
mender-cli export report

# Export to a file
mender-cli export report -o devices.csv

# Export only production devices
mender-cli export report --group production -o prod-devices.csv

Notes

  • Large fleets: The export fetches inventory, groups, and deployment history
    for every device. For fleets with thousands of devices, this may take several
    minutes.
  • Deployment history: Only the most recent deployment per device is
    included. Devices without any deployment history have empty deployment
    columns.

Upgrading

  • No breaking changes. The new export command tree is purely additive.

v3.4.0

Choose a tag to compare

@github-actions github-actions released this 27 Jul 18:19

v3.4.0

Date: 2026-07-27
Previous release: v3.3.0

Summary

Adds a new deployments create command for creating deployments from the CLI,
and introduces interactive confirmation dialogs for destructive operations.

Highlights

Deployment Creation

  • mender-cli deployments create: Create deployments targeting (mutually
    exclusive — exactly one required):
    • Individual devices by ID (--device, repeatable)
    • A single device by inventory filter (-f/--filter)
    • All devices in a static group (--group)
    • All accepted devices (--all)
  • Interactive confirmation dialog by default; use --yes for automation
  • Supports --force to skip already-installed checks
  • Supports --retries for automatic retry on failure
  • Custom deployment names with --name (defaults to release name)
  • Raw JSON output with -r/--raw for scripting

Safety Confirmations for Destructive Operations

  • mender-cli artifacts delete: Now requires interactive confirmation
    before deleting. Use --yes to skip for automation/scripting.
  • Consistent confirmation pattern across artifacts delete, inventory groups delete, token clear, and deployments create.

Notes

  • Safety by default: Destructive commands (artifacts delete,
    deployments create) now require interactive confirmation. For CI/CD
    pipelines and scripts, use --yes to skip the prompt.
  • Non-interactive detection: When stdin is not a TTY (e.g., in CI), these
    commands will fail with an error unless --yes is provided, preventing
    accidental execution.

Upgrading

  • Breaking change for scripts: If you have scripts that call
    mender-cli artifacts delete without user interaction, you must add --yes
    to continue working.

v3.3.0

Choose a tag to compare

@github-actions github-actions released this 27 Jul 09:45

v3.3.0

Date: 2026-07-27
Previous release: v3.2.2

Summary

Adds comprehensive inventory group management commands: list devices in a group,
delete groups, bulk add/remove devices from groups, and per-device group
management (get/set/clear).

Highlights

  • mender-cli inventory groups get --name <name>: List all device IDs
    belonging to a static group (auto-paginated). Supports -r/--raw for JSON
    output.
  • mender-cli inventory groups delete --name <name>: Delete a static group
    by removing all devices from it. Requires interactive confirmation unless
    --yes is provided.
  • mender-cli inventory groups add-devices --name <name> DEVICE_ID...: Add
    one or more devices to a static group. Creates the group implicitly if it
    does not exist.
  • mender-cli inventory groups remove-devices --name <name> DEVICE_ID...:
    Remove one or more devices from a static group.
  • mender-cli inventory device-group get: Show which group a single device
    belongs to. Target with --id or -f/--filter.
  • mender-cli inventory device-group set --name <group>: Assign a device to
    a group. If the device is already in another group, it is moved. Target with
    --id or -f/--filter.
  • mender-cli inventory device-group clear: Remove a device from its
    current group. Target with --id or -f/--filter.

Notes

  • No explicit "create group" command: Groups are created implicitly when
    devices are added via add-devices or device-group set. This matches the
    Mender API behavior.
  • No "rename group" command: The API does not support group renaming. To
    rename, delete the old group and recreate with the new name.
  • Single group per device: A device can belong to at most one static group.
    Assigning to a new group automatically removes from the previous one.

Upgrading

  • No breaking changes. Existing commands and flags are unchanged; the new
    device-group subcommand tree and expanded groups subcommands are purely
    additive.

v3.2.2

Choose a tag to compare

@github-actions github-actions released this 24 Jul 12:30

v3.2.2

Date: 2026-07-24
Previous release: v3.2.1

Summary

Fixes mender-cli token set so long Personal Access Tokens can be pasted and
saved interactively again, while keeping the prompt masked.

Highlights

  • Interactive PAT paste fix: mender-cli token set no longer truncates
    long pasted tokens in interactive mode.
  • Masked prompt restored: interactive token entry continues to hide the
    token while typing/pasting, instead of echoing the raw value.
  • Regression coverage: adds targeted test coverage for long interactive
    token entry so the interactive and piped paths stay aligned.

Upgrading

  • No breaking changes. Existing commands and flags are unchanged.

v3.2.1

Choose a tag to compare

@github-actions github-actions released this 17 Jun 11:03

v3.2.1

Date: 2026-06-17
Previous release: v3.2.0

Summary

Improves remote terminal session shutdown behavior so local termination paths
cleanly close websocket sessions and reduce stale DeviceConnect session state.

Highlights

  • Graceful terminal shutdown path: mender-cli terminal now uses an
    idempotent shutdown flow that performs best-effort shell stop, websocket
    close handshake, unconditional transport close, and bounded cleanup wait.
  • Signal/hangup handling improvements: terminal shutdown behavior is aligned
    for local escape and host termination paths (including terminal hangup and
    stdin EOF cases), with safer signal subscription handling.
  • Race/deadlock hardening: replaced shared terminal runtime state with
    coordinated stop signaling to avoid shutdown races and blocking stop calls.
  • Better websocket handshake errors: connection failures now include HTTP
    status and bounded response body content when available, making session-limit
    or authorization problems easier to diagnose.
  • Tests: adds targeted unit coverage for shutdown idempotency, shutdown
    ordering, failure-continuation behavior, and handshake diagnostics, plus
    integration test coverage for SIGTERM/stdin-EOF terminal termination followed
    by immediate reconnect.
  • Acceptance test UX: make build-acceptance and make run-acceptance
    now fail fast with a clear message when the tests/mender_server submodule
    is not initialized.

Upgrading

  • No breaking changes. Existing commands and flags are unchanged.

v3.2.0

Choose a tag to compare

@github-actions github-actions released this 10 Jun 13:20

v3.2.0

Date: 2026-06-10
Previous release: v3.1.0

Summary

Adds a new top-level deployments command group for listing and inspecting
deployments and fetching per-device deployment logs.

Highlights

  • mender-cli deployments list: List all deployments (auto-paginated).
    Filter with --id/--name (repeatable), --status
    (inprogress|finished|pending), --type (software|configuration),
    --created-before/--created-after (Unix timestamps), and order with
    --sort (asc|desc). -d/--detail controls verbosity; -r/--raw prints the
    server JSON. Shell completion is available for the enum flags.
  • mender-cli deployments count: Return only the total number of
    deployments (read from the server's X-Total-Count header), accepting the
    same filters as list (except --sort).
  • mender-cli deployments search: Find deployments by who they target —
    --group <name>, --device <id>, or -f/--filter (inventory attributes
    resolving to exactly one device, like devices get --filter). Matches each
    deployment's declared group/device targeting; --status/--type narrow the
    scan.
  • mender-cli deployments get --id <id>: Show a single deployment, with
    -d/--detail and -r/--raw.
  • mender-cli deployments stats --id <id>: Show per-status device counts
    for a deployment.
  • mender-cli deployments devices --id <id>: List a deployment's devices
    and their per-device status (auto-paginated), optionally filtered with
    --status (completion supported).
  • mender-cli deployments log --id <id> --device <device-id>: Print a
    device's deployment log as plain text — handy for CI debugging.

Upgrading

  • No breaking changes. Existing commands and flags are unchanged; the
    deployments group is purely additive.

v3.1.0

Choose a tag to compare

@github-actions github-actions released this 10 Jun 10:09

Full Changelog: v3.0.0...v3.1.0