Setup
Install
Installs the dotsec binary on $PATH. Same shape with pnpm add -g dotsec and yarn global add dotsec.
Distribution is npm-only. The obvious crate names on crates.io (
dotsec,crypto,dotenv,aws) are owned by unrelated projects, socargo installisn't available. The npm package ships a native per-platform binary.
Verify the install:
Release channels
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)
.sec.key is auto-.gitignored
The first time dotsec set or dotsec init generates a keypair, it makes sure .sec.key is excluded from git. The exact action depends on what it finds in the directory:
The pattern is *.key (not just .sec.key) because once you start using multiple environments — prod.sec.key, staging.sec.key, local.sec.key — a narrower rule would silently leak the ones it doesn't match.
If anything fails (read-only filesystem, permission issues), dotsec logs a warning and keeps going — committing the key file is ultimately your call.
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. With KMS there is no local key file — all the key material lives in AWS's HSM. See On-disk surface area for the threat-model implications.
-
Create a symmetric KMS key and give it an alias:
-
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. -
Verify the round-trip:
Principals that only need to read secrets (CI, runtime roles) need just kms:Decrypt, and you can scope it to dotsec specifically via the encryption context:
Writing secrets (dotsec set, rotate-key) additionally needs kms:GenerateDataKey.
Next steps
- Push to SSM / Secrets Manager for runtime services that read from AWS directly — see
@pushdirectives anddotsec push. - Wire CI without long-lived AWS credentials — see CI/CD → GitHub Actions + KMS + OIDC.
- Read the mechanics — see 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.