Skip to content

Add key-from-stdin option to CLI#6

Merged
diogot merged 2 commits intomainfrom
claude/add-key-from-stdin-option-015LBVt9rdaxZpqcjrwo6C5J
Nov 18, 2025
Merged

Add key-from-stdin option to CLI#6
diogot merged 2 commits intomainfrom
claude/add-key-from-stdin-option-015LBVt9rdaxZpqcjrwo6C5J

Conversation

@diogot
Copy link
Owner

@diogot diogot commented Nov 18, 2025

Implement the --key-from-stdin flag for the decrypt command, matching the functionality of the Go EJSON CLI. This allows users to provide the private key via stdin instead of reading it from the keydir.

This is particularly useful for:

  • CI/CD pipelines where keys are stored in environment variables
  • Security scenarios where keys shouldn't be written to disk
  • Scripting scenarios where keys are piped from other commands

Changes:

  • Add --key-from-stdin flag parsing in decryptCommand
  • Read private key from stdin when flag is present
  • Update help text and usage examples
  • Maintain backward compatibility with keydir-based key loading

Example usage:
echo "private_key" | ejson decrypt --key-from-stdin secrets.ejson

Implement the --key-from-stdin flag for the decrypt command, matching
the functionality of the Go EJSON CLI. This allows users to provide
the private key via stdin instead of reading it from the keydir.

This is particularly useful for:
- CI/CD pipelines where keys are stored in environment variables
- Security scenarios where keys shouldn't be written to disk
- Scripting scenarios where keys are piped from other commands

Changes:
- Add --key-from-stdin flag parsing in decryptCommand
- Read private key from stdin when flag is present
- Update help text and usage examples
- Maintain backward compatibility with keydir-based key loading

Example usage:
  echo "private_key" | ejson decrypt --key-from-stdin secrets.ejson
Bump minimum macOS version from 10.15 to 11.0 (Big Sur) to fix
test compatibility issues.
@diogot diogot merged commit 0cee028 into main Nov 18, 2025
2 checks passed
@diogot diogot deleted the claude/add-key-from-stdin-option-015LBVt9rdaxZpqcjrwo6C5J branch November 18, 2025 23:00
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.

2 participants