Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature] CLI: Default behaviour encrypt from editor #2480

Open
avesst opened this issue Oct 1, 2024 · 2 comments
Open

[Feature] CLI: Default behaviour encrypt from editor #2480

avesst opened this issue Oct 1, 2024 · 2 comments

Comments

@avesst
Copy link

avesst commented Oct 1, 2024

I use Yopass quite a lot in my work, and usually I have a secret in the clipboard I need to send with some additional information. Instead of having either...

  1. Open a file, enter information, save it, cat and pipe to yopass
  2. Open the browser, enter information, encrypt

I thought of what if the default behaviour if the CLI was ran without --file or something piped to it, that it opened a temporary file in an editor, and when you saved and closed the editor the contents would be sent to Yopass and an URL returned.

I've managed to create a prototype of this (branch), which I think works quite well. For the time being, it reads the $EDITOR environment variable and opens that editor, with fallback to vi .

I'm not sure if that generic environment variable is the way to go, or perhaps one specific to Yopass should be used.

I briefly tried making this work with Notepad as default in Windows, but I couldn't get Notepad to re-save the temporary file to C:\Users\user\AppData\Local\Temp - it kept forcing a "Save As" dialog on me and I have not made any further attempts.

Before spending any more time on this I wanted to gather people's thoughts on this. Attached a small video as demonstration.

Screencast.from.2024-10-01.18-51-08.webm
@jhaals
Copy link
Owner

jhaals commented Oct 11, 2024

Thanks for the suggestion and the demo! In my head the venn diagram for terminal is for very quick pipe outout where it does not make sense to put it in the browser, I feel like opening an editor and type additional information is where you would actually open up the browser instead. I'm not sure sure the value add is enough to actually support it in the cli

@avesst
Copy link
Author

avesst commented Oct 21, 2024

For me this is quicker, more convenient and ergonomical. Any time I can refrain from moving off my keyboard and reaching for the mouse is a win imo.

I saw the PR about a headless mode and I think this would work well in those cases where you would want to run completely headless, encrypting and decrypting solely from the CLI.

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

No branches or pull requests

2 participants