|
1 | 1 | # Bitwarden-menu
|
2 | 2 |
|
3 |
| -Dmenu/Rofi frontend for managing Bitwarden vault using the [Bitwarden |
4 |
| -CLI](https://bitwarden.com/help/article/cli/) tool. |
| 3 | + |
| 4 | + |
| 5 | + |
| 6 | + |
| 7 | +Dmenu/Rofi frontend for managing Bitwarden vaults. Uses the [Bitwarden |
| 8 | +CLI](https://bitwarden.com/help/article/cli/) tool to interact with the |
| 9 | +Bitwarden database. |
5 | 10 |
|
6 | 11 | This project is not associated with the Bitwarden project nor 8bit Solutions
|
7 | 12 | LLC.
|
8 | 13 |
|
| 14 | +## Installation |
| 15 | + |
| 16 | +`pip install --user bitwarden-menu` |
| 17 | + |
| 18 | +Ensure `~/.local/bin` is in your `$PATH`. Run `bwm` and enter your database |
| 19 | +path, keyfile path, and password. |
| 20 | + |
| 21 | +For full installation documention see the [installation docs][docs/install.md]. |
| 22 | + |
| 23 | +## Full Documentation |
| 24 | + |
| 25 | +[Installation](docs/install.md) - [Configuration](docs/configure.md) - [Usage](docs/usage.md) |
| 26 | + |
| 27 | +## Requirements |
| 28 | + |
| 29 | +1. Python 3.7+ |
| 30 | +2. [Bitwarden CLI][bwcli]. Ensure the `bw` command is in `$PATH` |
| 31 | +3. [Pynput][pynput] |
| 32 | +4. Dmenu, [Rofi][rofi] or [Bemenu][bemenu] |
| 33 | +5. (optional) Pinentry. |
| 34 | +6. (optional) xdotool or ydotool (for Wayland). |
| 35 | + |
9 | 36 | ## Features
|
10 | 37 |
|
| 38 | +- Supports [bitwarden.com](https://bitwarden.com) and self-hosted |
| 39 | + [Vaultwarden](https://github.com/dani-garcia/vaultwarden) accounts. |
11 | 40 | - Auto-type username and/or password on selection. No clipboard copy/paste
|
12 | 41 | involved.
|
13 |
| -- Login with 2FA code from Authenticator(TOTP), Email, or Yubikey (only these |
14 |
| - are supported by the Bitwarden CLI). |
15 |
| -- Select any single field and have it typed into the active window. Notes fields |
16 |
| - can be viewed line-by-line from within dmenu and the selected line will be |
17 |
| - typed when selected. |
18 |
| -- Open the URL in the default web browser from the View/Type menu. |
19 |
| -- Alternate keyboard languages and layouts supported via xdotool or ydotool (for |
20 |
| - Wayland) |
21 |
| -- Edit entry title, username, URL and password (manually typed or auto-generate) |
22 |
| -- Edit notes using terminal or gui editor (set in config.ini, or uses $EDITOR) |
| 42 | +- Supports login with 2FA code from Authenticator(TOTP), Email, or Yubikey. |
| 43 | +- Background process allows selectable time-out for locking the database. |
| 44 | +- Use a custom [Keepass 2.x style auto-type sequence][6]. |
| 45 | +- Type, view or edit any field. |
| 46 | +- Open the URL in the default web browser. |
| 47 | +- Non U.S. English keyboard languages and layouts supported via xdotool or |
| 48 | + ydotool (for Wayland). |
| 49 | +- Edit notes using terminal or gui editor. |
23 | 50 | - Add and Delete entries
|
24 | 51 | - Rename, move, delete and add folders and collections
|
25 |
| -- Move any item to or from an organization, including support for multiple collections. |
26 |
| -- Prompts for and saves initial server URL and login email |
27 |
| -- Define multiple vault URLs in the config file. |
| 52 | +- Move any item to or from an organization, including support for multiple |
| 53 | + collections. |
28 | 54 | - Hide selected folders from the default and 'View/Type Individual entries'
|
29 | 55 | views.
|
30 |
| -- Configure session timeout |
| 56 | +- Define multiple vault URLs in the config file. |
31 | 57 | - Configure the characters and groups of characters used during password
|
32 |
| - generation in the config file (see config.ini.example for instructions). |
33 |
| - Multiple character sets can be selected on the fly when using Rofi if the |
34 |
| - `-multi-select` option is passed to Rofi via `dmenu_command`. |
35 |
| -- Use a custom Keepass 2.x style [auto-type sequence][autotype] if you have an |
36 |
| - 'autotype' field defined in the entry (except for character repetition and the |
37 |
| - 'special commands'). Set it per entry and/or set a default in the config file |
38 |
| - for all entries. |
| 58 | + generation. |
| 59 | +- Optional Pinentry support for secure passphrase entry. |
39 | 60 |
|
40 | 61 | ## License
|
41 | 62 |
|
42 | 63 | - MIT
|
43 | 64 |
|
44 |
| -## Requirements |
45 |
| - |
46 |
| -1. Python 3.7+. |
47 |
| -2. [Bitwarden CLI][bwcli]. Ensure the `bw` command is in `$PATH` |
48 |
| -3. [Pynput][pynput] |
49 |
| -4. Dmenu or [Rofi][rofi]. Rofi configuration/theming should be done via Rofi |
50 |
| - theme files. |
51 |
| -5. (optional) Pinentry. Make sure to set which flavor of pinentry command to use |
52 |
| - in the config file. |
53 |
| -6. (optional) xdotool or ydotool (for Wayland). If you have a lot of Unicode |
54 |
| - characters or use a non-U.S. English keyboard layout, xdotool is necessary |
55 |
| - to handle typing those characters. |
56 |
| - |
57 |
| -## Installation |
58 |
| - |
59 |
| -- Installation |
60 |
| - |
61 |
| - + `pip install --user bitwarden-menu`. Add ~/.local/bin to $PATH |
62 |
| - + In a virtualenv with pip. Link to the executable in |
63 |
| - <path/to/virtualenv/bin/bwm> |
64 |
| - |
65 |
| - mkvirtualenv bwm |
66 |
| - pip install bitwarden-menu |
67 |
| - |
68 |
| - + From git. Just clone, install requirements and run |
69 |
| - + Available in the [Archlinux AUR][aur]. |
70 |
| - |
71 |
| -- If you start bwm for the first time without a config file, it will prompt |
72 |
| - you for server name, login email, and 2FA type and save them in the config |
73 |
| - file. |
74 |
| - |
75 |
| -- Copy config.ini.example to ~/.config/bwm/config.ini, or use it as a |
76 |
| - reference for additional options. |
77 |
| - |
78 |
| - + To use a command (e.g. gpg) to lookup db password, set `password_cmd_<n>` |
79 |
| - in config.ini. |
80 |
| - + Adjust `session_timeout_min` if desired. Default is 6 hours (360 min). |
81 |
| - + Set the dmenu_command to `rofi` if you are using that instead |
82 |
| - + Adjust the autotype_default, if desired. Allowed codes are the |
83 |
| - `Keepass 2.x codes`_ except for repetitions and most command codes. `{DELAY |
84 |
| - x}` (in milliseconds) is supported. Individual autotype sequences can be |
85 |
| - edited or deleted using bwm. To disable autotype for an entry, set it to |
86 |
| - `False`. |
87 |
| - + Set `type_library = xdotool` or `type_library = ydotool` (Wayland) if you |
88 |
| - need support for non-U.S. English keyboard layouts and/or characters. |
89 |
| - |
90 |
| - * When using xdotool, call `setxkbmap` to set your keyboard type somewhere |
91 |
| - in your window manager or desktop environment initialization. For example: |
92 |
| - `exec setxkbmap de` in ~/.config/i3/config. |
93 |
| - |
94 |
| -- If using Rofi, pass desired theme via `dmenu_command = rofi -theme <theme>.rasi`. |
95 |
| - Dmenu themeing options are also passed via `dmenu_command` |
96 |
| -- New sets of characters can be set in config.ini in the `[password_chars]` |
97 |
| - section. A new preset for each custom set will be listed in addition to the |
98 |
| - default presets. If you redefine one of the default sets (upper, lower, |
99 |
| - digits, punctuation), it will replace the default values. |
100 |
| -- New preset groups of character sets can be defined in config.ini in the |
101 |
| - `[password_char_presets]` section. You can set any combination of default and |
102 |
| - custom character sets. A minimum of one character from each distinct set will |
103 |
| - be used when generating a new password. If any custom presets are defined, the |
104 |
| - default presets will not be displayed unless they are uncommented. |
105 |
| - |
106 |
| -<b>WARNING:</b> If you choose to store your vault password in config.ini, make |
107 |
| -sure to `chmod 600 config.ini`. This is not secure and I only added it as a |
108 |
| -convenience for testing. |
109 |
| - |
110 | 65 | ## Usage
|
111 | 66 |
|
112 |
| -- Run script or bind to keystroke combination |
113 |
| -- Enter server URL (default `vault.bitwarden.com`), login email and 2FA type if |
114 |
| - not entered into config.ini already. |
115 |
| -- Start typing to match entries. |
116 |
| -- Hit Enter immediately after dmenu opens ("`View/Type individual entries`") to |
117 |
| - switch modes to view and/or type the individual fields for the entry. If |
118 |
| - selected, the URL will open in the default browser instead of being typed. |
119 |
| -- To view a password without typing it, use the 'Edit Entries' option, then |
120 |
| - select the entry, select 'Password' then select 'Manually enter password'. |
121 |
| - Type 'ESC' to exit without making changes. |
122 |
| - |
123 |
| -### Wayland (wlroots - Sway) |
| 67 | +`bwm [-h] [-v VAULT] [-l LOGIN] [-a AUTOTYPE]` |
124 | 68 |
|
125 |
| -- Dmenu or Rofi work under XWayland. |
126 |
| -- To enable ydotool to work without sudo |
127 |
| - - Pick a group that one or more users |
128 |
| - belong to (e.g. `users`) and: |
129 |
| - |
130 |
| - $ echo "KERNEL==\"uinput\", GROUP=\"users\", MODE=\"0660\", \ |
131 |
| - OPTIONS+=\"static_node=uinput\"" | sudo tee \ |
132 |
| - /etc/udev/rules.d/80-uinput.rules > /dev/null |
133 |
| - # udevadm control --reload-rules && udevadm trigger |
134 |
| - |
135 |
| - - Create a systemd user service for ydotoold: |
136 |
| - |
137 |
| - ~/.config/systemd/user/ydotoold.service |
138 |
| - [Unit] |
139 |
| - Description=ydotoold Service |
140 |
| - |
141 |
| - [Service] |
142 |
| - ExecStart=/usr/bin/ydotoold |
143 |
| - |
144 |
| - [Install] |
145 |
| - WantedBy=default.target |
| 69 | +- Run `bwm` or bind to keystroke combination. |
| 70 | +- Enter account URL on first run. |
| 71 | +- Start typing to match entries. |
| 72 | +- [Configure](docs/configure.md) ~/.config/bwm/config.ini as desired. |
| 73 | +- More detailed [usage information](docs/usage.md). |
146 | 74 |
|
147 |
| - - Enable and start ydotoold.service: |
| 75 | +## Tests |
148 | 76 |
|
149 |
| - $ systemctl --user daemon-reload |
150 |
| - $ systemctl --user enable --now ydotoold.service |
| 77 | +To run tests in a venv: `make test` (not implemented yet) |
151 | 78 |
|
152 |
| -## Tests |
| 79 | +## Development |
153 | 80 |
|
154 |
| -- To run tests: `python tests/tests.py` (not implemented yet) |
| 81 | +- To install bitwarden-menu in a venv: `make` |
| 82 | +- Build man page from Markdown source: `make man` |
155 | 83 |
|
156 | 84 | ## Planned features
|
157 | 85 |
|
158 | 86 | - Unit tests
|
159 | 87 | - TOTP support
|
160 | 88 | - Notifications for syncing status (e.g. when a sync is complete)
|
| 89 | +- Clipboard support |
161 | 90 |
|
162 | 91 | [pynput]: https://github.com/moses-palmer/pynput "Pynput"
|
163 | 92 | [bwcli]: https://github.com/bitwarden/cli "Bitwarden CLI"
|
164 | 93 | [rofi]: https://davedavenport.github.io/rofi/ "Rofi"
|
165 |
| -[aur]: https://aur.archlinux.org/packages/python-bitwarden-menu-git "Archlinux AUR" |
| 94 | +[aur]: https://aur.archlinux.org/packages/bitwarden-menu-git "Archlinux AUR" |
166 | 95 | [autotype]: https://keepass.info/help/base/autotype.html#autoseq "Keepass 2.x Autotype codes"
|
| 96 | +[bemenu]: https://github.com/Cloudef/bemenu "Bemenu" |
0 commit comments