Convert Figma logo to code with AI

bitwarden logocli

The command line vault (Windows, macOS, & Linux).

1,644
171
1,644
0

Top Related Projects

Unofficial Bitwarden compatible server written in Rust, formerly known as bitwarden_rs

LastPass command line interface tool

23,002

KeePassXC is a cross-platform community-driven port of the Windows application “Keepass Password Safe”.

12,603

Free cross-platform password manager compatible with KeePass

6,204

The slightly more awesome standard unix password manager for teams

Quick Overview

Bitwarden CLI is a command-line interface tool for the Bitwarden password management system. It allows users to access and manage their Bitwarden vault directly from the terminal, providing a powerful and flexible way to interact with passwords and other sensitive information stored in Bitwarden.

Pros

  • Cross-platform compatibility (Windows, macOS, Linux)
  • Seamless integration with existing Bitwarden accounts and vaults
  • Supports automation and scripting for password management tasks
  • Offers a wide range of commands for vault management and organization

Cons

  • Requires familiarity with command-line interfaces
  • Limited graphical feedback compared to the web or desktop applications
  • May require additional setup for certain features (e.g., file attachments)
  • Learning curve for users accustomed to graphical password managers

Code Examples

  1. Logging in to Bitwarden:
bw login [email] [password]
  1. Searching for an item in the vault:
bw list items --search "example.com"
  1. Creating a new item:
bw create item eyJuYW1lIjoiRXhhbXBsZSBJdGVtIiwidHlwZSI6MSwidXJsIjoiaHR0cHM6Ly9leGFtcGxlLmNvbSIsInVzZXJuYW1lIjoiZXhhbXBsZXVzZXIiLCJwYXNzd29yZCI6InNlY3VyZXBhc3N3b3JkMTIzIn0=
  1. Generating a password:
bw generate -u -l -n --length 16

Getting Started

  1. Install Bitwarden CLI:

    npm install -g @bitwarden/cli
    
  2. Log in to your Bitwarden account:

    bw login
    
  3. Unlock your vault:

    export BW_SESSION=$(bw unlock --raw)
    
  4. Start using Bitwarden CLI commands:

    bw list items
    bw get item google.com
    bw create folder "My New Folder"
    

Remember to lock your vault when finished:

bw lock

Competitor Comparisons

Unofficial Bitwarden compatible server written in Rust, formerly known as bitwarden_rs

Pros of Vaultwarden

  • Self-hosted solution, offering full control over data and infrastructure
  • Lightweight and resource-efficient, suitable for running on low-powered devices
  • Compatible with official Bitwarden clients and browser extensions

Cons of Vaultwarden

  • Lacks some advanced features present in the official Bitwarden server
  • May require more technical expertise to set up and maintain
  • Not officially supported by Bitwarden, potentially leading to compatibility issues

Code Comparison

Vaultwarden (Rust):

#[get("/sync")]
fn sync(headers: Headers, conn: DbConn, nt: Notify) -> JsonResult {
    let user = headers.user;
    let data = SyncData::build_json(&user, &conn, &nt, false);
    Ok(Json(data))
}

Bitwarden CLI (TypeScript):

export class SyncCommand extends Command {
  async run() {
    const response = await this.apiService.getSync();
    const decryptedSyncData = await this.cryptoService.decryptSyncData(response);
    await this.syncService.setLastSync(new Date());
    this.logger.info('Sync completed successfully.');
  }
}

While both repositories handle syncing, Vaultwarden implements it as a server-side function, whereas Bitwarden CLI focuses on client-side operations. Vaultwarden's implementation is more concise due to Rust's syntax, while Bitwarden CLI's TypeScript code is more verbose but potentially more readable for web developers.

LastPass command line interface tool

Pros of LastPass CLI

  • More mature project with longer development history
  • Supports a wider range of platforms, including older systems
  • Offers more advanced scripting capabilities for power users

Cons of LastPass CLI

  • Less actively maintained, with fewer recent updates
  • More complex setup process and configuration
  • Limited integration with other tools compared to Bitwarden CLI

Code Comparison

LastPass CLI example:

lpass login username@example.com
lpass show -c --password "My Site"
lpass generate --username=user@example.com "My Generated Password" 20

Bitwarden CLI example:

bw login
bw get password "My Site" --raw
bw generate --length 20 --uppercase --lowercase --number --special

Both CLIs offer similar core functionality, but Bitwarden's syntax is generally more straightforward. LastPass CLI provides more granular control over certain operations, while Bitwarden CLI focuses on simplicity and ease of use.

LastPass CLI is written in C, which can offer performance benefits but may be less accessible for contributors. Bitwarden CLI is built with Node.js, making it more approachable for JavaScript developers and easier to extend.

Overall, both tools serve their purpose well, with LastPass CLI catering to advanced users and Bitwarden CLI offering a more user-friendly experience for those new to password management CLIs.

23,002

KeePassXC is a cross-platform community-driven port of the Windows application “Keepass Password Safe”.

Pros of KeePassXC

  • Fully offline and self-contained, offering enhanced privacy and security
  • Open-source with a strong community-driven development approach
  • Supports a wide range of plugins and extensions for added functionality

Cons of KeePassXC

  • Lacks built-in synchronization across devices (requires third-party solutions)
  • User interface may be less intuitive for some users compared to Bitwarden CLI
  • Limited official mobile app support

Code Comparison

KeePassXC (C++):

void Database::setKey(const CompositeKey& key)
{
    m_key = key;
    m_kdf->randomize();
    m_masterSeed = randomGen()->randomArray(32);
}

