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

--silent option for CLI #831

Closed
rfc1459 opened this issue Jul 31, 2017 · 3 comments
Closed

--silent option for CLI #831

rfc1459 opened this issue Jul 31, 2017 · 3 comments
Milestone

Comments

@rfc1459
Copy link

rfc1459 commented Jul 31, 2017

When using keepassxc-cli show the password prompt for the database is sent to stdout. This makes integrating keepass-cli into scripts problematic.

Expected Behavior

The database password prompt should be sent to stderr or directly to the invoking pty, while only the entry itself is sent to stdout.

Current Behavior

The database password prompt and the entry are sent to stdout.

Possible Solution

keepassxc-cli should send the database password prompt either on stderr or on the invoking pty, leaving stdout for the requested entry

Steps to Reproduce (for bugs)

  1. keepassxc-cli $db $entry 2>/dev/null
  2. keepassxc-cli $db $entry >/dev/null

Step 1 prints both the database password prompt and the entry, step 2 prints nothing.

Debug Info

KeePassXC - Version 2.2.0
Revision: caa49a8

Libraries:

  • Qt 5.5.1
  • libgcrypt 1.6.5

Enabled extensions:

  • KeePassHTTP
  • Auto-Type
  • YubiKey
@louib
Copy link
Member

louib commented Jul 31, 2017

@rfc1459 what about an option to hide the prompt? -s, --silent maybe.

@rfc1459
Copy link
Author

rfc1459 commented Aug 1, 2017

That would be fine (I already print my own prompt in the scripts since my workaround for this issue is a rather crude keepassxc-cli show $k $e | tail -n 1).

@louib louib changed the title CLI show password prompt should not use stdout CLI add option to silence password prompt Sep 1, 2017
lhark pushed a commit to lhark/keepassxc that referenced this issue Jul 10, 2018
Writing the prompt to stderr greatly helps with the use of keepassxc-cli
in automated scripts or as a password provider for programs like mutt or
borg.

This is done in accordance with POSIX that specifies that diagnostic
messages be sent to stderr.

This commit should be a first step in solving the following
issues: keepassxreboot#831, keepassxreboot#1221
droidmonkey pushed a commit to lhark/keepassxc that referenced this issue Sep 26, 2018
Writing the prompt to stderr greatly helps with the use of keepassxc-cli
in automated scripts or as a password provider for programs like mutt or
borg.

This is done in accordance with POSIX that specifies that diagnostic
messages be sent to stderr.

This commit should be a first step in solving the following
issues: keepassxreboot#831, keepassxreboot#1221
lhark pushed a commit to lhark/keepassxc that referenced this issue Oct 21, 2018
Writing the prompt to stderr greatly helps with the use of keepassxc-cli
in automated scripts or as a password provider for programs like mutt or
borg.

This is done in accordance with POSIX that specifies that diagnostic
messages be sent to stderr.

This commit should be a first step in solving the following
issues: keepassxreboot#831, keepassxreboot#1221
@louib louib changed the title CLI add option to silence password prompt --silent option for CLI Nov 9, 2018
@louib louib changed the title --silent option for CLI --silent option for CLI Nov 9, 2018
@louib
Copy link
Member

louib commented Nov 28, 2018

@rfc1459 the --quiet option was merged into develop. You can go ahead and give it a try!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants