Skip to main content

VW Keystroke

VW Keystroke

PyPI License: MIT Python 3.9+ Platforms Vaultwarden / Bitwarden

Paste a secret once — it lands in your Vaultwarden/Bitwarden vault and a local 600 env file, in one move.

Built for the "hot potato" moment: you just generated an API key and you want it off your clipboard and safely stored without a five-step ritual — so it doesn't end up lingering in a scratch file. Name it, paste it, done.

  • 🗄️ Saves to your vault as a Login item (username = the env var, password = the value, with the env-file path recorded as a custom field).
  • 📄 Writes ~/.config/<project>.env (chmod 600, updated in place — never duplicated).
  • 🔒 Zero-knowledge: your master password never leaves your machine; all vault crypto is done by the official bw CLI.
  • ⚡ Caches the unlocked session in your OS keyring (Windows Credential Locker / macOS Keychain / Linux libsecret) so daily use needs no password.
  • 🖥️ GUI and CLI, on Windows / Linux / macOS.
  • 🔁 Full lifecycle: drop · status · pull · rotate · revoke — capture, reconcile, rebuild env files from the vault, rotate a value everywhere, or purge a secret from everywhere (env file, vault, shell history, clipboard).
  • 🔌 Pluggable backends: Vaultwarden/Bitwarden (default), KeePassXC (offline .kdbx), 1Password, HashiCorp Vault/OpenBao — one BACKEND= line switches the store.

The secret value is never passed on the command line and never echoed — only the 600 env file and your vault ever see it.


Requirements

  1. Bitwarden CLI — npm install -g @bitwarden/cli (provides bw).
  2. Python 3.9+ (Tkinter ships with the standard python.org installers).

Install

pipx install vw-keystroke        # recommended
# or
pip install --user vw-keystroke
# or straight from source:
pipx install git+https://github.com/PolyDevHouse/vw-keystroke

This gives you three commands: vwks (CLI), keydrop (alias), and vwks-gui (GUI).

First-time setup

# point bw at your server (self-hosted Vaultwarden, or Bitwarden cloud)
bw config server https://vault.example.com
bw login                          # email + master password + 2FA (once)

# optional config
mkdir -p ~/.config
cp vw-keystroke.conf.example ~/.config/vw-keystroke.conf && chmod 600 ~/.config/vw-keystroke.conf

Backends

Store secrets in the vault of your choice — pick one with BACKEND= in your config:

Backend BACKEND= Install Notes
Vaultwarden / Bitwarden (default) bitwarden needs the bw CLI self-hosted or cloud
KeePassXC keepass pipx install "vw-keystroke[keepass]" offline single .kdbx — ideal on a USB / VeraCrypt drive, no daemon
1Password 1password needs the op CLI service-account auth
HashiCorp Vault / OpenBao vault pipx install "vw-keystroke[vault]" self-hosted, KV-v2

Only items VW Keystroke created (marked with an env_file field) are ever listed, rotated, or revoked — your ordinary vault logins are never touched.

Use

GUI: launch VW Keystroke from your app menu (Linux .desktop in packaging/), or run vwks-gui.

CLI — the secret lifecycle:

vwks OPENAI_API_KEY --project openai        # capture (drop): -> ~/.config/openai.env + vault
echo -n "$SECRET" | vwks --var FOO --project bar    # piped / non-interactive
vwks status                                 # reconcile vault vs env files (match / drift / …)
vwks pull --project openai                  # rebuild the env file FROM the vault  (or --all)
vwks rotate OPENAI_API_KEY --generate --exec "systemctl --user restart mybot"
vwks revoke OPENAI_API_KEY                  # purge from env + vault + shell history + clipboard
vwks --lock                                 # forget the cached session + lock now

Configuration

~/.config/vw-keystroke.conf (all optional — see vw-keystroke.conf.example):

Key Meaning Default
BW_SERVER Vault server URL current bw config
DEFAULT_PROJECT env-file basename keys
VAULT_FOLDER folder for new items API Keys
KEYRING_TTL_DAYS cached-session lifetime (0 = never cache) 30
ENV_DIR where env files go ~/.config
BW_CLIENTID / BW_CLIENTSECRET optional API-key login —
BACKEND vault backend: bitwarden / keepass / 1password / vault bitwarden
HISTORY_FILES shell histories revoke scrubs ~/.zsh_history,~/.bash_history
KEEPASS_DB / KEEPASS_KEYFILE KeePass .kdbx path (+ optional keyfile) ~/.config/vwks.kdbx
OP_VAULT / OP_SERVICE_ACCOUNT_TOKEN 1Password target vault + service-account token —
VAULT_ADDR / VAULT_TOKEN / VAULT_MOUNT Vault URL, token, KV mount http://127.0.0.1:8200 / — / secret

How it works

bw handles login and all encryption. On a drop, VW Keystroke unlocks (or reuses a cached session), then creates/updates the vault item and the env file. If the vault is locked it asks for your master password once; the resulting session key is stored in your OS keyring with a TTL and refreshed on use.

Security notes

  • Nothing sensitive is stored by this tool except the 600 env file you asked for and the keyring session (same protection as your desktop login).
  • A cached session means anyone at your already-unlocked machine can drop/read keys — the same exposure as a logged-in browser vault extension. Set KEYRING_TTL_DAYS=0 to disable caching.
  • This project ships no credentials, servers, or keys of its own.

License

MIT © PolyDevHouse LLC

Metadata

Release files for vw-keystroke 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for vw-keystroke 0.2.0
File Size Uploaded
vw_keystroke-0.2.0.tar.gz 21.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for vw-keystroke 0.2.0
File Interpreter ABI Platform
vw_keystroke-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 44.8 kB

Release files / vw_keystroke-0.2.0.tar.gz

Download URL vw_keystroke-0.2.0.tar.gz
Size 21.7 kB
Tags Source
SHA-256 checksum
How to use checksums
017550951cd75e0f958a714e0e69d35fbd3d627298d37e7c2b7415b89b053eef
BLAKE2b-256 checksum
How to use checksums
e4037288b4eb3b12b11a8668a2a3c3014d862f16ceb33edd96a92426d19c13f6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release files / vw_keystroke-0.2.0-py3-none-any.whl

Download URL vw_keystroke-0.2.0-py3-none-any.whl
Size 23.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c71829d5bb858baf1f32c2fddc9591ced2606c8a1a22056ceff3b2bbef091e71
BLAKE2b-256 checksum
How to use checksums
9a362ad4d5fd76257edfc802f4e3c18f3217617e6d537462ed2683d61e629901
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.7

Release history Release notifications | RSS feed

0.3.0

2 release files

This release

0.2.0 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page