This Vault class provides a Python interface for interacting with Bitwarden CLI serve. It wraps JSON-based API endpoints for various operations, such as user authentication, item management, syncing, and attachment handling.
- For an interface that invokes the CLI directly without the serve API use
vaultio.vault.VaultCLI - For an interface that decrypts the vault from the public API use
vaultio.vault.VaultSync
from vaultio.vault import Vault
# from vaultio.vault import VaultCLI
client = Vault(host="127.0.0.1", port=8087)Parameters:
socks: Pre-existing socket connections (optional)host: Server host (optional)port: Server port (optional)sock_path: Unix socket path (optional)fd: File descriptor (optional)serve: Whether to start the server (optional)wait: Whether to wait for socket readiness (optional)allow_write: IfFalse, disables all mutating operations (optional)
with Vault(...) as client:
...- Automatically starts and stops the underlying server connection.
Starts serving and waits for socket readiness.
Stops the server.
Locks the vault.
Unlocks the vault. Prompts for password if not provided.
Syncs with the server.
Returns vault status.
Generates a new password or passphrase.
Optional parameters:
length,uppercase,lowercase,numbers,specialpassphrase,words,separator,capitalize,include_number
Gets the creation template for a specific object type.
Returns the server's fingerprint.
Retrieves a specific object.
Creates a new object.
Edits an existing object.
Deletes an object.
Restores a previously deleted item.
Lists objects filtered by:
organization_id,collection_id,folder_id,url,trash,search,type
Downloads an attachment.
Uploads a new attachment for an item.
Confirms organization membership.
Moves an item to collections in an organization.
Lists pending approvals.
Approves a device (or all devices).
Denies a device (or all devices).
allow_write=Falsedisablesnew,edit,delete,trust, etc.
This project is licensed under the GNU General Public License v3.0. See the LICENSE file for details.