Comments (5)
About long options, I always planned to provide long versions of all short options except -i
and -o
. The standard flags package already supports double dashes if that's what you prefer, so I don't see the need to use a third party package: the only difference would be that it would make it possible to combine multiple short options, which I think is an anti-pattern. We shouldn't have that many options to begin with!
I am not a fan of sub-commands, they are necessary when you have a sprawling CLI, but we shouldn't! They reduce discoverability and make commands more verbose. I understand the frustration with not knowing what mode gpg is in, but we really only have two: encrypt and decrypt. Maybe generate should even be a separate binary, age-keygen
?
I do think we need to change the CLI a bit though. "All arguments are recipients or keys" was clever, but is not usable: people will pass inputs as arguments all the time, and with -i
you have to put the key after the input. I'm thinking we just drop arguments entirely, and introduce -r/-recipient
and -k/-key
. Or... we take a single optional argument as input, and use -i/-identity
for decryption, matching SSH.
$ age-keygen > key.txt
$ echo "_o/" | age -r pubkey:98W5ph53zfPGOzEOH-fMojQ4jUY7VLEmtmozREqnw4I > hello.txt.age
$ age -d -i key.txt hello.txt.age
_o/
$ tar cv ~/xxx | age -r github:Benjojo -r github:FiloSottile | nc 192.0.2.0 1234
$ echo "_o/" | age -o hello.age -r pubkey:98W5ph53zfPGOzEOH-fMojQ4jUY7VLEmtmozREqnw4I
$ age -o hello.txt.age -p hello.txt
Type passphrase:
from age.
A separate keygen binary is probably a good idea in order to simplify the UX.
I like moving from positional arguments to repeated -r recipient
(it would similarly improve the rage
UX). I did wonder for a moment whether it would make recipient expansion in the CLI harder (i.e. cat foo | age $(fetch_recipients from somewhere) >bar
would need to interpolate -r
), but I think it's probably better to just direct this kind of use-case towards storing the recipients in an intermediate file and then using cat foo | age -r recipients.txt >bar
instead.
I'm ambivalent about -k
vs -i
. If we did have a single positional argument as input, then should we support the somewhat-common convention of mapping the filename -
to stdin? Incidentally, I see that gpg
(at least according to its manpage) requires passing -o -
in order to write to stdout.
from age.
I'm ambivalent about
-k
vs-i
. If we did have a single positional argument as input, then should we support the somewhat-common convention of mapping the filename-
to stdin? Incidentally, I see thatgpg
(at least according to its manpage) requires passing-o -
in order to write to stdout.
Yeah, let's honor the mapping. I want it to be easy to pipe input and output, so stdin and stdout should stay the defaults if no argument or -o
is specified. We can refuse to spew binary to stdout unless overridden with -o -
, though.
from age.
Done! I'll update the spec later.
from age.
Great, thanks!
from age.
Related Issues (20)
- age subprocess unable to read ssh key password from terminal, when called from vim HOT 1
- agessh: ParseIdentity doesn't handle inconsistent Ed25519 return type from ParseRawPrivateKey
- cmd/age-keygen: -y should report error if it fails to parse input HOT 1
- Unable to encrypt/decrypt file using ssh-rsa key
- Remove Bech32 length limitations
- Age v1.1.0 fails to build with "go install" HOT 3
- Weird characters in place of terminal escape sequences on Windows Console
- plugin: add library support for using and providing plugins HOT 4
- cmd/age: print a better error message when plugins are missing HOT 2
- command '/bin/sh -c go install filippo.io/age/cmd/...@latest' returned a non-zero code: 1 HOT 3
- Using the same file as input and output produces a corrupt result without notice. HOT 7
- Latest release spins CPU HOT 4
- Allow to use a file named - as INPUT HOT 7
- c2sp.org/age-plugin returns 404 Not Found HOT 1
- Age terminates too soon on MacOS HOT 5
- Can this method be used to encrypt movie files? HOT 1
- report unexpected HOT 1
- age: error: failed to wrap key for recipient #0: test plugin: write |1: broken pipe HOT 16
- Plugin receives only one identity or recipient when there are multiple HOT 1
- failed to decrypt and authenticate payload chunk HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from age.