Skip to main content

keepassxc-cli-integration

CLI and Python integration for KeepassXC GUI.


CLI


  • kpx
    • base_settings:
      • --debug (Debug mode)
      • --env {{env}} (Env in format KEY=value. Can multiple entries. Supports KPX queries.)
    • commands:
      • get
        • login
          • {{url}} (Get login for the specified URL from open databases.)
        • password
          • {{url}} (Get password for the specified URL from open databases.)
        • --name (Specify the name of the entry in the database. Required if the URL has multiple entries.)
      • associate
        • add (Default. Create an association with the CURRENT ACTIVE database.)
        • delete
          • {{select}} (Default: "current". Delete the selected association. You can specify the association name as either "all" or "current".)
        • show (Show all saved associations.)
      • run
        • {{command}} (Run another program with query from KeePassXC.)

Python


The keepassxc_cli_integration.kpx module provides similar functions for use directly in Python.


Notes:

  • KeepassXC-GUI !!!MUST!!! have browser integration enabled.
  • The association is carried out only with the active (and not with all open) databases. In order to receive information from all open databases, you must first carry out an association with each of them.
  • Intended for Windows. May or may not work on Linux.
  • Due to limitations of KeepassXC-GUI, it is possible to retrieve records from databases only by URL. The URL field can be written in the database without http(s):\ and can also be specified without http(s):\ in CLI\Python to retrieve data.

Installation

  1. pip / pipx
pip (or pipx) install keepassxc-cli-integration
  1. git
git clone https://github.com/overgodofchaos/keepassxc_cli_integration.git
cd keepassxc-cli-integration
pip (or pipx) install .

Examples


Powershell.

kpx run poetry publish --build --username=__token__ --password=(kpx get password pypi.org --name pypi_token)

The query in kpx run has the following format: @kpx::{{url}}::{{login or password}}::{{name(optional)}}@kpx

kpx run poetry publish --build --username=__token__ --password=@kpx::pypi.org::password::pypi_token@kpx

This is mostly for CMD, as there is no convenient way to get the result from third-party functions.

Can be used in scripts:

example.ps1

$VeraCrypt = "C:\Program Files\VeraCrypt\VeraCrypt.exe"
$password = kpx get passoword example-vault

& $VeraCrypt /volume "C:\example\vault.hc" /letter Y /password $password /b /q

example2.ps1

$VeraCrypt = "C:\Program Files\VeraCrypt\VeraCrypt.exe"

kpx run $VeraCrypt /volume "C:\example\vault.hc" /letter Y /password $(kpx get passoword example-vault) /b /q

exemple3.bat

set VeraCrypt="C:\Program Files\VeraCrypt\VeraCrypt.exe"

VeraCrypt /volume "C:\example\vault.hc" /letter Y /password '@kpx::example-vault::password@kpx' /b /q

Metadata

Release files for keepassxc-cli-integration 2.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 keepassxc-cli-integration 2.2.0
File Size Uploaded
keepassxc_cli_integration-2.2.0.tar.gz 10.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for keepassxc-cli-integration 2.2.0
File Interpreter ABI Platform
keepassxc_cli_integration-2.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 24.9 kB

Release files / keepassxc_cli_integration-2.2.0.tar.gz

Download URL keepassxc_cli_integration-2.2.0.tar.gz
Size 10.7 kB
Tags Source
SHA-256 checksum
How to use checksums
e51922e265b9d2f79ba22d4bdb593ba1551792de0819ef697b7af01b5a146345
BLAKE2b-256 checksum
How to use checksums
d07639eb5ca9b51cb69155a461c252efe53f5f901740631ed22943304c276966
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / keepassxc_cli_integration-2.2.0-py3-none-any.whl

Download URL keepassxc_cli_integration-2.2.0-py3-none-any.whl
Size 14.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f8a351020f35ec7499b7cf3ee56cf528e74aa0a63918a6437fc5c85986a9aeae
BLAKE2b-256 checksum
How to use checksums
acc9a4e625ae9bcdc251623fda3ba3f321a12f52456219b6482ff985a0bf35b3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.11.28 {"installer":{"name":"uv","version":"0.11.28","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release history Release notifications | RSS feed

This release

2.2.0 This release

2 release files

2.1.1

2 release files

2.0.1

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.2

2 release files

1.3.0

2 release files

1.2.0

2 release files

1.1.0

2 release files

1.0.3

2 release files

1.0.2

2 release files

1.0.1

2 release files

1.0.0

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