🔑 secret cli
  • Rust 92%
  • Nix 7.9%
  • Shell 0.1%
Find a file
2026-06-12 15:56:06 +00:00
.moira feat: add OCI container build and moira CI pipeline 2026-06-05 11:08:53 +02:00
crates fix: resolve sops default age key path on Linux 2026-06-10 06:39:35 +02:00
deploy/kubernetes feat: add OCI container build and moira CI pipeline 2026-06-05 11:08:53 +02:00
docs feat: make sops the default store and improve kbxref ergonomics 2026-06-05 13:39:53 +02:00
examples/generators fix(generators): chmod 600 ssh-ca/ca before signing 2026-06-05 10:10:25 +02:00
nix feat(nix): add vars NixOS module for auto-wiring per-machine sops secrets 2026-06-05 14:09:05 +02:00
scripts chore: add cocogitto config for auto-versioning and changelog 2026-06-05 14:41:05 +02:00
.gitignore feat(nix): add flake with devshell, package, app, and secret helpers 2026-06-02 20:01:24 +02:00
AGENTS.md feat: make sops the default store and improve kbxref ergonomics 2026-06-05 13:39:53 +02:00
Cargo.lock chore(deps): update rust crate ureq to v3 2026-06-12 04:04:35 +00:00
Cargo.toml Merge pull request 'chore(deps): update rust crate sha2 to 0.11.0' (#8) from renovate/sha2-0.x into main 2026-06-12 15:56:06 +00:00
CHANGELOG.md chore(version): v0.1.0 2026-06-05 14:42:04 +02:00
CLAUDE.md feat: add AGENTS.md with workspace layout, commands, constraints; symlink as CLAUDE.md for Claude 2026-06-05 08:20:19 +02:00
cog.toml chore: add cocogitto config for auto-versioning and changelog 2026-06-05 14:41:05 +02:00
flake.lock feat(nix): add flake with devshell, package, app, and secret helpers 2026-06-02 20:01:24 +02:00
flake.nix chore: add cocogitto config for auto-versioning and changelog 2026-06-05 14:41:05 +02:00
README.md feat: make sops the default store and improve kbxref ergonomics 2026-06-05 13:39:53 +02:00
renovate.json Add renovate.json 2026-06-08 04:39:37 +00:00

keybox (kbx)

A secrets, keys, and vars management CLI. Wraps age and sops with a clean
workflow for local encryption, declarative generators, and a central key registry.

Inspired by clan.lol vars — the var directory layout is
intentionally compatible with clan's vars/ structure.


Concepts

Concept Description
Key A named age public key (age1...). Logical names (e.g. alice, server-prod) map to pubkeys in config.toml.
Rule Maps a file-path regex to a set of named keys. Determines which keys can decrypt which files.
Var A generated value — either plaintext (public) or encrypted (secret; sops or age per its rule's store). Stored in .keybox/vars/.
Generator A shell script that produces vars from interactive prompts. Defined in .keybox/generators/*.toml.
Store Encryption backend: sops (default) or age. sops is required for NixOS/sops-nix integration.

Data Model

your-project/
├── .keybox/
│   ├── config.toml          ← keys and rules
│   ├── vars/                ← generated values (clan vars layout)
│   │   ├── per-machine/
│   │   │   └── <machine>/
│   │   │       └── <generator>/
│   │   │           └── <file>/
│   │   │               ├── value        ← plaintext (public var)
│   │   │               └── secret       ← encrypted (secret var)
│   │   ├── per-user/
│   │   │   └── <user>/
│   │   │       └── <generator>/
│   │   │           └── <file>/{value,secret}
│   │   └── shared/
│   │       └── <generator>/
│   │           └── <file>/{value,secret}
│   └── generators/
│       └── <name>.toml      ← generator definitions
└── secrets/                 ← sops-encrypted files (managed by rules)

Setup

# Install (from source)
cargo install --path .

# Or via nix (flake)
nix run github:youruser/keybox

# Initialize in your project
cd your-project
kbx init

This creates:

.keybox/
  config.toml      (version = 1, empty keys/rules)
  vars/
  generators/

Add .keybox/vars/**/secret to .gitignore if you don't want to commit
encrypted secrets. Public vars (the value files) are safe to commit.


Docs

Topic
CLI Reference All commands — init, migrate, status/check, key, rule, var, gen, edit/encrypt/decrypt, ref, login/push/secret, otp, seal/unseal
Generators Generator format, sandbox, runtime_inputs, dependencies, examples
Generator Examples PKI chain, SSH CA, WireGuard, database credentials, backup keys (with NixOS snippets)
Security & Secret Management Threat model, what's safe to commit, key custody, rotation/revocation runbook, recovery
Use Cases Managing sops secrets, password hashes, LUKS keys, sops-nix, OTP sharing
Server kbx-server setup, NixOS module, API endpoints, auth
Clan Vars Compatibility Layout compatibility, differences, .sops.yaml generation, migration