Skip to main content

CLI integration for KeepassXC GUI.

Project description

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

keepassxc_cli_integration-2.0.1.tar.gz (10.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

keepassxc_cli_integration-2.0.1-py3-none-any.whl (14.0 kB view details)

Uploaded Python 3

File details

Details for the file keepassxc_cli_integration-2.0.1.tar.gz.

File metadata

  • Download URL: keepassxc_cli_integration-2.0.1.tar.gz
  • Upload date:
  • Size: 10.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","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}

File hashes

Hashes for keepassxc_cli_integration-2.0.1.tar.gz
Algorithm Hash digest
SHA256 c6abb6a798ec9311d6d36f2d9714d71fc3ebfe04adb97a1f61c335fc941241b5
MD5 ab66e5314259154e30720e5022b9009a
BLAKE2b-256 4532c63de0df36a06e8c8fb5ab387cdfa81242868a4a19468edb8ad3ff2198d4

See more details on using hashes here.

File details

Details for the file keepassxc_cli_integration-2.0.1-py3-none-any.whl.

File metadata

  • Download URL: keepassxc_cli_integration-2.0.1-py3-none-any.whl
  • Upload date:
  • Size: 14.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.22 {"installer":{"name":"uv","version":"0.9.22","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}

File hashes

Hashes for keepassxc_cli_integration-2.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 22bbd69bf6f24d7336fe76aee66ee3553cd153bb121cec4e877188297a109580
MD5 aac86a064112d8dc2fa6d619bb3b6748
BLAKE2b-256 1a080e19526b9c23b83f1cea936e308c9a8dc7e9b1d46747c90d122719f5e6b7

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page