Skip to main content

KeePassXC runner

Project description

PyPI PythonVersions LICENSE CI

keepassxc-run

Pass secrets in KeePassXC databases as environment variables to an application or script. This project is inspired by op run command.

usage: keepassxc-run.py [options] -- [command ...]

positional arguments:
  command              command to execute. prepend "--" if you specify command option like "--version"

options:
  --help               show this help message
  --debug              Enable debug log
  --env-file ENV_FILE  Enable Dotenv integration with specific Dotenv files to parse. For example: --env-file=.env

Usage

keepassxc-run scans environment variables for secret references, loads the corresponding secrets from KeePassXC databases, then runs the provided command in a subprocess with the secrets made available as environment variables for the duration of the subprocess.

If the same environment variable name exists in both the shell and the environment file, the environment file takes precedence. If the same environment variable name exists in multiple environment files, the last environment file takes precedence.

Examples

Suppose the KeePassXC database contains an entry like a image below.

images/example_com_entry.png

export TEST_PASSWORD="keepassxc://example.com/password"
$ keepassxc-run -- printenv TEST_PASSWORD
testuser*p@ssw0rd

You can fetch additional attributes which start KPH: like below.

images/example_com_advanced_field.png

$ export TEST_PASSWORD="keepassxc://example.com/api_key"
$ keepassxc-run -- printenv TEST_PASSWORD
my*api*key

Specify an environment file and use it:

echo "TEST_PASSWORD=keepassxc://example.com/password" > .env
$ keepassxc-run --env-file .env -- printenv TEST_PASSWORD
testuser*p@ssw0rd

License

MIT License. See LICENSE for details.

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_run-0.0.3.tar.gz (7.2 kB view details)

Uploaded Source

Built Distribution

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

keepassxc_run-0.0.3-py3-none-any.whl (6.1 kB view details)

Uploaded Python 3

File details

Details for the file keepassxc_run-0.0.3.tar.gz.

File metadata

  • Download URL: keepassxc_run-0.0.3.tar.gz
  • Upload date:
  • Size: 7.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for keepassxc_run-0.0.3.tar.gz
Algorithm Hash digest
SHA256 366316fc59c39ddd192ee331f5db30878179b9801c44af7ca3d23580596eb79a
MD5 3592b405c6b5e4555543f26ff681acbb
BLAKE2b-256 edaf341c9fa2165c370f20db6d7453f9bfec00b55722a154c74fe3aaba2dbe23

See more details on using hashes here.

Provenance

The following attestation bundles were made for keepassxc_run-0.0.3.tar.gz:

Publisher: release.yml on kai2nenobu/keepassxc-run

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file keepassxc_run-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: keepassxc_run-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 6.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/5.1.1 CPython/3.12.7

File hashes

Hashes for keepassxc_run-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 59d0b97ee3c36d14ae78809909dddd8dab3969b203c714d24cef91841941d9d2
MD5 cca54a1eea32f58672ae2604c971b306
BLAKE2b-256 7f0e339de3cc61cf0c6f28d729c34f34d8ab23e03133b39b76ea02cdf1f22038

See more details on using hashes here.

Provenance

The following attestation bundles were made for keepassxc_run-0.0.3-py3-none-any.whl:

Publisher: release.yml on kai2nenobu/keepassxc-run

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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