Skip to content

secrets

Store API keys, tokens, and other credentials in an encrypted local vault. Values are encrypted at rest using a master key derived from your machine identity and are never displayed in full without --unmask.

Terminal window
snippbot secrets set <name> # Store a secret (prompt or stdin)
snippbot secrets get <name> # Show masked value
snippbot secrets list # List names only (never values)
snippbot secrets delete <name> # Remove a secret
snippbot secrets rotate <name> # Replace value, keep history
snippbot secrets export # Encrypted backup blob
snippbot secrets import <file> # Restore from backup
snippbot secrets audit # View access log

Store a secret encrypted at rest.

Terminal window
snippbot secrets set anthropic_api_key -v sk-ant-...
echo "sk-ant-..." | snippbot secrets set anthropic_api_key
snippbot secrets set github_token -v ghp-... -c tokens
OptionDescription
-v, --valueSecret value (prompted or read from stdin if omitted)
-c, --categoryCategory label (auto-detected for known keys like *_api_key)

Retrieve a secret. The value is masked by default.

Terminal window
snippbot secrets get anthropic_api_key # sk-a********XYZ
snippbot secrets get anthropic_api_key --unmask # Full value (use with care)
OptionDescription
--unmaskPrint the full value. Avoid in shared terminals.

List all stored secrets. The table shows names only — values are never exposed here.

Terminal window
snippbot secrets list
snippbot secrets list --category api_keys
snippbot secrets list --json-output
OptionDescription
-c, --categoryFilter by category
--json-outputEmit structured JSON (names, categories, timestamps)

Remove a secret permanently.

Terminal window
snippbot secrets delete old_api_key # Prompts for confirmation
snippbot secrets delete old_api_key --yes # Skip confirmation
OptionDescription
-y, --yesSkip confirmation prompt

Replace a secret’s value while preserving its name/category. Useful for key rotation.

Terminal window
snippbot secrets rotate anthropic_api_key -v sk-ant-new...
echo "new-value" | snippbot secrets rotate anthropic_api_key

Export and restore encrypted backups. Exported blobs are useless without the master key.

Terminal window
snippbot secrets export # Print encrypted JSON to stdout
snippbot secrets export -o backup.json # Write to file
snippbot secrets import backup.json
snippbot secrets import backup.json --overwrite # Replace existing entries

View the access log. Entries record reads, writes, rotations, and deletions with timestamps.

Terminal window
snippbot secrets audit # Last 20 entries
snippbot secrets audit --name anthropic_api_key
snippbot secrets audit --limit 50
OptionDescription
-n, --nameFilter to one secret
-l, --limitMax rows (default: 20)

  • auth — daemon user account & API keys (separate from general secrets)
  • config — use config set for non-sensitive settings; sensitive keys are auto-migrated to this encrypted store