Bitwarden CLI (TypeScript):

async setPassword(masterPassword: string): Promise<void> {
    const key = await this.cryptoService.makeKey(masterPassword, this.email);
    const encKey = await this.cryptoService.makeEncKey(key);
    await this.apiService.postAccountSetPassword(new SetPasswordRequest(key, encKey));
}

The code snippets demonstrate different approaches to key management and password setting in the two projects, reflecting their distinct architectures and security models.

12,603

Free cross-platform password manager compatible with KeePass

Pros of KeeWeb

  • Cross-platform desktop application with a user-friendly GUI
  • Supports offline usage and local file storage
  • Compatible with KeePass database format

Cons of KeeWeb

  • Limited integration with other services compared to Bitwarden
  • Fewer advanced features like secure sharing and password auditing
  • Less frequent updates and smaller community support

Code Comparison

KeeWeb (JavaScript):

const kdbxweb = require('kdbxweb');
const db = kdbxweb.Kdbx.create(credentials, 'My KeePass database');
const entry = db.createEntry(db.getDefaultGroup());
entry.fields.Title = 'My Entry';

Bitwarden CLI (TypeScript):

import { PasswordGenerationService } from '@bitwarden/common/services/passwordGeneration.service';

const passwordGenerationService = new PasswordGenerationService();
const password = await passwordGenerationService.generatePassword({ length: 14 });

Summary

KeeWeb is a standalone password manager with a focus on local storage and KeePass compatibility. It offers a user-friendly interface and offline capabilities. Bitwarden CLI, on the other hand, provides a command-line interface with stronger integration capabilities and more advanced features. The choice between the two depends on specific needs, such as local vs. cloud storage preferences and required features.

6,204

The slightly more awesome standard unix password manager for teams

Pros of gopass

  • Fully open-source and self-hosted, offering greater control over data
  • Supports GPG encryption for enhanced security
  • Integrates well with Git for version control and synchronization

Cons of gopass

  • Steeper learning curve, especially for users new to command-line tools
  • Lacks a built-in web interface or mobile apps
  • May require more manual configuration and maintenance

Code Comparison

gopass:

package main

import (
    "github.com/gopasspw/gopass/pkg/action"
    "github.com/urfave/cli/v2"
)

func main() {
    action.New(nil).Run()
}

Bitwarden CLI:

import * as program from 'commander';
import { Main } from './bw';

export class Program {
    static async run() {
        await Main.init();
        program.parse(process.argv);
    }
}

Both CLIs use command-line argument parsing libraries, but gopass is written in Go while Bitwarden CLI uses TypeScript. gopass's main function is more concise, while Bitwarden CLI's structure involves a separate class and initialization step.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

README

Archived

This repository is archived, please go to https://github.com/bitwarden/clients for future development.

Github Workflow build on master Join the chat at https://gitter.im/bitwarden/Lobby

Bitwarden Command-line Interface

Platforms

The Bitwarden CLI is a powerful, full-featured command-line interface (CLI) tool to access and manage a Bitwarden vault. The CLI is written with TypeScript and Node.js and can be run on Windows, macOS, and Linux distributions.

CLI

Download/Install

You can install the Bitwarden CLI multiple different ways:

NPM

If you already have the Node.js runtime installed on your system, you can install the CLI using NPM. NPM makes it easy to keep your installation updated and should be the preferred installation method if you are already using Node.js.

npm install -g @bitwarden/cli

Native Executable

We provide natively packaged versions of the CLI for each platform which have no requirements on installing the Node.js runtime. You can obtain these from the downloads section in the documentation.

Other Package Managers

Documentation

The Bitwarden CLI is self-documented with --help content and examples for every command. You should start exploring the CLI by using the global --help option:

bw --help

This option will list all available commands that you can use with the CLI.

Additionally, you can run the --help option on a specific command to learn more about it:

bw list --help
bw create --help

Detailed Documentation

We provide detailed documentation and examples for using the CLI in our help center at https://help.bitwarden.com/article/cli/.

Build/Run

Requirements

  • Node.js v16.13.1.
    • Testing is done against Node 16, other versions may work, but are not guaranteed.
  • NPM v8

Run the app

npm install
npm run sub:init # initialize the git submodule for jslib
npm run build:watch

You can then run commands from the ./build folder:

node ./build/bw.js login

We're Hiring!

Interested in contributing in a big way? Consider joining our team! We're hiring for many positions. Please take a look at our Careers page to see what opportunities are currently open as well as what it's like to work at Bitwarden.

Contribute

Code contributions are welcome! Please commit any pull requests against the master branch. Learn more about how to contribute by reading the CONTRIBUTING.md file.

Security audits and feedback are welcome. Please open an issue or email us privately if the report is sensitive in nature. You can read our security policy in the SECURITY.md file.

Prettier

We recently migrated to using Prettier as code formatter. All previous branches will need to updated to avoid large merge conflicts using the following steps:

  1. Check out your local Branch
  2. Run git merge ec53a16c005e0dd9aef6845c18811e8b14067168
  3. Resolve any merge conflicts, commit.
  4. Run npm run prettier
  5. Commit
  6. Run git merge -Xours 910b4a24e649f21acbf4da5b2d422b121d514bd5
  7. Push

Git blame

We also recommend that you configure git to ignore the prettier revision using:

git config blame.ignoreRevsFile .git-blame-ignore-revs

NPM DownloadsLast 30 Days