A modern git based age-encrypted secrets manager for teams.
Project description
cottage
Cottage is a gitops tool for teams to manage age-encrypted secrets in git repositories.
It provides a simple workflow to encrypt/decrypt secrets, manage recipients, and keep secrets out of the repo while still allowing for easy sharing via VCS. Cottage also generates redacted previews of encrypted secrets for better visibility and supports both persistent and temporary decryption workflows, while ensuring secrets are never committed in plaintext.
Table of contents
Features
- Exposure safe: Uses Rust's type system to make sure bugs can never accidentally expose secrets.
- Team-friendly: Share public keys (recipients) in the repo, keep private keys (identities) local.
- Manages .gitignore: Automatically updates
.gitignoreto keep unencrypted secrets out of the repo. - Previews: Generates timestamped redacted previews of encrypted secrets for better visibility.
- Rich diffs: Keeps git diff clean & reviewable, while
ctg diffshows diff of locally modified secrets with tracked encrypted counterparts. - Checksum verification: Prevents tampering by verifying that encrypted secrets and recipient lists match the metadata on both encryption and decryption.
- Persistent secrets workflow:
ctg decrypt/edit/synckeeps decrypted secrets on disk. - Temporary secrets workflow:
ctg run(shortcutctgx) decrypts secrets temporarily to run a command, then deletes them regardless of the command's success or failure. - Clean up:
ctg cleandeletes all decrypted secrets from local repo to let you run your AI agents with a tiny bit less worry. - Supports jj and non-git directories:
ctg initturns any directory into a secret store.
Installation
# rust cargo-binstall
cargo binstall --locked cottage
# rust cargo
cargo install --locked cottage
# python pip
pip install cottage
# python uv
uv pip install cottage
Or download the latest release from GitHub.
Quick Start
Init project:
mkdir project && cd project
git init # Optional, cottage works better with git but it's not required
ctg init # Sets up the .cottage directory and necessary files
tree -a
# .
# ├── .cottage/ <- Auto-generated by `ctg init`
# │ ├── identity <- Your private key, keep it safe. Move it to `~/.config/cottage/identity` to use it globally, or replace it with a soft link to one of your existing private keys.
# │ └── recipients/ <- This is where your team keeps the public keys of all the recipients.
# │ └── sayanarijit <- Your public key. Commit it. To use an existing public key, just copy (don't softlink) that key here.
# ├── .git/...
# ├── .gitattributes <- Added `*.cott.age binary export-ignore filter=cottage-encrypted -diff` to avoid polluting git diff
# └── .gitignore <- Added `/.cottage/identity` for obvious reasons
Create or edit a secret.
ctg edit secret.yml --clean # Opens secret.yml in $EDITOR
ctg encrypt secret.yml --clean # Another way to encrypt secrets
# encrypt secret.yml
# into secret.yml.cott.age
# edit secret.yml.cott.toml
# edit .gitignore
# delete secret.yml
Run a command with temporary decrypted secrets:
cat secret.yml
# cat: secret.yml: No such file or directory
ctg run kubectl apply -f secret.yml # decrypts secret.yml.cott.age to secret.yml and runs the command
ctg run kubectl apply -f secret.yml.cott.age # also replaces the path argument with the decrypted file path
ctg run kubectl apply -f . # decrypts all .cott.age files in . and runs the command
ctg run ./deploy.sh # decrypts all .cott.age files in repo and runs the command
cat secret.yml
# cat: secret.yml: No such file or directory
Or use the shortcut:
ctgx ./deploy.sh # same as ctg run -- ./deploy.sh
Sharing with a team member
To share your secrets, just push to the git repo.
git add .
git commit -m "Add secret.yml"
git push origin main
Ask your teammates to add their public keys to .cottage/recipients and push the
changes. Then you can pull and re-encrypt the secrets for them.
git pull origin main
ctg sync # or `ctg decrypt && ctg encrypt`
# encrypt secret.yml
# into secret.yml.cott.age
# edit secret.yml.cott.toml
ctg clean # optional
# delete secret.yml
# review changes, commit and push
git add .
git commit -m "Add new recipient to secrets"
git push origin main
Now your teammates can pull the latest changes and decrypt secrets for themselves.
Git Hooks
You can use prek or pre-commit to set up git hooks to automatically check/encrypt secrets before commit and decrypt them after checkout.
See the example prek configuration here.
Learn More
See examples directory for more usage examples.
Alternatives
- agebox: Very similar in core philosophy but lacking many features.
- git-crypt: Uses PGP (requires an agent), complex, 100% tied to Git.
- SOPS: Lots of features and very complex for simple use cases.
Troubleshooting
# See debug logs with -v, -vv or -vvv
ctg run -vvv -- ./deploy.sh
License
MIT OR Apache-2.0
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cottage-0.2.3.tar.gz.
File metadata
- Download URL: cottage-0.2.3.tar.gz
- Upload date:
- Size: 4.1 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f65c06ecd1ecc055802983ab586f2ebda5a7cab59708de1995be03d50ad81370
|
|
| MD5 |
ec1c6b8e8179af9745a0e4dcf9d44ebe
|
|
| BLAKE2b-256 |
c1d4425a45ec025f0430eeca5d8b1c836788ff6db9c4b7523d807ce75f14cf92
|
File details
Details for the file cottage-0.2.3-py3-none-win_arm64.whl.
File metadata
- Download URL: cottage-0.2.3-py3-none-win_arm64.whl
- Upload date:
- Size: 2.7 MB
- Tags: Python 3, Windows ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2a0f1dbd61be8b6be15a078982cf9f12c7728e96f2df16e9ecfb0ae9de0f4b96
|
|
| MD5 |
a44567d8c7d13f264ea34b89decd2bc7
|
|
| BLAKE2b-256 |
3f7f7fd749e4a43d44002a8294f1c370548189e7bd14464ce1c27fc0e05dd07d
|
File details
Details for the file cottage-0.2.3-py3-none-win_amd64.whl.
File metadata
- Download URL: cottage-0.2.3-py3-none-win_amd64.whl
- Upload date:
- Size: 2.9 MB
- Tags: Python 3, Windows x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a1c53d9162a1809bab9e4dde0b23ca39d73c7a81bdd34ac8fe83c2d7c7ac5844
|
|
| MD5 |
ad70e6536e2533aa7e6b959d1db12ee3
|
|
| BLAKE2b-256 |
fde8866c2ed524e61c534b7419b4dfebcc83caf923423942a3f644f11f334df5
|
File details
Details for the file cottage-0.2.3-py3-none-win32.whl.
File metadata
- Download URL: cottage-0.2.3-py3-none-win32.whl
- Upload date:
- Size: 2.9 MB
- Tags: Python 3, Windows x86
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
48d5b1a952ca34c1bcf8e690b6f224cb3c31980c2840e93416af54c84c6c95a3
|
|
| MD5 |
f6d5c4c8c13713eab71fefb054ba4220
|
|
| BLAKE2b-256 |
8dc6c8d03d2deda8a438ac26782daf3cb747157d4b252064f9190ced896c61e1
|
File details
Details for the file cottage-0.2.3-py3-none-musllinux_1_2_x86_64.whl.
File metadata
- Download URL: cottage-0.2.3-py3-none-musllinux_1_2_x86_64.whl
- Upload date:
- Size: 3.3 MB
- Tags: Python 3, musllinux: musl 1.2+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c22b1f92559973d26fbee936f9009a37891ebc72b100332648c2753ce21cb083
|
|
| MD5 |
483ad091f2da51e2c1460b20df81c029
|
|
| BLAKE2b-256 |
82312a3bc2150e7202d925dc4e7b742bafff975d8b56138130759a3567458e55
|
File details
Details for the file cottage-0.2.3-py3-none-musllinux_1_2_i686.whl.
File metadata
- Download URL: cottage-0.2.3-py3-none-musllinux_1_2_i686.whl
- Upload date:
- Size: 3.3 MB
- Tags: Python 3, musllinux: musl 1.2+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5ba64373a2e0c56ea9b7216510a0790d51444bdbfe0b86ec7a9c195f68daa9e0
|
|
| MD5 |
20982d0c6eb7b250da47c63335a55329
|
|
| BLAKE2b-256 |
75e58e000c36d6a27c26edd6d756005431873eb98d72170a614219722c78fab2
|
File details
Details for the file cottage-0.2.3-py3-none-musllinux_1_2_armv7l.whl.
File metadata
- Download URL: cottage-0.2.3-py3-none-musllinux_1_2_armv7l.whl
- Upload date:
- Size: 3.1 MB
- Tags: Python 3, musllinux: musl 1.2+ ARMv7l
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5a02f3bc51c440593a899aa712da9fc254232d868c76df0b1395edcd55b1e15
|
|
| MD5 |
e5a6981ad87b385837677f9e49170814
|
|
| BLAKE2b-256 |
8205f8568eebeca7e7c28bd5fa9247ac2f3d67a4f6ac9826f330f223d94312dc
|
File details
Details for the file cottage-0.2.3-py3-none-musllinux_1_2_aarch64.whl.
File metadata
- Download URL: cottage-0.2.3-py3-none-musllinux_1_2_aarch64.whl
- Upload date:
- Size: 3.0 MB
- Tags: Python 3, musllinux: musl 1.2+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7705b65dc82623afe45a801a42ebffbe562bd309f6e466df36e06af542ac383b
|
|
| MD5 |
21ad6fb4fd5fc92552a833fa8aa3764b
|
|
| BLAKE2b-256 |
b7e042f32da51b788022f6bfe319c72f10886015806189759b290dc9abdeab13
|
File details
Details for the file cottage-0.2.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: cottage-0.2.3-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 3.2 MB
- Tags: Python 3, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
72d2e50f00d2fee879d23e9bdd3b9e943ec6161c32fa2beb4d6af590070b3fa7
|
|
| MD5 |
aea80275da99e30c7bd7ff0e42872955
|
|
| BLAKE2b-256 |
2c8e0fb0792ef5d6ecd58dcb4d5f49bb9e59074d7b1f0418765b9738f2c1c45a
|
File details
Details for the file cottage-0.2.3-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl.
File metadata
- Download URL: cottage-0.2.3-py3-none-manylinux_2_17_s390x.manylinux2014_s390x.whl
- Upload date:
- Size: 3.4 MB
- Tags: Python 3, manylinux: glibc 2.17+ s390x
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c778349b839acc3dc64b6e6b09fd9fd80f921fcb8b4e832d915a26f14430f8b3
|
|
| MD5 |
6eef28600fb6f6d4dceccdccba36d9ad
|
|
| BLAKE2b-256 |
0f9615bbf8c107d1d761bd51fa0bdb7e8c38735dd872d2759c4fd3ec5b0e918c
|
File details
Details for the file cottage-0.2.3-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl.
File metadata
- Download URL: cottage-0.2.3-py3-none-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl
- Upload date:
- Size: 3.4 MB
- Tags: Python 3, manylinux: glibc 2.17+ ppc64le
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7e7939bb9e0756674451af435fd3d10b040fd20441b5fd472a4a2b3d3080ddae
|
|
| MD5 |
1859a55bd85b54de5d062d2e7860933b
|
|
| BLAKE2b-256 |
a2d426ef2c9ee519e608fd11f7af8c4a800e79e87458fdad4cc5d59d96c5bf30
|
File details
Details for the file cottage-0.2.3-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl.
File metadata
- Download URL: cottage-0.2.3-py3-none-manylinux_2_17_i686.manylinux2014_i686.whl
- Upload date:
- Size: 3.3 MB
- Tags: Python 3, manylinux: glibc 2.17+ i686
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e4804372dc7fe324c3f6ac3e1c3ac879454e60d996a5b22cb9c9f8a0bebcf25
|
|
| MD5 |
7c8c18144378f7126c6b08995b57e0e6
|
|
| BLAKE2b-256 |
4ace054724abc427470b45a4098a5573e427d9e4ef482c7c69e959e785ccaa44
|
File details
Details for the file cottage-0.2.3-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl.
File metadata
- Download URL: cottage-0.2.3-py3-none-manylinux_2_17_armv7l.manylinux2014_armv7l.whl
- Upload date:
- Size: 3.1 MB
- Tags: Python 3, manylinux: glibc 2.17+ ARMv7l
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e3ef7da153860444c674f2c186f96fdebed09e12277e19bfbec304d78f61ab33
|
|
| MD5 |
c1f726461feaddbc31e0e648623199c8
|
|
| BLAKE2b-256 |
e3626bef7117c417d258c344b94fd24d8886fbcd6a143262c3a8be110f3b6839
|
File details
Details for the file cottage-0.2.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: cottage-0.2.3-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 2.9 MB
- Tags: Python 3, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
853867e5e9481c922f92693d08846ad691995fd3767ebaaa38481379ea349956
|
|
| MD5 |
6b3e0baf9f875017a5de0837e041186d
|
|
| BLAKE2b-256 |
ee4cae8aa0ccb0a8049cf4f2cb7dc5292be8549612cefeaef504325aa7a8fb17
|
File details
Details for the file cottage-0.2.3-py3-none-macosx_11_0_arm64.whl.
File metadata
- Download URL: cottage-0.2.3-py3-none-macosx_11_0_arm64.whl
- Upload date:
- Size: 2.8 MB
- Tags: Python 3, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ded642cd649be82a45bb1891ceec5e8ed536e1151ff80058325e88b6fc342f80
|
|
| MD5 |
60d9b566b2d1a990d4524a34272c5184
|
|
| BLAKE2b-256 |
a552777f2f160e75884542828d8f42fe25f9c2dd2909ac60e887dfa4238b74bd
|
File details
Details for the file cottage-0.2.3-py3-none-macosx_10_12_x86_64.whl.
File metadata
- Download URL: cottage-0.2.3-py3-none-macosx_10_12_x86_64.whl
- Upload date:
- Size: 3.0 MB
- Tags: Python 3, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.11.8 {"installer":{"name":"uv","version":"0.11.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
09c78c6a74f850f4224ea1756de908fb144f21252325796d3b76184266ee4c37
|
|
| MD5 |
f2ca012300cbf7b8c50c7c84a60ad7bb
|
|
| BLAKE2b-256 |
369b0a4789831a03003e217815ce635fbf67af2696998b6361350fb808b47e7c
|