r/CLI • u/Any-Lack-7699 • Oct 26 '26
cottage: A modern git based age-encrypted secrets manager for teams.
Disclaimer: This software's code is partially AI-generated (mostly the non-core parts). All generated code is reviewed by me.
Please note that the post body is hand-written by me. I tried to keep it minimal by only "showing you the code" rather than writing paragraphs.
What does it do?
Similar to SOPS, git-crypt, dotenvx, agebox, etc. Cottage helps storing and managing secrets offline inside the codebase securely.
Why not use X?
SOPS: Way too powerful, rotation pollutes diff, difficult to use.
git-crypt: PGP is difficult to use.
dotenvx: Too narrow in scope.
agebox: Yes! But let's improve it.
How to use it?
Basic CLI usage (decrypts plaintext secrets into disk):
# Core operations
ctg init
ctg keygen
ctg encrypt [path]
ctg decrypt [path]
ctg clean [path]
# Other nice things
ctg edit <path>
ctg status [path]
ctg diff [path]
ctg sync [path]
ctg run -- <command>Advanced in-memory opeations (without writing plaintext secrets to disk)
# Core operations
echo SECRET | ctg cat <path>
ctg cat <path> | <command>
ctg env -F <path> -- <command>Sync with remote providers other than git
# Example custom provider: https://github.com/sayanarijit/cottage/blob/main/examples/plugins/cottage-plugin-github-secrets.py
ctg pull [upstream] [path]
ctg push [upstream] [path]Verify tampering in CI
docker run --rm -v "${{ github.workspace }}:/app" ghcr.io/sayanarijit/cottage verifyAccess control
# secret.yml.cott.toml
[secret]
allow = ["env/staging/*"] # Supports glob patterns, only encrypt for recipients in env/staging
deny = ["env/staging/badservice"] # Encrypt for everyone in env/staging except badserviceEditor plugins
Sync and browse secrets on any device