> For the complete documentation index, see [llms.txt](https://til.yulrizka.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://til.yulrizka.com/unix/fish-environment-variables-from-1password.md).

# fish environment variables from 1password

A common task is to load environment variables from secret. With password manager like 1password, you can store it as notes and use the CLI to load it to your shell env

Install 1password CLI <https://1password.com/downloads/command-line/>

create a secure notes with content like (eg: with the name "db-dev")

```
DB_USER=USER1
DB_PASSWORD=PASSWORD
```

login 1password

```
eval (op signin my)
```

load the note

```bash
export (op get item "db-dev" | jq -r .details.notesPlain)
```
