Skip to content

feat: add scriptable CLI interface for CI/CD and scripting#15

Merged
robertjbass merged 2 commits intomainfrom
dev
Jan 25, 2026
Merged

feat: add scriptable CLI interface for CI/CD and scripting#15
robertjbass merged 2 commits intomainfrom
dev

Conversation

@robertjbass
Copy link
Copy Markdown
Owner

Summary

  • Add non-interactive CLI commands using commander.js for CI/CD testing and scripting
  • Add CI test workflow that runs on PRs to verify CLI functionality
  • Bump version to 0.5.0

New CLI Commands

lpgp generate --name "Name" --email "email@example.com" --passphrase "secret"
lpgp generate --name "Name" --email "email@example.com" --no-passphrase
lpgp export-public [--fingerprint <fp>] [--json]
lpgp list-keys [--json]
lpgp encrypt "message" --to <fingerprint|email> [--file <path>] [--output <path>]
lpgp decrypt "message" [--passphrase <pass>] [--file <path>]
lpgp --help
lpgp --version
lpgp              # No args = interactive mode (existing behavior)

Features

  • Multiple --to recipients for encryption
  • Stdin support for piping messages
  • File input/output via --file and --output
  • JSON output option for list-keys and export-public
  • Passphrase from --passphrase, LPGP_PASSPHRASE env var, or system keychain
  • Proper exit codes (0=success, 1=error, 2=decrypt failed, 3=key not found)

Test plan

  • CI workflow runs and passes all tests
  • Interactive mode still works when running without arguments
  • All CLI commands work as expected

Add non-interactive CLI commands using commander.js:
- generate: Create new keypairs with --name, --email, --passphrase/--no-passphrase
- export-public: Export public key with optional --json output
- list-keys: List keypairs with optional --json output
- encrypt: Encrypt messages with --to recipient(s), supports stdin/file
- decrypt: Decrypt messages with --passphrase or env var/keychain

Running without arguments launches interactive mode (existing behavior).

Also adds CI test workflow that runs on PRs to main.
@vercel
Copy link
Copy Markdown

vercel bot commented Jan 25, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
pgp Error Error Jan 25, 2026 10:39pm

- Add CLI commands section to README
- Document npx usage
- Update project structure to include cli-commands.ts
- Remove outdated better-sqlite3 reference
@robertjbass robertjbass merged commit 4575e93 into main Jan 25, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant