bestool-kopia 0.1.1

(Internal) BES tooling: shared library for interacting with the kopia CLI
Documentation

Shared helpers for interacting with the kopia CLI.

Used by bestool-tamanu (for the kopia_backup doctor check) and by bestool (for the bestool kopia subcommand suite). Has nothing tamanu-specific in it.

Highlights:

  • [find_kopia_binary] / [find_windows_kopia_binary] / [find_windows_kopia_config]: locate kopia and (on Windows) the per-user repository config from KopiaUI's standard install locations.
  • [linux_elevation]: decide whether/how to elevate to the kopia system user on Linux. Returns [Elevation::Sudo] when we're not the kopia user and the system kopia install is present, [Elevation::Direct] when we already have access, [Elevation::Skip] otherwise.
  • [Snapshot] and [fetch_snapshots]: deserialise kopia snapshot list --json output into a typed shape.
  • [SnapshotFilter] / [build_filter]: in-process filtering of a snapshot list by host, tag, path substring, and time window.
  • With the cli feature: [SnapshotSelectorArgs] (a clap::Args-derived struct that consumer commands flatten into their own args) and [select_snapshot] (a dialoguer-backed interactive picker).