Setup
Install
:::tabs
@tab npm
@tab cargo
@tab npx
:::
Verify the install:
Zero-config start
No AWS account, no config file, no setup step required. The first dotsec set auto-creates everything:
This creates:
.sec— your encrypted secrets file (commit this).sec.key— your age private key (never commit this)
Make sure .sec.key is in your .gitignore — dotsec warns on set/init if no .gitignore rule excludes it.
Team sharing
Share the .sec.key file with teammates over a secure channel (1Password, Bitwarden, Signal, etc.). Each person puts it alongside their .sec file.
For CI/CD, set the key as an environment variable:
dotsec checks DOTSEC_PRIVATE_KEY before looking for a key file, so this works in any CI system without needing to write files.
Key discovery order:
DOTSEC_PRIVATE_KEYenvironment variable<sec-file>.keyfile in the same directory
AWS KMS setup
For teams that need IAM-controlled access and CloudTrail audit logs:
-
Create a KMS key in AWS (symmetric, AES-256):
-
Initialize dotsec with AWS as the provider:
-
AWS credentials are picked up automatically from
~/.aws/credentials,AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY, or an instance role.
See the encryption guide for more on how KMS envelope encryption works.
Multiple environments
Each environment gets its own .sec file with its own keypair:
Share directives (types, constraints) across environments using a schema file:
See the directives guide for details.