Install
openclaw skills install @lanjelin/claw-kpassopenclaw skills install @lanjelin/claw-kpasskpass is a pass-like CLI for KeePass KDBX databases, built on pykeepass.
pipx install 'kpass-cli>=0.2.0'; upgrade an existing installation with pipx upgrade kpass-cli.kpass --version before use. The skill depends on --non-interactive and generate --quiet, introduced in kpass 0.2.0.kpass on PATH and access to the vault and its unlock credentials. Sandboxed execution needs these inside the sandbox too.| Variable | Purpose |
|---|---|
KPASS_DB | Database path |
KPASS_PASSWORD_FILE | File containing the vault password on its first line |
KPASS_PASSWORD | Alternative: vault password in the process environment |
KPASS_KEYFILE | Keyfile required by the vault, if any |
Use absolute paths. Restrict access to password files and keyfiles (for example, chmod 600 on Unix). Do not print credentials or dump the environment to troubleshoot configuration.
Prefer environment configuration as an operating convention, not as a claim about CLI precedence: explicit --db, --db-password-file, and --db-keyfile options can override it. Avoid putting secrets in command-line arguments or shell history.
Configure only the password source needed; keyfiles may be required in addition to a password. Keyfile-only vaults need no password. When opening an existing vault interactively with only a keyfile configured, kpass tries the keyfile alone and prompts once for a password on authentication failure. It does not prompt over an explicitly supplied password or for non-authentication errors. Use --non-interactive for unattended execution: password fallback is disabled, missing required input fails instead of prompting, and edit is rejected instead of opening an editor. If access is not provisioned, report the missing setup rather than trying passwords or changing vault credentials.
--all, and --xml can expose secrets; use them only for an explicitly requested inspection with appropriate output handling. --all can include entry history.insert updates existing entries; generate replaces an existing entry's password. Confirm the exact target and that the requested change is authorized. Do not generate a replacement merely to retrieve a password.rm -f is permanent. Vault credential changes also require updating the external unlock configuration.Start with a targeted search when the entry path is unknown:
kpass --non-interactive find example.com
kpass --non-interactive find work email
kpass --non-interactive ls group/subgroup
find searches names/paths, not secret values. kpass lists the database tree; kpass group/subgroup lists a subtree. Avoid listing the whole vault unnecessarily.
kpass --non-interactive show "group/entry" -u
kpass --non-interactive show "group/entry" -p
kpass --non-interactive show "group/entry" -o
show -o returns the current TOTP code, not its seed. Reading a password or OTP to stdout needs the secret-safe execution channel described above.
Field selectors for show and edit:
| Flag | Field |
|---|---|
-u, --username | Username |
-p, --password | Password |
-e, --email | Email custom property |
-l, --url | URL |
-n, --notes | Notes |
-o, --otp | Current TOTP code for show; stored seed/URI for edit |
For an explicitly requested local clipboard operation:
kpass --non-interactive show "group/entry" -p --clip
kpass --non-interactive show "group/entry" -o --clip
--clip requires exactly one field selector. It uses Tkinter and needs a working local GUI/clipboard; it is not a headless secret-delivery mechanism. If copying fails, report the failure rather than falling back to printing the secret.
Update non-secret fields without an editor:
kpass --non-interactive insert "group/entry" -u alice -l https://example.com
insert creates a missing entry or updates supplied fields on an existing one, leaving unspecified fields unchanged. insert and generate can also create a missing database: verify the intended vault exists before using either on an existing store.
For an authorized generated password, suppress the password that generate otherwise prints:
kpass --non-interactive generate "group/new-entry" -u alice -L 32 --quiet
--quiet saves without printing the generated password. -L, --length defaults to 32. generate accepts -u, -e, -l, -n, and --otp, but not -p or short -o.
For inserting a supplied password, kpass --non-interactive insert "group/entry" -p reads the first line from non-terminal stdin. Feed it only from an approved secret source without embedding the secret in a command string. Surrounding whitespace is preserved; only the line terminator is removed. A blank line explicitly supplies an empty password; EOF fails in non-interactive mode. Password files follow the same first-line rule, but an actually empty file is an error. Without --non-interactive, absent stdin input can trigger a prompt.
insert field flags take values except for the password prompt flag. insert -o/--otp stores a TOTP seed or otpauth:// URI. Do not place real passwords or TOTP seeds in command arguments; use a secure interactive workflow if no suitable automated input exists.
kpass edit "group/entry" -n
edit requires exactly one field selector and launches $VISUAL, then $EDITOR, falling back to vi. It writes the selected field to a temporary plaintext file while editing. Use only when interactive editing is available and appropriate; prefer insert for unattended updates to supported non-secret fields.
show "group/entry" -o for the current code; there is no otp command.insert --otp stores a seed or otpauth:// URI; edit -o edits the stored seed/URI, not a current code.TOTP Seed as a fallback when the standard OTP value is absent. Reads and edit -o use the same precedence: a populated standard value, then the first populated supported custom seed. Editing a custom seed preserves its protection flag. Avoid mixing representations unnecessarily.These commands operate on entries or groups. Check scope and authorization first:
kpass --non-interactive cp "old/path" "new/path"
kpass --non-interactive mv "old/path" "new/path"
kpass --non-interactive rm "old/path"
rm moves the target to the Recycle Bin. Use kpass --non-interactive rm -f "old/path" only when permanent deletion was explicitly authorized. Copying also duplicates secrets; verify the intended destination.
Only when explicitly requested:
kpass --non-interactive --db /absolute/path/to/new.kdbx init
kpass --non-interactive vault --set-password
kpass --non-interactive vault --set-keyfile /absolute/path/to/keyfile
init PATH overrides KPASS_DB. If both --db and a positional path are supplied, they must identify the same database; otherwise initialization fails. Extensionless paths receive .kdbx. init refuses to overwrite an existing database. In non-interactive mode, creation requires preconfigured password/keyfile credentials.
vault changes database unlock credentials, not entry data. --set-password reads the new password from an approved stdin source in non-interactive mode; it does not generate one. Without that mode it can prompt. Empty passwords are rejected from every input route without modifying the vault; use the explicit --clear-password operation for deliberate removal. Whitespace-only passwords are preserved, not treated as empty. --clear-password and --clear-keyfile remove the corresponding unlock factors and must not be used to work around failed authentication. Check that the intended remaining protection is configured before removing a factor, and coordinate updating the external credential source before further commands.