-
Notifications
You must be signed in to change notification settings - Fork 501
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: reference templates in top-level passwd mgmt
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
1 parent
562177a
commit 7b8fce8
Showing
1 changed file
with
28 additions
and
5 deletions.
There are no files selected for viewing
33 changes: 28 additions & 5 deletions
33
assets/chezmoi.io/docs/user-guide/password-managers/index.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |