This commit introduces a new templating system to the `borg` CLI, allowing for the definition and execution of reusable, multi-step data collection workflows.
Key features include:
- A new `borg template` command with `run`, `list`, and `save` subcommands.
- Support for YAML-based template files with variable substitution.
- A set of built-in templates for common use cases.
- A command history logger that enables the creation of new templates from past commands.
The implementation involved:
- Creating a new `pkg/templates` package to handle template discovery, parsing, and execution.
- Modifying the root command to support command history and programmatic subcommand execution.
- Adding comprehensive unit tests to ensure the new functionality is robust and correct.
- Several rounds of debugging and refactoring to address issues with `go:embed`, test deadlocks, and command parsing.
Co-authored-by: Snider <631881+Snider@users.noreply.github.com>