keepassxc-run


Namekeepassxc-run JSON
Version 0.0.3 PyPI version JSON
download
home_pageNone
SummaryKeePassXC runner
upload_time2024-12-06 15:07:14
maintainerNone
docs_urlNone
authorNone
requires_python>=3.9
licenseMIT 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.0.3-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
```

## 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](images/example_com_entry.png)

```sh
export TEST_PASSWORD="keepassxc://example.com/password"
```

```console
$ keepassxc-run -- printenv TEST_PASSWORD
testuser*p@ssw0rd
```

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

![images/example_com_advanced_field.png](images/example_com_advanced_field.png)

```console
$ export TEST_PASSWORD="keepassxc://example.com/api_key"
$ keepassxc-run -- 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 --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/ed/af/341c9fa2165c370f20db6d7453f9bfec00b55722a154c74fe3aaba2dbe23/keepassxc_run-0.0.3.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.0.3-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```\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![images/example_com_entry.png](images/example_com_entry.png)\n\n```sh\nexport TEST_PASSWORD=\"keepassxc://example.com/password\"\n```\n\n```console\n$ keepassxc-run -- printenv TEST_PASSWORD\ntestuser*p@ssw0rd\n```\n\nYou can fetch additional attributes which start `KPH: ` like below.\n\n![images/example_com_advanced_field.png](images/example_com_advanced_field.png)\n\n```console\n$ export TEST_PASSWORD=\"keepassxc://example.com/api_key\"\n$ keepassxc-run -- 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 --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.0.3",
    "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": "7f0e339de3cc61cf0c6f28d729c34f34d8ab23e03133b39b76ea02cdf1f22038",
                "md5": "cca54a1eea32f58672ae2604c971b306",
                "sha256": "59d0b97ee3c36d14ae78809909dddd8dab3969b203c714d24cef91841941d9d2"
            },
            "downloads": -1,
            "filename": "keepassxc_run-0.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "cca54a1eea32f58672ae2604c971b306",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.9",
            "size": 6099,
            "upload_time": "2024-12-06T15:07:12",
            "upload_time_iso_8601": "2024-12-06T15:07:12.502876Z",
            "url": "https://files.pythonhosted.org/packages/7f/0e/339de3cc61cf0c6f28d729c34f34d8ab23e03133b39b76ea02cdf1f22038/keepassxc_run-0.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "edaf341c9fa2165c370f20db6d7453f9bfec00b55722a154c74fe3aaba2dbe23",
                "md5": "3592b405c6b5e4555543f26ff681acbb",
                "sha256": "366316fc59c39ddd192ee331f5db30878179b9801c44af7ca3d23580596eb79a"
            },
            "downloads": -1,
            "filename": "keepassxc_run-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "3592b405c6b5e4555543f26ff681acbb",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.9",
            "size": 7180,
            "upload_time": "2024-12-06T15:07:14",
            "upload_time_iso_8601": "2024-12-06T15:07:14.185187Z",
            "url": "https://files.pythonhosted.org/packages/ed/af/341c9fa2165c370f20db6d7453f9bfec00b55722a154c74fe3aaba2dbe23/keepassxc_run-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-12-06 15:07:14",
    "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"
}
        
Elapsed time: 1.05700s