Deneblab.StashLock.Cli
0.3.108
dotnet tool install --global Deneblab.StashLock.Cli --version 0.3.108
dotnet new tool-manifest
dotnet tool install --local Deneblab.StashLock.Cli --version 0.3.108
#tool dotnet:?package=Deneblab.StashLock.Cli&version=0.3.108
nuke :add-package Deneblab.StashLock.Cli --version 0.3.108
Deneblab.StashLock.Cli
Command-line interface for StashLock secrets management vault. Uses X25519 ECIES (Elliptic Curve Integrated Encryption Scheme) with AES-256-GCM for keypair-based secrets encryption.
Installation
dotnet tool install -g Deneblab.StashLock.Cli
Usage
1. Initialize a vault directory
stashlock init ./my-vault -tags production,develop
Creates a stashlock.config.json with the specified environment tags and auto-generates key files for each tag.
2. Generate key pairs
stashlock keygen ./my-vault
Generates X25519 key pairs (stashlock.key.{tag}.json) for each tag defined in the config. Skips existing key files.
3. Encrypt secrets
stashlock encode ./my-vault/secrets.json
Reads a plaintext JSON secrets file, encrypts it with each tag's public key using sealed box encryption, and outputs encrypted files (stashlock.enc.{tag}.secrets.json).
Two encryption modes are supported:
- SOPS mode (default) — field-level encryption with MAC verification
- Whole-file mode — encrypts entire JSON as a single blob
4. Decrypt secrets
stashlock decode ./my-vault/stashlock.enc.production.secrets.json
Decrypts an encrypted stashlock.enc.*.json file back to plaintext JSON. Auto-detects encryption mode and key file.
Options:
-key <path>— Specify key file path (auto-detected if omitted)-output <path>— Write to file instead of stdout
5. Publish to vault server
stashlock publish ./my-vault/stashlock.enc.production.secrets.json
Uploads encrypted stashlock.enc.*.json files to the StashLock vault API. Extracts the vault key from the file metadata and POSTs the content to the server.
Accepts a single file or a directory (publishes all stashlock.enc.*.json files found).
# Publish all encrypted files in a directory
stashlock publish ./my-vault
# Publish with explicit API URL and key
stashlock publish ./my-vault --url https://my-vault.example.com/api --api-key my-secret-key
# Publish with TTL (auto-expires after 3600 seconds)
stashlock publish ./my-vault/stashlock.enc.production.secrets.json --expires-in 3600
Options:
--url <url>— API base URL (falls back toSTASHLOCK_API_URLenv var, then default)--api-key <key>— API authentication key (falls back toSTASHLOCK_API_KEYenv var)--expires-in <seconds>— TTL in seconds for the published secret
Commands
| Command | Description |
|---|---|
stashlock init <dir> [-tags <tags>] |
Initialize a vault directory with config and tags |
stashlock keygen <dir> |
Generate X25519 key pairs for each configured tag |
stashlock encode <file> |
Encrypt a secrets file for all configured tags |
stashlock decode <file> [-key <path>] [-output <path>] |
Decrypt a secrets file |
stashlock publish <path> [--url <url>] [--api-key <key>] [--expires-in <sec>] |
Publish encrypted files to vault server |
Workflow
init --> keygen --> encode --> publish --> decode
| | | | |
v v v v v
config keypairs encrypted uploaded plaintext
file files files to server output
Encryption Details
- Key Agreement: X25519 ECIES (Elliptic Curve Integrated Encryption Scheme)
- Key Derivation: HKDF-SHA256
- Symmetric Encryption: AES-256-GCM
- Key Size: 32 bytes (X25519 public/private keys)
- Nonce: 12 bytes (random per encryption)
- Auth Tag: 16 bytes
- Output format: ephemeral public key (32B) || nonce (12B) || ciphertext || tag (16B)
Environment Variables
| Variable | Purpose |
|---|---|
STASHLOCK_VAULT_KEY |
Vault key string |
STASHLOCK_API_URL |
Vault API base URL |
STASHLOCK_API_KEY |
API authentication key |
Links
License
MIT
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
This package has no dependencies.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.3.108 | 0 | 3/11/2026 |
| 0.3.107 | 0 | 3/11/2026 |
| 0.3.106 | 0 | 3/11/2026 |
| 0.3.105 | 0 | 3/11/2026 |
| 0.3.103 | 0 | 3/11/2026 |
| 0.3.102 | 0 | 3/11/2026 |
| 0.3.100 | 0 | 3/11/2026 |
| 0.3.99 | 0 | 3/11/2026 |
| 0.3.98 | 0 | 3/11/2026 |
| 0.3.97 | 0 | 3/11/2026 |
| 0.2.96 | 0 | 3/11/2026 |
| 0.2.94 | 5 | 3/11/2026 |
| 0.2.93 | 24 | 3/11/2026 |
| 0.2.92 | 52 | 3/11/2026 |
| 0.2.91 | 53 | 3/11/2026 |
| 0.2.90 | 47 | 3/11/2026 |
| 0.2.89 | 52 | 3/11/2026 |
| 0.2.88 | 49 | 3/10/2026 |
| 0.2.87 | 47 | 3/10/2026 |
| 0.2.86 | 50 | 3/10/2026 |