Back to Chezmoi

`onepasswordRead` *url* [*account*]

assets/chezmoi.io/docs/reference/templates/1password-functions/onepasswordRead.md

2.70.2851 B
Original Source

onepasswordRead url [account]

onepasswordRead returns data from 1Password using the 1Password CLI (op). url is passed to the op read --no-newline command. If account is specified, the extra arguments --account $ACCOUNT are passed to op.

If there is no valid session in the environment, by default you will be interactively prompted to sign in.

!!! example

The result of

```
{{ onepasswordRead "op://vault/item/field" }}
```

is equivalent to calling

```console
$ op read --no-newline op://vault/item/field
```

!!! warning

When using [1Password secrets automation][automation], the *account*
parameter is not allowed.