Skip to main content
The Bitwarden CLI is a powerful, full-featured command-line interface tool to access and manage a Bitwarden vault. Built with TypeScript and Node.js, the CLI runs on Windows, macOS, and Linux distributions.

Use Cases

The CLI is designed for:
  • DevOps and CI/CD: Integrate vault access into automated workflows and deployment pipelines
  • Scripting: Automate password management and secret retrieval in scripts
  • Server Management: Access credentials on headless servers and remote systems
  • Power Users: Manage vault items efficiently from the terminal
  • API Mode: Run as a RESTful API server for programmatic access

Installation

NPM

If you have Node.js installed, NPM is the recommended installation method:
Verify installation:

Native Executables

Natively packaged versions are available with no Node.js runtime requirement. Download from the official downloads page.

Package Managers

Quick Start

Login and Unlock

Basic Operations

Global Options

All commands support these global options:
boolean
Format JSON output with two-space indentation
boolean
Return raw output instead of descriptive messages
boolean
Return JSON-formatted response output
boolean
Suppress all output to stdout
boolean
Disable interactive prompts for user input
string
Pass session key instead of reading from environment
boolean
Exit with code 0 even on errors (useful for scripting)

Environment Variables

The CLI respects several environment variables for configuration:
string
Session key for vault operations. Set after unlocking:
boolean
When set to "true", all output is structured JSON. Equivalent to --response flag.
Always output structured Response objects when this is enabled. Never use free-form text that would break JSON parsing.
boolean
When set to "true", suppresses all stdout output. Equivalent to --quiet flag.
boolean
When set to "true", exits with code 0 even on errors. Required for some scripting environments.
boolean
Format JSON output with indentation when set to "true".
boolean
Return raw output instead of descriptive messages when set to "true".
boolean
Disable interactive prompts when set to "true".
boolean
Automatically set to "true" when running in serve mode.

Help System

The CLI is self-documented with comprehensive help:

Architecture

The CLI is structured with modular programs:
  • Program (src/program.ts): Core commands (login, logout, lock, unlock, sync, generate, encode, config, update, status)
  • VaultProgram (src/vault.program.ts): Vault operations (list, get, create, edit, delete, archive, restore, share, confirm, import, export)
  • SendProgram (src/tools/send/send.program.ts): Send operations (create, list, get, edit, delete, receive)
  • ServeProgram (src/serve.program.ts): RESTful API server mode

Next Steps

Commands Reference

Complete reference for all CLI commands

Building from Source

Build and package the CLI yourself

Serve Mode

Run CLI as a RESTful API server