Skip to content

j23n/px

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

px — pass extended

A thin wrapper around pass that adds fuzzy entry matching, field-level clipboard copying, and structured entry creation. All native pass commands pass through unchanged.

Features

  • px copy <entry> [field] — copy any field to clipboard; defaults to password
  • px copy <entry> otp — copy TOTP code via pass-otp
  • px new <entry> [options] — generate a password and set metadata in one step
  • Fuzzy matchingpx copy github finds work/logins/github automatically
  • Full passthroughpx ls, px git pull, px rm, etc. all work as normal
  • Shell completion — entry paths complete in both bash and zsh

Dependencies

Dependency Required Purpose
pass yes password store backend
wl-copy yes on Wayland clipboard (required by pass -c and px copy)
xclip yes on X11 clipboard (required by pass -c and px copy)
fzf no fuzzy entry matching (falls back to substring)

pass -c is used for password fields, so its built-in clipboard handling (including the 45-second clear timer) is preserved. px copy uses the same tools for non-password fields.

Installation

# GitHub
git clone https://github.com/j23n/px ~/.local/share/px

# Radicle
rad clone rad:z27yWagkYxPet8Fsxoic8wZuHDXoe ~/.local/share/px

Add to ~/.bashrc or ~/.zshrc:

# Load px
source ~/.local/share/px/px.sh

# Bash completion
source ~/.local/share/px/completions/px.bash

# Zsh completion — add BEFORE compinit
fpath=(~/.local/share/px/completions $fpath)

Usage

px copy <entry> [field]      Copy a field to clipboard (default: password)
px copy <entry> otp          Copy TOTP code (requires pass-otp)
px new  <entry> [options]    Generate a new entry with metadata

Options for 'new':
  --username, -u USER          Set Username field
  --url URL                    Set URL field
  --length, -l N               Password length (default: 32)
  --no-symbols, -n             Exclude symbols from generated password

All other commands forward to pass:
  px show, px ls, px generate, px rm, px mv, px cp, px git, px init, ...

Examples

# Copy password to clipboard (uses pass -c, clears after 45s)
px copy github

# Fuzzy match — finds work/logins/github automatically
px copy github username
px copy github url

# Copy TOTP code (requires pass-otp extension)
px copy github otp

# Multiple fuzzy matches → interactive fzf picker
px copy git

# Create a new entry with metadata in one step
px new work/github \
  --username alice@work.com \
  --url https://github.com

# Generate without symbols, custom length
px new personal/email --length 20 --no-symbols

# All regular pass commands work
px ls
px show work/github
px git pull
px rm old/entry

Entry format

px expects the standard pass multiline format — first line is the password, remaining lines are Key: Value pairs:

s3cr3tP@ssw0rd
Username: alice@example.com
URL: https://example.com
TOTP: JBSWY3DPEHPK3PXP

Field matching in px copy is case-insensitive, so username, Username, and USERNAME all work.

Fuzzy matching behaviour

fzf available Result Behaviour
yes 1 match proceeds silently
yes multiple interactive fzf picker
yes 0 matches error
no 1 exact or substring match proceeds silently
no multiple substrings error + list of matches
no 0 matches error

About

Pass, but with support for fuzzy matching and copying structured data (like username and URL)

Topics

Resources

License

Stars

Watchers

Forks

Contributors

Languages