Skip to content

Commit

Permalink
Updating readme
Browse files Browse the repository at this point in the history
  • Loading branch information
drmikecrowe committed Jan 19, 2025
1 parent 4f55428 commit 87e9064
Showing 1 changed file with 22 additions and 0 deletions.
22 changes: 22 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,28 @@
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>

## Introduction

This xontrib adds support for 1Password secrets to the xonsh shell. It works by allowing you to securely store and access your passwords in 1Password. To use:

1. Store your passwords in 1Password.
2. In your xonsh environment, reference the passwords using the OnePass function:
```xsh
$OPENAI_API_KEY = OnePass("op://Private/OpenAI-API-Key/api-key")
```
3. To expose the variables in your environment, set:
```xsh
$ONEPASS_ENABLED = 1
```

This approach ensures your sensitive information remains secure while being easily accessible in your xonsh shell. The URL is basically: `op://<Vault>/<title>/<field>`. To find this, here's the commands I used to determine these fields:

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

## Installation

Expand Down

0 comments on commit 87e9064

Please sign in to comment.