doy / rbw

unofficial bitwarden cli
https://git.tozt.net/rbw
Other
581 stars 83 forks source link

Support for multiple profiles undocumented #141

Closed rjc closed 2 months ago

rjc commented 9 months ago

Hello,

I've noticed that support for multiple profiles (PR #93) has been merged in commit d4453cb44a10f9bb558fd2a5561cc5223ba36a23 but how to use it isn't actually documented anywhere, i.e. not even mentioned in the README.

Even the commit messages itself isn't clear whether RBW_PROFILE environment variable is a path in the sense of a directory containing config.json, or whether it is simply a file name, etc. It also isn't clear whether this should be an absolute or relative path.

The way I'd see it is like this, for:

$ RBW_PROFILE=foo rbw list

I'd search for a file called foo.json in:

$HOME/Library/Application Support/rbw

on macOS, or:

$HOME/.config/rbw

on other *nix OSes.

jlbribeiro commented 9 months ago

@rjc Thank you for mentioning that PR, I was just installing rbw and this came useful!

I'm not fluent in Rust, but from a cursory read, what changes is whether it should use

(<config_base_path> being defined in directories::ProjectDirs.config_dir() depending on the platform)

In my case (Linux):

RBW_PROFILE=work rbw config show
... $XDG_CONFIG_HOME/rbw-work/config.json contents ...
doy commented 2 months ago

fixed in 42c433b