Name | keepassxc-run JSON |
Version |
0.1.0
JSON |
| download |
home_page | None |
Summary | KeePassXC runner |
upload_time | 2024-12-25 16:59:38 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | MIT License |
keywords |
keepassxc
|
VCS |
 |
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
[![PyPI][pypi_badge]][pypi_project] ![PythonVersions][pyversions] [![LICENSE][license_badge]][license_url] [![CI][actions_status]][ci_workflow]
[pypi_project]: https://pypi.org/project/keepassxc-run/
[pypi_badge]: https://img.shields.io/badge/pypi-v0.1.0-orange
[license_badge]: https://img.shields.io/badge/license-MIT-green
[license_url]: https://github.com/kai2nenobu/keepassxc-run/blob/main/LICENSE
[pyversions]: https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue
[actions_status]: https://github.com/kai2nenobu/keepassxc-run/actions/workflows/ci.yml/badge.svg
[ci_workflow]: https://github.com/kai2nenobu/keepassxc-run/actions/workflows/ci.yml
# keepassxc-run
Pass secrets in KeePassXC databases as environment variables to an application or script. This project is inspired by [op run](https://developer.1password.com/docs/cli/reference/commands/run/) command.
```sh
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](https://github.com/Frederick888/git-credential-keepassxc) to fetch secrets from KeePassXC databases. Ensure that `git-credential-keepassxc` is installed and [configured](https://github.com/Frederick888/git-credential-keepassxc?tab=readme-ov-file#configuration).
## 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.
```sh
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.
```console
$ 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.

```console
$ 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:
```sh
echo "TEST_PASSWORD=keepassxc://example.com/password" > .env
```
```console
$ keepassxc-run --no-masking --env-file .env -- printenv TEST_PASSWORD
testuser*p@ssw0rd
```
## License
MIT License. See [LICENSE](./LICENSE) for details.
Raw data
{
"_id": null,
"home_page": null,
"name": "keepassxc-run",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": null,
"keywords": "keepassxc",
"author": null,
"author_email": "Tsunenobu Kai <kai2nenobu@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/1f/56/52ad6a3e95bd2a64cca8671c17ddd828ba3f6ba2c61eed887fa09ff191fd/keepassxc_run-0.1.0.tar.gz",
"platform": null,
"description": "[![PyPI][pypi_badge]][pypi_project] ![PythonVersions][pyversions] [![LICENSE][license_badge]][license_url] [![CI][actions_status]][ci_workflow]\n\n[pypi_project]: https://pypi.org/project/keepassxc-run/\n[pypi_badge]: https://img.shields.io/badge/pypi-v0.1.0-orange\n[license_badge]: https://img.shields.io/badge/license-MIT-green\n[license_url]: https://github.com/kai2nenobu/keepassxc-run/blob/main/LICENSE\n[pyversions]: https://img.shields.io/badge/python-3.9%20%7C%203.10%20%7C%203.11%20%7C%203.12%20%7C%203.13-blue\n[actions_status]: https://github.com/kai2nenobu/keepassxc-run/actions/workflows/ci.yml/badge.svg\n[ci_workflow]: https://github.com/kai2nenobu/keepassxc-run/actions/workflows/ci.yml\n\n# keepassxc-run\n\nPass secrets in KeePassXC databases as environment variables to an application or script. This project is inspired by [op run](https://developer.1password.com/docs/cli/reference/commands/run/) command.\n\n```sh\nusage: keepassxc-run.py [options] -- [command ...]\n\npositional arguments:\n command command to execute. prepend \"--\" if you specify command option like \"--version\"\n\noptions:\n --help show this help message\n --debug Enable debug log\n --env-file ENV_FILE Enable Dotenv integration with specific Dotenv files to parse. For example: --env-file=.env\n --no-masking Disable masking of secrets on stdout and stderr. \n```\n\n`keepassxc-run` depends on [git-credential-keepassxc](https://github.com/Frederick888/git-credential-keepassxc) to fetch secrets from KeePassXC databases. Ensure that `git-credential-keepassxc` is installed and [configured](https://github.com/Frederick888/git-credential-keepassxc?tab=readme-ov-file#configuration).\n\n## Usage\n\n`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.\n\nIf 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.\n\n## Examples\n\nSuppose the KeePassXC database contains an entry like a image below.\n\n\n\nAssume that `TEST_PASSWORD` environment variable is configured as below.\n\n```sh\nexport TEST_PASSWORD=\"keepassxc://example.com/password\"\n```\n\nIf 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.\n\n```console\n$ keepassxc-run -- printenv TEST_PASSWORD\n<concealed by keepassxc-run>\n```\n\n`keepassxc-run` turns off masking with `--no-masking` option.\n\n```\n$ keepassxc-run --no-masking -- printenv TEST_PASSWORD\ntestuser*p@ssw0rd\n```\n\nYou can fetch additional attributes which start `KPH: ` like below.\n\n\n\n```console\n$ export TEST_PASSWORD=\"keepassxc://example.com/api_key\"\n$ keepassxc-run --no-masking -- printenv TEST_PASSWORD\nmy*api*key\n```\n\nSpecify an environment file and use it:\n\n```sh\necho \"TEST_PASSWORD=keepassxc://example.com/password\" > .env\n```\n\n```console\n$ keepassxc-run --no-masking --env-file .env -- printenv TEST_PASSWORD\ntestuser*p@ssw0rd\n```\n\n## License\n\nMIT License. See [LICENSE](./LICENSE) for details.\n",
"bugtrack_url": null,
"license": "MIT License",
"summary": "KeePassXC runner",
"version": "0.1.0",
"project_urls": {
"changelog": "https://github.com/kai2nenobu/keepassxc-run/blob/main/CHANGELOG.md",
"documentation": "https://github.com/kai2nenobu/keepassxc-run#keepassxc-run",
"homepage": "https://github.com/kai2nenobu/keepassxc-run",
"issues": "https://github.com/kai2nenobu/keepassxc-run/issues",
"source": "https://github.com/kai2nenobu/keepassxc-run"
},
"split_keywords": [
"keepassxc"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bc842be45398cafdc9775b8e9e53f4de8646148d7d60b7db52fc2e38195753d6",
"md5": "51fcd55efc6694ee5f834f4684fd7fe4",
"sha256": "6400d19b3c318ec6ea507335ac6fc4785f8e4d8d81327a07114451ce8e8a7aae"
},
"downloads": -1,
"filename": "keepassxc_run-0.1.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "51fcd55efc6694ee5f834f4684fd7fe4",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 7411,
"upload_time": "2024-12-25T16:59:36",
"upload_time_iso_8601": "2024-12-25T16:59:36.091563Z",
"url": "https://files.pythonhosted.org/packages/bc/84/2be45398cafdc9775b8e9e53f4de8646148d7d60b7db52fc2e38195753d6/keepassxc_run-0.1.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "1f5652ad6a3e95bd2a64cca8671c17ddd828ba3f6ba2c61eed887fa09ff191fd",
"md5": "dd4b7fa3f0758a13d6c984cca8a7bc0b",
"sha256": "2c51d34d890515c7bc90bee62f4b05d7701194d3d7f3c6f3b06c725ce73266f5"
},
"downloads": -1,
"filename": "keepassxc_run-0.1.0.tar.gz",
"has_sig": false,
"md5_digest": "dd4b7fa3f0758a13d6c984cca8a7bc0b",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 8334,
"upload_time": "2024-12-25T16:59:38",
"upload_time_iso_8601": "2024-12-25T16:59:38.791329Z",
"url": "https://files.pythonhosted.org/packages/1f/56/52ad6a3e95bd2a64cca8671c17ddd828ba3f6ba2c61eed887fa09ff191fd/keepassxc_run-0.1.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-12-25 16:59:38",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "kai2nenobu",
"github_project": "keepassxc-run",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"tox": true,
"lcname": "keepassxc-run"
}