bitwarden / cli

The command line vault (Windows, macOS, & Linux).
https://bitwarden.com
GNU General Public License v3.0
1.63k stars 174 forks source link

`export` command can be verified with positional argument non-interactively: `BW_NOINTERACTION` check is invalid #437

Closed Alexander-Shukaev closed 2 years ago

Alexander-Shukaev commented 2 years ago

export command can be verified with positional argument non-interactively, meaning the following BW_NOINTERACTION check is invalid:

https://github.com/bitwarden/cli/blob/f26bfb5859c7a4e2b5ccd21c6811f3b7401180c0/src/commands/export.command.ts#L36-L41

eliykat commented 2 years ago

This is intentional. Currently, the export command always prompts for your master password, even if you supply the session key, so you must run it in interactive mode. See bitwarden/clients#2739 for discussion around allowing non-interactive export. I'll close this as a duplicate.

Alexander-Shukaev commented 2 years ago

This is intentional. Currently, the export command always prompts for your master password, even if you supply the session key, so you must run it in interactive mode. See bitwarden/clients#2739 for discussion around allowing non-interactive export. I'll close this as a duplicate.

@eliykat, not sure what you mean by prompt, but export does not prompt me anything if I supply password as positional argument, so it can already run as part of some automated script. As a result, I don't really understand the point behind the snippet in subject.

eliykat commented 2 years ago

You're right, my mistake. I confused authing with the apikey vs. unlocking with the master password. I agree we should modify this if statement to allow it to run in non-interactive mode if the master password has been passed in (and the user is not using Key Connector, which would require a TOTP code).