renovate[bot] f821c66572 fix(deps): update module github.com/spf13/cobra (v1.10.1 → v1.10.2) (#67)
Signed-off-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-12-07 00:22:32 +02:00
2025-07-31 11:40:39 +03:00
2025-07-31 11:40:39 +03:00
2025-07-31 11:40:39 +03:00
2025-07-31 11:40:39 +03:00
2025-07-31 11:40:39 +03:00
2025-07-21 02:27:02 +03:00
2025-07-31 11:40:39 +03:00
2025-07-21 02:27:02 +03:00
2025-07-31 11:40:39 +03:00
2025-07-21 02:27:02 +03:00
2025-07-31 11:40:39 +03:00
2025-07-31 11:40:39 +03:00
2025-07-31 11:40:39 +03:00
2025-07-21 02:27:02 +03:00
2025-07-31 11:40:39 +03:00
2025-07-31 11:40:39 +03:00

A CLI Wrapper for Age Encryption

A robust command-line interface (CLI) wrapper around the age encryption tool. This utility simplifies encryption and decryption using SSH keys, with integrated support for fetching public keys from GitHub.

Features

  • Secure Encryption/Decryption: Utilize SSH and GitHub keys with age for strong encryption.
  • Configuration: Easily configurable via a YAML file.
  • Structured Logging: JSON-formatted logs with configurable paths.
  • Cross-platform: Supports Linux, macOS, and Windows.
  • Shell Completion: Auto-generated completion scripts for Bash, Zsh, and Fish.
  • Robust Error Handling: Comprehensive and clear error messaging.

Installation

Prerequisites

  • Go (1.21+)
  • age encryption tool

Build from source

git clone <repository-url>
cd <repository-directory>
go build -o a

Move binary to path (optional)

sudo mv a /usr/local/bin/

Usage

Basic usage

a [command] [flags]

Commands

  • config: Manage application settings
  • encrypt: Encrypt files
  • decrypt: Decrypt files
  • completion: Generate shell completion scripts

Examples

Configure the CLI

a config --ssh-key ~/.ssh/id_rsa --github-user yourusername --default-recipients ~/.ssh/id_rsa.pub --cache-ttl 120

Encrypt a file

a encrypt -o encrypted_file.txt input.txt

Decrypt a file

a decrypt -o decrypted_file.txt encrypted_file.txt

Generate shell completions

a completion bash > /etc/bash_completion.d/a

Configuration File

Configuration is stored at $HOME/.config/a/config.yaml:

ssh_key_path: "/home/user/.ssh/id_rsa"
github_user: "yourusername"
default_recipients:
  - "/home/user/.ssh/id_rsa.pub"
cache_ttl_minutes: 120
log_file_path: "/home/user/.state/a/cli.log"

Logging

Structured JSON logs are written to a configurable log file (cli.log). Verbosity can be adjusted with the -v or --verbose flag.

Testing

Run unit tests with:

go test ./...

License

This project is licensed under the MIT License. See the LICENSE file for details.

Description
No description provided
Readme 278 KiB
Languages
Go 96%
Just 4%