env-gpgrc

Registers secret files in .gpgrc and .gitignore for GPG-encrypted git workflows.

Updated Jun 21, 2025
One-click install
npx skills add https://github.com/seriiserii825/dotfiles --skill env-gpgrc-seriiserii825
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: env-gpgrc
Source: https://github.com/seriiserii825/dotfiles/tree/main/apps/claude/skills/env-gpgrc
Command: npx skills add https://github.com/seriiserii825/dotfiles --skill env-gpgrc-seriiserii825

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve? Secret files like .env or custom *-env.sh credentials files risk either leaking into git as plaintext or never being encrypted at all. This Skill ensures every new credentials file in a repository using the .gpgrc/GPG workflow is properly registered in both .gpgrc (with a .gpg suffix) and .gitignore (plaintext path), so encryption scripts like bash-git/encrypt.sh can find and protect it. ## Core Features & Use Cases - Automatic .gpgrc registration: Appends the repo-relative path with a .gpg suffix to .gpgrc, creating the file if it does not exist yet. - .gitignore protection: Adds the plaintext path to .gitignore so unencrypted secrets never get committed. - Duplicate-safe edits: Uses grep -qxF checks before appending, never rewriting existing entries in either file. - Use Case: You create a new bash-scripts/set-smtp-to-wp-config-env.sh credentials file. The Skill adds bash-scripts/set-smtp-to-wp-config-env.sh.gpg to .gpgrc and the plaintext path to .gitignore, so the next git-push encrypts it automatically. ## Quick Start Register the newly created .env file in this repo's .gpgrc and .gitignore so it gets encrypted on the next push.

Frequently Asked Questions about env-gpgrc

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I register a new .env file for GPG encryption in git?

Add the repo-relative path with a .gpg suffix (e.g., .env.gpg) to the .gpgrc file at the repo root, and add the plaintext path (.env) to .gitignore. The encrypt.sh script then encrypts it automatically during git push or pull.

What is the .gpgrc file format for encrypting secrets in git?

Each line of .gpgrc is a repository-root-relative path to a .gpg file, such as apps/api/.env.gpg. The encryption script strips the .gpg suffix to locate the plaintext file, so paths must not have a leading ./ prefix.

Does this workflow encrypt the secret file automatically?

No, registration in .gpgrc and .gitignore only marks the file for encryption. Actual encryption is done separately via gpg.sh --env --encrypt or manually with gpg -e -r $USER <file>, typically triggered by git-push.sh.

Can I use .gpgrc for custom credentials files besides .env?

Yes, any file containing secrets works, including custom *-env.sh files like set-smtp-to-wp-config-env.sh. Register them the same way: path plus .gpg suffix in .gpgrc, plaintext path in .gitignore.

Why did my secret file leak into git as plaintext?

This happens when the plaintext path was never added to .gitignore, so git tracks the unencrypted file. Always register the plaintext path in .gitignore at the same time you add the .gpg entry to .gpgrc.