Package: s6r-bitwarden-cli
s6r-bitwarden-cliInteract easily with Bitwarden client.Overviews6r-bitwarden-cli is a Python script designed to provide a convenient interface for interacting with the
Bitwarden command-line interface (CLI) tool. It allows users to perform various Bitwarden actions, such as logging in,
searching for items, retrieving item details, collections, organizations, directly from within a Python script.Table of ContentsInstallationInstall s6r-bitwarden-cliInstall Bitwarden CLIUsageLogin to Bitwarden VaultLogin with Username and PasswordLogin with API KeyUnlock with Session KeyExamplesLicenseContributingContributorsMaintainerInstallationpipinstalls6r-bitwarden-cliInstall Bitwarden CLIMake sure to install the Bitwarden CLI tool on your system.
You can download it from the official Bitwarden website or use your package manager.Download and installUsagefroms6r_bitwarden_cliimportBitwardenClibw_cli=BitwardenCli()password=bw_cli.get_item_password('Staging',collection_name='My collection')Theget_item_passwordmethod, when used with correctly set environment variables, abstracts the complexities of
Bitwarden authentication and CLI interactions, providing a seamless way to retrieve passwords for specified items.Login to Bitwarden VaultTo log in to your Bitwarden Vault, you have multiple options based on your preferred authentication method.Login with Username and PasswordSet the following environment variables to log in using your Bitwarden username and password:BITWARDEN_USERNAME: Your Bitwarden username.BITWARDEN_PASSWORD: Your Bitwarden password.exportBITWARDEN_USERNAME=your_usernameexportBITWARDEN_PASSWORD=your_passwordLogin with API KeyIf you prefer to use an API key for authentication, set the following environment variables:BITWARDEN_API_CLIENT_ID: Your Bitwarden API client ID.BITWARDEN_API_CLIENT_SECRET: Your Bitwarden API client secret.Note: TheBITWARDEN_PASSWORDenvironment variable is still required to unlock the vault, even when using API key
authentication.exportBITWARDEN_API_CLIENT_ID=your_api_client_idexportBITWARDEN_API_CLIENT_SECRET=your_api_client_secretUnlock with Session KeyIf you are already logged in and have a session key,
set the BITWARDEN_SESSION_KEY environment variable to unlock the vault.This method allows you to bypass the username and password or API key authentication if you have an active session.exportBITWARDEN_SESSION_KEY=your_session_keyExamples# Initialize Bitwarden CLIfroms6r_bitwarden_cliimportBitwardenClibw=BitwardenCli(username='your_username',password='your_password',verbose=True)# Check Bitwarden session statusstatus=bw.get_status()# Perform loginbw.login()# Unlock Bitwarden vaultbw.unlock()# Search for Bitwarden itemsitems=bw.search_objects(objects='items',search='keyword')# Retrieve details of a Bitwarden itemitem_details=bw.get_item(name='item_name')# Get a list of Bitwarden organizationsorganizations=bw.get_organizations()# Get the default organizationdefault_organization=bw.get_default_organization()# Get the ID of the default organizationdefault_organization_id=bw.get_default_organization_id()# Get organization collectionsorg_collections=bw.get_org_collections(search='collection_name',organization_id='organization_id')# Get an organization collectionorg_collection=bw.get_org_collection(search='collection_name',organization_id='organization_id')# Get the ID of an organization collectionorg_collection_id=bw.get_org_collection_id(search='collection_name',organization_id='organization_id')# logout from Bitwardenbw.logout()LicenseThis project is licensed under theGNU Lesser General Public License (LGPL) Version 3.ContributingContributions are welcome! If you find any issues or have suggestions for improvements,
please open an issue or submit a pull request.GitHub Repository:ScalizerOrg/s6r-bitwarden-cliContributorsMichel Perrocheau -GithubMaintainerThis software is maintained byScalizer.