Metadata-Version: 2.4
Name: bitwarden-wrapper
Version: 0.1.3
Summary: Simple bitwarden cli wrapper that can get and create credentials.
License-Expression: AGPL-3.0-or-later
License-File: LICENSE
Keywords: bitwarden,passwordmanager
Requires-Python: >=3.13,<3.15
Classifier: Development Status :: 4 - Beta
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Operating System :: MacOS :: MacOS X
Classifier: Operating System :: POSIX :: Linux
Classifier: License :: OSI Approved :: GNU Affero General Public License v3 or later (AGPLv3+)
Requires-Dist: rich (>=14.1,<15.0)
Requires-Dist: rich-subproc (>=0.1.0,<0.2.0)
Requires-Dist: textual (>=8.0,<9.0)
Project-URL: Bug Tracker, http://codeberg.org/open-engineering/bitwarden-wrapper/issues
Description-Content-Type: text/markdown

# bitwarden-wrapper

<a href="https://pypi.org/project/bitwarden-wrapper/">
<img alt="PyPI - Version" src="https://img.shields.io/pypi/v/bitwarden-wrapper?logo=pypi">
</a>

An extremely simple Bitwarden CLI wrapper. Originally developed for [smol-k8s-lab](https://smol-k8s-lab.open.engineering), but extracted so it can be used elsewhere.

## Usage

Here's the basic usage:

```python
# initialize the object
bw = BwCLI(my_passsword, my_client_id, my_client_secret)

# unlock the vault
bw.unlock()

# generate a random password
random_password = bw.generate()
# create a login item in the vault
bw.create_login(name="test mctest",
                item_url="coolhosting4dogs.tech",
                user="admin",
                password=random_password)

# lock the vault
bw.lock()
```

If you pass in `tui=True` to the `BwCLI` object, we'll also display a TUI for when a duplicate item exists to allow the user to select what they'd like to do.

You can also specify `duplicate_strategy="edit"` to edit existing items. The values for `duplicate_strategy` can be: "edit", "ask", "duplicate", "no_action", but it always defaults to "ask".

## Warnings

1. If you set your logging library to log level DEBUG, we may print sensitive info when creating and deleting vault items. This is intensional *for debugging purposes only*.

2. The TUI may throw issues when run inside an event loop. In which case, wecan always fall back to using rich instead.

