Passlane
A password manager and authenticator CLI using Keepass as the storage backend. In addition to passwords, it supports authenticator functionality with Timed One Time Passwords (TOTP), secure saving and managing of payment cards and secure notes.
Passlane uses the Keepass encrypted file format for storing the data.
Passlane is written in Rust.
Features
- Keepass storage format which allows you to use the vault with other Keepass compatible applications
- Supports KDB, KDBX3 and KDBX4 file formats
- The keepass storage file can be optionally secured using a key file to provide additional protection
- Generate and save passwords
- Add optional notes to credentials (useful when you have several accounts on the same service)
- Save and view payment card information
- Save and view secure notes
- Authenticator functionality with TOTP
- Import passwords from CSV files
- Export vault contents to CSV files
- Clipboard auto-clear: passwords are automatically cleared from the clipboard after 10 seconds
--outflag for scripting: output passwords to stdout instead of the clipboard- Shell tab completion for bash, zsh, and fish with dynamic service/username suggestions
- REPL mode (interactive mode)
Table of contents
- Interactive Mode (REPL)
- Installation
- Usage
- Syncing data to your devices
- Other Keepass compatible applications
Interactive Mode (REPL)
The easiest way to get started with Passlane is to simply run it:
This launches an interactive session where you can use all of Passlane's features with short, easy-to-remember commands. If this is your first time, Passlane will walk you through creating a vault automatically.
🔐 Passlane — interactive mode
Type 'help' for commands, 'quit' to exit.
passlane> show user@
Found 3 credentials:
+---+------------------+---------------------+
| | Service | Username/email |
+===+==================+=====================+
| 0 | github.com | user@example.com |
| 1 | google.com | user@gmail.com |
| 2 | aws.amazon.com | user@company.com |
+---+------------------+---------------------+
> To copy one of these passwords to clipboard, please enter a row number from the table above: 0
Unlocking vault...
Password copied to clipboard!
passlane> show github
Password copied to clipboard!
passlane> add card
Enter card name: ...
passlane> gen
kX9#mP2$vL5@nQ8w
Password copied to clipboard.
passlane> quit
Available REPL commands
| Command | Description |
|---|---|
show [type] [pattern] |
Show entries (default: all credentials) |
add [type] |
Add a new entry (default: credential) |
edit [type] [pattern] |
Edit an existing entry |
delete [type] [pattern] |
Delete an entry |
gen |
Generate a random password |
import <file> |
Import credentials from a CSV file |
export [type] <file> |
Export entries to a CSV file |
unlock [otp] |
Store master password in keychain |
lock |
Remove master passwords from keychain |
status |
Show vault status |
completions |
Show how to install shell completions |
help [command] |
Show help for a command |
quit / exit |
Exit the session |
Types: creds (default), cards, notes, otp — with aliases like cred, card, note, totp, payments, credentials.
The REPL supports tab completion for commands and types, and command history (up/down arrows) that persists across sessions.
Note: All REPL functionality is available as CLI subcommands (
passlane show,passlane add, etc.). For example, to generate a password from the command line without entering the REPL, usepasslane gen.
Installation
- Download the latest release
- Unpack the archive
- Place the unarchived binary
passlaneto your $PATH
To compile from sources
- Install rust development environment: rustup
- Clone this repo
- Run build:
cargo build --release - Add the built
passlanebinary to your$PATH
Nix
Run with nix - following launches the interactive REPL:
To generate a password directly:
See below for more information on how to use the CLI.
Usage
First time setup
Run the init command to create a new vault file, or to link passlane to an existing Keepass compatible vault file. The command will interactively ask you for the required information.
You place the vault file to the cloud allowing access from all your devices. See below for more info.
Keypass key file
In addition to the master password, you can use a key file to provide additional protection for the vault file. At this
time, Passlane cannot be used to create a key file, but you can create one with KeepassXC or other Keepass compatible
app. Once you have the file, configure the location of this file in the .keyfile_path file in the ~/.passlane/ directory.
Locking and unlocking the vault
Use the unlock command to store the master password in your computer's keychain. This way you don't have to enter the master password every time you access your passwords and other vault contents. On Macs you can then use biometric authentication to gain access to the keychain and further to the vault without typing any passwords.
You can later remove the master password from the keychain with the lock command.
The one time passwords (OTPs) are stored in a separate vault file. You can unlock it with the same command accompanied with the -o option.
To lock the vaults use the lock command. This locks both the password vault and the OTP vault:
To get help on the available commands:
)
Generating and saving passwords
To generate a new password without saving it. The generated password value is copied to the clipboard and automatically cleared after 10 seconds. If you press Ctrl+C during the wait, the clipboard is cleared immediately before exiting.
To generate a password and print it to stdout without copying to the clipboard (useful for scripting):
To save new credentials by copying the password from clipboard:
To generate a new password and save credentials with one command:
When adding credentials, you will be prompted for an optional note. This is useful for annotating entries, e.g., "work account" or "admin access".
Using saved credentials
You can search and show saved credentials with regular expressions
Run passlane show foobar.com → shows foobar.com's password and copies it to the clipboard. The clipboard is automatically cleared after 10 seconds. If you press Ctrl+C during the wait, the clipboard is cleared immediately before exiting.
To print the password to stdout instead of copying to the clipboard (useful for scripting):
If the search finds more than one matches:
| | | |
+===+==========================================+================================+
| | | |
| | | |
||
| | | |
| | | |
||
| | | |
| | | |
||
| | | |
| | | |
||
| | | |
| | | |
Each credential row shows the service and username on the first line, and an optional note (prefixed with 📝) along with the last modified date on the second line. Notes are useful for distinguishing between multiple accounts on the same service.
Payment cards
To list all your saved payment cards.
| | | | | | |
+==============================================================================+
| | ) | | | | |
||
| | | | | | |
||
| | ) | | | | |
To save a payment card:
You can delete a note with the delete command and the -n option.
Secure notes
You can also save and manage secure notes in Passlane. The contents of notes, the title and the note text itself, are all fully encrypted and only visible to you.
You can store multiline notes in the vault. To add a secure note:
passlane add -n
To delete secure notes:
passlane delete -n
To show secure notes:
passlane show -n
Authenticator functionality
By default, Passlane stores the Timed One Time Passwords in a file named totp.json in the ~/.passlane/ directory.
You can change the location by storing the file path in a text file called .totp_vault_path in the ~/.passlane/ directory.
We recommend that you store the file in a separate location that is different from the main vault file. This way
you gain the benefit of two-factor authentication. You don't want to store these eggs in the same basket.
Here is an example where teh totp vault file is stored in Dropbox:
The TOTP vault has a separate master password that you need to enter when you access the one time passwords.
You can also store the master password in your computer's keychain to avoid typing it every time. Use
the unlock command with the -o option for this purpose.
To add a new one time password authentication entry:
Use -o to show the one time passwords. Following lists all OTP entries in the vault:
To look up by name of the issuer, use the following command:
the output will be:
)
)
Import from CSV
You can import credentials from a CSV file. With this approach, you can easily migrate from less elegant and often expensive commercial services.
First, make sure that the CSV file has a header line (1st line) with the following column titles:
- username
- password
- service
- note (optional)
The service field is the URL or name of the service. The note column is optional — if omitted, credentials will be imported without notes. When importing from Dashlane, the only necessary preparation is to rename url to service.
To export the credentials to a CSV file and import the file into Passlane:
Here are links to instructions for doing the CSV export:
Export to CSV
You can export all your vault contents to CSV files. The exported files can be imported to other password managers or to a spreadsheet program.
To export credentials to a file called creds.csv
To export payment cards to a file called cards.csv.
To export secure notes to a file called notes.csv
Scripting and Automation
The list command provides machine-readable output for scripting and automation. Unlike show, it prints all matches to stdout without clipboard interaction or interactive prompts.
For quick single-password lookups in scripts, you can also use show --out or gen --out to print a password to stdout without clipboard interaction:
# Get a single password to stdout
# Generate a password to stdout
⚠️ Security Warning: The
listcommand and--outflag output passwords and secrets to stdout. Be careful when redirecting output to files or using in scripts that log output.
# List all credentials
# List credentials matching a regex
# List all credentials as JSON
# List specific entry types
# Verbose plain text (includes passwords)
Scripting Examples
Find duplicate passwords using jq:
|
Extract credentials for a specific service:
CREDS=
USERNAME=
PASSWORD=
NOTE=
Export to another format:
|
Shell Completion
Passlane supports tab completion for bash, zsh, and fish. In addition to completing subcommands and flags, it provides dynamic completions that suggest service names and usernames from your vault.
Enabling shell completion
Run the completions command to generate and install the completion script for your shell:
# Auto-detect your shell
# Or specify the shell explicitly
This saves the completion script to ~/.passlane/completions.<shell> and prints the source command to add to your shell rc file. For example, for zsh:
Completions saved to /Users/you/.passlane/completions.zsh
Add this line to ~/.zshrc:
source "/Users/you/.passlane/completions.zsh"
Then restart your shell or run the command above.
Add the printed source line to your rc file (~/.zshrc, ~/.bashrc, or ~/.config/fish/config.fish), then restart your shell.
Tip: After upgrading Passlane, re-run
passlane completionsto regenerate the script with any new commands.
Dynamic completions
When your vault is unlocked, Passlane maintains a lightweight completion cache at ~/.passlane/.completion_cache containing service names and usernames (no passwords or secrets). This enables dynamic tab completions for show, edit, delete, and list commands.
The cache is automatically:
- Created when you run
passlane unlockor any command that opens the vault - Updated when you add, edit, delete, or import entries
- Refreshed when older than 7 days (if the vault is unlocked via keychain)
- Deleted when you run
passlane lock
Examples
Complete subcommands:
Complete flags:
Complete service names and usernames from your vault:
When the vault is locked (cache file doesn't exist), completions fall back to subcommands and flags only — no service names are suggested.
Syncing data to your devices
You can place the vault file to a cloud storage service like Dropbox, Google Drive, or iCloud Drive.
This way you can access your passwords from all your devices.
By default, Passlane assumes that the file is located at ~/.passlane/store.kdbx.
You can change the location by storing the file path in a text file called .vault_path at the ~/.passlane/ directory.
For example, this shows how John has stored the path /Users/john/Dropbox/Stuff/store.kdbx to the .vault_path file:
Other Keepass compatible applications
There are several other Keepass compatible applications that you can use to access the vault file:
- KeepassXC is a desktop application for Windows, macOS, and Linux
- KeepassXC-Browser
- KeePassium is a mobile application for iOS
- ... and many others