Skip to content

Commit

Permalink
docs: reference templates in top-level passwd mgmt
Browse files Browse the repository at this point in the history
It's important for people to understand that the password manager
feature is an extension/implementation of the existing templating
capabilities of Chezmoi.
  • Loading branch information
jondkinney committed Dec 27, 2024
1 parent 562177a commit 7b8fce8
Showing 1 changed file with 28 additions and 5 deletions.
33 changes: 28 additions & 5 deletions assets/chezmoi.io/docs/user-guide/password-managers/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,29 @@
# Password manager integration
# Password Manager Integration

Template functions allow you to retrieve secrets from many popular password
managers. Using a password manager allows you to keep all your secrets in one
place, make your dotfiles repo public, and synchronize changes to secrets
across multiple machines.
Using a password manager with Chezmoi enables you to maintain a public
dotfiles repository while keeping your secrets secure. Chezmoi extends its
existing [templating capabilities](../templating.md) by providing password
manager specific _template functions_ for many popular password managers.

When Chezmoi applies a template with a secret referenced from a password
manager, it will automatically fetch the secret value and insert it into the
generated destination file.

## Example: Template with Password Manager Integration

Here's a practical example of a `.zshrc.tmpl` file that retrieves an OpenAI API
key from 1Password while maintaining other standard shell configurations:

```zsh
# set up $PATH
#

# OpenAI API Key retrieved from 1Password
export OPENAI_API_KEY='{{ onepasswordRead "op://Personal/openai-api-key/password" }}'

# set up aliases and useful functions
```

In this example, the `OPENAI_API_KEY` is retrieved from a 1Password vault
named `Personal`, specifically from an item called `openai-api-key` in the
`password` field.

0 comments on commit 7b8fce8

Please sign in to comment.