Here’s how to test 1Password integration with your dotfiles:
Your session timed out. Re-authenticate with:
eval $(op signin)
op item create \
--category "API Credential" \
--title "GitHub Token" \
--vault Personal \
'token[password]=ghp_YOUR_ACTUAL_GITHUB_TOKEN_HERE' # allow-secret
To get a real GitHub token:
repo, read:orgghp_)Edit your .gitconfig template:
chezmoi edit ~/.gitconfig
Find these lines:
# GitHub token from 1Password
# Requires: 1Password item titled "GitHub Token" with field "token"
#
# To enable, add template syntax like this (remove spaces in brackets):
# { {- if (onepasswordItemFields "GitHub Token") } }
# [github]
# user = { { .name } }
# token = { { (onepasswordItemFields "GitHub Token").token.value } } # allow-secret
# { {- end } }
Replace them with (remove # and fix brackets):
# GitHub token from 1Password
[github]
user =
token = # allow-secret
# Preview what will be generated
chezmoi cat ~/.gitconfig | grep -A 3 "^\[github\]"
# If it looks good, apply
chezmoi apply
# Verify it worked
cat ~/.gitconfig | grep -A 3 "^\[github\]"
You should see:
[github]
user = 4444jPPP
token = ghp_YOUR_ACTUAL_TOKEN_HERE # allow-secret
Create AWS credentials item:
op item create \
--category "API Credential" \
--title "AWS Personal" \
--vault Personal \
'access_key_id=AKIAIOSFODNN7EXAMPLE' \ # allow-secret
'secret_access_key[password]=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY' # allow-secret
Then edit and uncomment the AWS credentials template:
chezmoi edit ~/.aws/credentials
Your 1Password CLI session expired. Re-authenticate:
eval $(op signin)
op item get "GitHub Token"
op item get "GitHub Token" --format json | jq '.fields'
echo '' | chezmoi execute-template
Add ` # allow-secret` at the end of the line in your template.
chezmoi applychezmoi apply, doneOnce you verify it works: