xontrib-1password


Namexontrib-1password JSON
Version 0.3.2 PyPI version JSON
download
home_pageNone
Summary1password support for xonsh
upload_time2025-07-20 19:34:33
maintainerNone
docs_urlNone
authorMike Crowe
requires_python>=3.8
licenseMIT
keywords xontrib xonsh
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            <p align="center">
<a href="https://1password.com/">1password</a> support for xonsh shell. This approach ensures your sensitive information remains secure while being easily accessible in your xonsh shell.
</p>

<p align="center">
If you like the idea click ⭐ on the repo and <a href="https://twitter.com/intent/tweet?text=Nice%20xontrib%20for%20the%20xonsh%20shell!&url=https://github.com/drmikecrowe/xontrib-1password" target="_blank">tweet</a>.
</p>

## Installation

To install use pip:

```xsh
xpip install xontrib-1password
# or: xpip install -U git+https://github.com/drmikecrowe/xontrib-1password
```

The xontrib will get loaded automatically.

## Usage

For maximum security, enable your secrets dynamically using the command below when required. You may also enable permanently and expose your secrets at all times in your [Run Control (RC) file](https://xon.sh/xonshrc.html):

```xsh
$XONTRIB_1PASSWORD_ENABLED = True
```

Store your passwords in [1Password](https://1password.com/) and setup [`op` CLI](https://developer.1password.com/docs/cli/) locally.
Then:
```xsh
mykey = OnePass("op://path/my/key")
echo @(mykey)
# my-key-value

$MYKEY = OnePass("op://path/my/key")
echo $MYKEY
# my-key-value

env | grep MYKEY
# MYKEY=my-key-value
```

## Good to know

### Disabling

To disable autoloading:
```xsh
$XONTRIBS_AUTOLOAD_DISABLED = ["1password", ]
```
To turn off:
```xsh
$XONTRIB_1PASSWORD_ENABLED = False
$MYKEY = OnePass("op://path/my/key")
$MYKEY
# op://path/my/key
```

### Get certain key

Because of the URL is basically `op://<Vault>/<title>/<field>` to find this, here's the commands you can use to determine these fields:

```sh
op item list --format json | jq '.[].title | select(. | contains("OpenAI"))'
# "OpenAI-API-Key"
op item get OpenAI-API-Key --format json | jq '.fields[] | select(.type == "CONCEALED") | .label'
# "api-key"
```

### Debug mode

```xsh
$XONTRIB_1PASSWORD_DEBUG = True
```

### Cache

You can set `$XONTRIB_1PASSWORD_CACHE` to string:
* `not_empty` (default) - cache not empty values.
* `all` - cache all values.
* `off` - disable caching.

## Known issues

### Slowing down reading environment variables

If you disable cache (i.e. `$XONTRIB_1PASSWORD_CACHE='off'`) in case of `$MYVAR = OnePass(...)` every time the shell read the env variables list the value will be requested from OnePassword and it takes time.

## Development

- activate [pre-commit](https://github.com/pre-commit/pre-commit) hooks
```sh
# install pre-commit plugins and activate the commit hook
pre-commit install
pre-commit autoupdate
```

### Releasing your package

- Bump the version of your package.
- Create a GitHub release (The release notes are automatically generated as a draft release after each push).
- And publish with `poetry publish --build` or `twine`

## Credits

This package was created with [xontrib template](https://github.com/xonsh/xontrib-template).



            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "xontrib-1password",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "xontrib, xonsh",
    "author": "Mike Crowe",
    "author_email": "drmikecrowe@gmail.com",
    "download_url": "https://files.pythonhosted.org/packages/df/ee/6308a9474c0f391ce2b2f1c22c9b0c4bb9f10e80a11ad6b9c54177ebc93a/xontrib_1password-0.3.2.tar.gz",
    "platform": null,
    "description": "<p align=\"center\">\n<a href=\"https://1password.com/\">1password</a> support for xonsh shell. This approach ensures your sensitive information remains secure while being easily accessible in your xonsh shell.\n</p>\n\n<p align=\"center\">\nIf you like the idea click \u2b50 on the repo and <a href=\"https://twitter.com/intent/tweet?text=Nice%20xontrib%20for%20the%20xonsh%20shell!&url=https://github.com/drmikecrowe/xontrib-1password\" target=\"_blank\">tweet</a>.\n</p>\n\n## Installation\n\nTo install use pip:\n\n```xsh\nxpip install xontrib-1password\n# or: xpip install -U git+https://github.com/drmikecrowe/xontrib-1password\n```\n\nThe xontrib will get loaded automatically.\n\n## Usage\n\nFor maximum security, enable your secrets dynamically using the command below when required. You may also enable permanently and expose your secrets at all times in your [Run Control (RC) file](https://xon.sh/xonshrc.html):\n\n```xsh\n$XONTRIB_1PASSWORD_ENABLED = True\n```\n\nStore your passwords in [1Password](https://1password.com/) and setup [`op` CLI](https://developer.1password.com/docs/cli/) locally.\nThen:\n```xsh\nmykey = OnePass(\"op://path/my/key\")\necho @(mykey)\n# my-key-value\n\n$MYKEY = OnePass(\"op://path/my/key\")\necho $MYKEY\n# my-key-value\n\nenv | grep MYKEY\n# MYKEY=my-key-value\n```\n\n## Good to know\n\n### Disabling\n\nTo disable autoloading:\n```xsh\n$XONTRIBS_AUTOLOAD_DISABLED = [\"1password\", ]\n```\nTo turn off:\n```xsh\n$XONTRIB_1PASSWORD_ENABLED = False\n$MYKEY = OnePass(\"op://path/my/key\")\n$MYKEY\n# op://path/my/key\n```\n\n### Get certain key\n\nBecause of the URL is basically `op://<Vault>/<title>/<field>` to find this, here's the commands you can use to determine these fields:\n\n```sh\nop item list --format json | jq '.[].title | select(. | contains(\"OpenAI\"))'\n# \"OpenAI-API-Key\"\nop item get OpenAI-API-Key --format json | jq '.fields[] | select(.type == \"CONCEALED\") | .label'\n# \"api-key\"\n```\n\n### Debug mode\n\n```xsh\n$XONTRIB_1PASSWORD_DEBUG = True\n```\n\n### Cache\n\nYou can set `$XONTRIB_1PASSWORD_CACHE` to string:\n* `not_empty` (default) - cache not empty values.\n* `all` - cache all values.\n* `off` - disable caching.\n\n## Known issues\n\n### Slowing down reading environment variables\n\nIf you disable cache (i.e. `$XONTRIB_1PASSWORD_CACHE='off'`) in case of `$MYVAR = OnePass(...)` every time the shell read the env variables list the value will be requested from OnePassword and it takes time.\n\n## Development\n\n- activate [pre-commit](https://github.com/pre-commit/pre-commit) hooks\n```sh\n# install pre-commit plugins and activate the commit hook\npre-commit install\npre-commit autoupdate\n```\n\n### Releasing your package\n\n- Bump the version of your package.\n- Create a GitHub release (The release notes are automatically generated as a draft release after each push).\n- And publish with `poetry publish --build` or `twine`\n\n## Credits\n\nThis package was created with [xontrib template](https://github.com/xonsh/xontrib-template).\n\n\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "1password support for xonsh",
    "version": "0.3.2",
    "project_urls": {
        "Code": "https://github.com/drmikecrowe/xontrib-1password",
        "Documentation": "https://github.com/drmikecrowe/xontrib-1password/blob/master/README.md",
        "Homepage": "https://github.com/drmikecrowe/xontrib-1password",
        "Issue tracker": "https://github.com/drmikecrowe/xontrib-1password/issues",
        "Repository": "https://github.com/drmikecrowe/xontrib-1password"
    },
    "split_keywords": [
        "xontrib",
        " xonsh"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "f25dbe1fdc0e86c7ba5dc9db3ef04c0fcece2f4970ec5c47f110f851c145b89e",
                "md5": "f594a1dbe6a987861399e8797a39bc9a",
                "sha256": "51e84b7ae070a7c02d4d612b5c4ad563ada1e3e5c5eb820fb87b4fc40eb2bb8c"
            },
            "downloads": -1,
            "filename": "xontrib_1password-0.3.2-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "f594a1dbe6a987861399e8797a39bc9a",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 5762,
            "upload_time": "2025-07-20T19:34:32",
            "upload_time_iso_8601": "2025-07-20T19:34:32.491636Z",
            "url": "https://files.pythonhosted.org/packages/f2/5d/be1fdc0e86c7ba5dc9db3ef04c0fcece2f4970ec5c47f110f851c145b89e/xontrib_1password-0.3.2-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "dfee6308a9474c0f391ce2b2f1c22c9b0c4bb9f10e80a11ad6b9c54177ebc93a",
                "md5": "e8892acb2e983b3b941c207f6c0befa3",
                "sha256": "fc171689c014a946a0a5bee10bd7fbb16882b256c120c111f83e9f2fd6aed9f7"
            },
            "downloads": -1,
            "filename": "xontrib_1password-0.3.2.tar.gz",
            "has_sig": false,
            "md5_digest": "e8892acb2e983b3b941c207f6c0befa3",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 4687,
            "upload_time": "2025-07-20T19:34:33",
            "upload_time_iso_8601": "2025-07-20T19:34:33.590317Z",
            "url": "https://files.pythonhosted.org/packages/df/ee/6308a9474c0f391ce2b2f1c22c9b0c4bb9f10e80a11ad6b9c54177ebc93a/xontrib_1password-0.3.2.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-07-20 19:34:33",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "drmikecrowe",
    "github_project": "xontrib-1password",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "xontrib-1password"
}
        
Elapsed time: 1.33888s