Age-based secrets management with transport-agnostic sharing. Encrypted secrets are stored as one file per key (vars/<env>/<KEY>.age) in git-backed remotes, with group-based recipient control and cross-remote search.
- Age-only encryption -- secrets are encrypted with age x25519 keys. No KMS, no GPG.
- One file per secret --
vars/<env>/<KEY>.agekeeps diffs simple and listing fast. - Group-based recipients -- organize keys into groups (team, admins, devices) with per-path policies.
- Cross-remote search --
himitsu searchfinds secrets across all your remotes. - Transport-agnostic sharing -- share secrets via GitHub PR inbox or Nostr (planned).
- Typed codegen -- generate TypeScript, Go, or Python config from your secrets (planned).
# Run directly
nix run github:darkmatter/himitsu -- <command>
# Add to devShell
{
inputs.himitsu.url = "github:darkmatter/himitsu";
# ...
devShells.default = pkgs.mkShell {
packages = [ himitsu.packages.${system}.default ];
};
}
# Or build from source
cargo build --release# 1. Initialize himitsu (creates ~/.himitsu/ with age keys and config)
himitsu init
# 2. Create a remote to store secrets
himitsu remote add myorg/secrets
# 3. Add yourself as a recipient
himitsu -r myorg/secrets recipient add laptop --self --group team
# 4. Add secrets
himitsu -r myorg/secrets set prod API_KEY "sk_live_xxx"
himitsu -r myorg/secrets set prod DB_PASSWORD "hunter2"
himitsu -r myorg/secrets set dev DB_PASSWORD "devpass"
# 5. Read secrets back
himitsu -r myorg/secrets get prod API_KEY
# 6. List environments and keys
himitsu -r myorg/secrets ls # lists: dev, prod
himitsu -r myorg/secrets ls prod # lists: API_KEY, DB_PASSWORD
# 7. Search across all remotes
himitsu search DB
# 8. Push changes
himitsu -r myorg/secrets remote push~/.himitsu/
config.yaml # User config (default remote, etc.)
keys/
age.txt # Your age private key
data/
<org>/<repo>/ # Remote clones
state/
index.db # Cross-remote search index
cache/
locks/
himitsu.yaml # Remote config (policies, identity sources)
data.json # Group/env metadata
vars/
common/
API_BASE_URL.age
dev/
DB_PASSWORD.age
prod/
DB_PASSWORD.age
recipients/
team/
alice.pub # age public key
bob.pub
admins/
root.pub
remote: myorg/secrets
codegen:
lang: typescript
path: src/generated/config.tsWhen .himitsu.yaml exists in a git repo, himitsu runs in project mode and uses the bound remote automatically (no -r flag needed).
Create ~/.himitsu/ with age keypair, config, and directory structure.
Encrypt and store a secret.
Decrypt and print a secret value.
List environments, or list keys within an environment.
Re-encrypt all secrets for the current recipient set. Run this after adding or removing recipients.
Search key names across all remotes. Use --refresh to rebuild the index first.
# Add yourself
himitsu -r myorg/secrets recipient add laptop --self --group team
# Add someone by age public key
himitsu -r myorg/secrets recipient add deploy-bot --age-key "age1..." --group admins
# Remove
himitsu -r myorg/secrets recipient rm deploy-bot --group admins
# List
himitsu -r myorg/secrets recipient lshimitsu -r myorg/secrets group add admins
himitsu -r myorg/secrets group ls
himitsu -r myorg/secrets group rm temp # 'common' is reservedhimitsu remote add myorg/secrets # Clone existing
himitsu remote add --github --org myorg --name secrets # Create + clone
himitsu -r myorg/secrets remote push
himitsu -r myorg/secrets remote pull
himitsu -r myorg/secrets remote statusRe-encrypt all secrets for the updated recipient set and sync to project destinations.
The flake provides the following outputs:
packages.defaultandpackages.himitsu- ThehimitsuCLI binary.packages.age-key-cmd- A wrapper script that outputs the localhimitsuage private key. Useful as aSOPS_AGE_KEY_CMD.lib.mkEncryptedSecrets- A Nix function to package a remote's encryptedvars/directory into a Nix derivation.lib.mkDecryptWrapper- A Nix function to create a wrapper script that decrypts packaged secrets using the providedageKeyCmd.
Example usage of lib functions:
{
inputs.himitsu.url = "github:darkmatter/himitsu";
outputs = { self, nixpkgs, himitsu, ... }: {
packages.x86_64-linux = {
# Package your production secrets
my-secrets = himitsu.lib.x86_64-linux.mkEncryptedSecrets {
name = "my-prod-secrets";
src = ./path/to/remote;
env = "prod";
};
# Create a decryption script
decrypt-my-secrets = himitsu.lib.x86_64-linux.mkDecryptWrapper {
name = "decrypt-prod-secrets";
secretsPkg = self.packages.x86_64-linux.my-secrets;
destDir = "/run/secrets/decrypted";
# Uses the local himitsu age-key-cmd by default
};
};
};
}| Flag | Description |
|---|---|
-r <org/repo> |
Target remote. Overrides project binding and default remote. |
-v |
Increase log verbosity (-v debug, -vv trace). |
# Enter dev shell
nix develop
# Build
cargo build
# Run tests
cargo test
# Lint
cargo clippy -- -D warnings
cargo fmt -- --checkMIT