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.1.1

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.1.1
File Size Uploaded
keepassxc_cli_integration-2.1.1.tar.gz 10.6 kB Details

Built distribution (wheel)

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

Total release size: 24.6 kB

Release files / keepassxc_cli_integration-2.1.1.tar.gz

Download URL keepassxc_cli_integration-2.1.1.tar.gz
Size 10.6 kB
Tags Source
SHA-256 checksum
How to use checksums
dfa68ddcb046b972e28152c5cb6058711285b764633c7b6f30a6c5412ea78dff
BLAKE2b-256 checksum
How to use checksums
b490114c4d12bdb9a4edbe4a7e036a4ffa0eb5847056ae13fa46b0598c1039b5
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.1.1-py3-none-any.whl

Download URL keepassxc_cli_integration-2.1.1-py3-none-any.whl
Size 14.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9ed213ee90026457b88023ab4d0bf73b34bac18bec689a8cfea3391df2daad75
BLAKE2b-256 checksum
How to use checksums
1febaece05b2a0fa5decca2404e82ee20dbfbb53d2ede26fdf44cbce6eb9d0de
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

2.2.0

2 release files

This release

2.1.1 This release

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