KeePassXC runner
Project description
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
--no-masking Disable masking of secrets on stdout and stderr.
keepassxc-run depends on git-credential-keepassxc to fetch secrets from KeePassXC databases. Ensure that git-credential-keepassxc is installed and configured.
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.
Assume that TEST_PASSWORD environment variable is configured as below.
export TEST_PASSWORD="keepassxc://example.com/password"
If an environment variable starts with keepassxc://, keepassxc-run searches an entry matching URL in KeePassXC databases and pass a secret to subprocess as an environment variable value. keepassxc-run masks secret values in stdout and stderr by default as below.
$ keepassxc-run -- printenv TEST_PASSWORD
<concealed by keepassxc-run>
keepassxc-run turns off masking with --no-masking option.
$ keepassxc-run --no-masking -- printenv TEST_PASSWORD
testuser*p@ssw0rd
You can fetch additional attributes which start KPH: like below.
$ export TEST_PASSWORD="keepassxc://example.com/api_key"
$ keepassxc-run --no-masking -- printenv TEST_PASSWORD
my*api*key
Specify an environment file and use it:
echo "TEST_PASSWORD=keepassxc://example.com/password" > .env
$ keepassxc-run --no-masking --env-file .env -- printenv TEST_PASSWORD
testuser*p@ssw0rd
License
MIT License. See LICENSE for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file keepassxc_run-0.1.0.tar.gz.
File metadata
- Download URL: keepassxc_run-0.1.0.tar.gz
- Upload date:
- Size: 8.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c51d34d890515c7bc90bee62f4b05d7701194d3d7f3c6f3b06c725ce73266f5
|
|
| MD5 |
dd4b7fa3f0758a13d6c984cca8a7bc0b
|
|
| BLAKE2b-256 |
1f5652ad6a3e95bd2a64cca8671c17ddd828ba3f6ba2c61eed887fa09ff191fd
|
Provenance
The following attestation bundles were made for keepassxc_run-0.1.0.tar.gz:
Publisher:
release.yml on kai2nenobu/keepassxc-run
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
keepassxc_run-0.1.0.tar.gz -
Subject digest:
2c51d34d890515c7bc90bee62f4b05d7701194d3d7f3c6f3b06c725ce73266f5 - Sigstore transparency entry: 157636961
- Sigstore integration time:
-
Permalink:
kai2nenobu/keepassxc-run@8fa4c11c75328e643ac7d0d90b2620e592d6c442 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/kai2nenobu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8fa4c11c75328e643ac7d0d90b2620e592d6c442 -
Trigger Event:
release
-
Statement type:
File details
Details for the file keepassxc_run-0.1.0-py3-none-any.whl.
File metadata
- Download URL: keepassxc_run-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.0.1 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6400d19b3c318ec6ea507335ac6fc4785f8e4d8d81327a07114451ce8e8a7aae
|
|
| MD5 |
51fcd55efc6694ee5f834f4684fd7fe4
|
|
| BLAKE2b-256 |
bc842be45398cafdc9775b8e9e53f4de8646148d7d60b7db52fc2e38195753d6
|
Provenance
The following attestation bundles were made for keepassxc_run-0.1.0-py3-none-any.whl:
Publisher:
release.yml on kai2nenobu/keepassxc-run
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
keepassxc_run-0.1.0-py3-none-any.whl -
Subject digest:
6400d19b3c318ec6ea507335ac6fc4785f8e4d8d81327a07114451ce8e8a7aae - Sigstore transparency entry: 157636962
- Sigstore integration time:
-
Permalink:
kai2nenobu/keepassxc-run@8fa4c11c75328e643ac7d0d90b2620e592d6c442 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/kai2nenobu
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@8fa4c11c75328e643ac7d0d90b2620e592d6c442 -
Trigger Event:
release
-
Statement type: