A command-line tool for securely managing secrets with encryption and metadata support.
- Secure storage of secrets using hybrid encryption (RSA + AES)
- YAML-based secret storage with metadata
- Support for secret tags and categorization
- Cross-platform support (Linux, macOS, Windows)
- Clone the repository:
git clone https://github.com/open-zhy/secm.git
cd secm
- Build for your platform:
make
Or build for a specific platform:
make build-platform PLATFORM=darwin ARCH=arm64
Build for all platforms:
make build-all
Before using secm, initialize the workspace:
secm init
You can add --profile <profile>
option (default value is default
). This will allow multiple workspaces on same machine. This option is usable overall all subcommands, which will just scope the action to specified workspace.
This creates the .secm
directory in your home folder and generates an RSA identity key.
Create a new secret from a file with metadata:
secm create secret.txt -n "API Key" -d "Production API key" -t "api,prod" --type "api-key"
Options:
-n, --name
: Name of the secret (required)-d, --description
: Description of the secret-t, --type
: Type of secret (e.g., api-key, certificate)--tags
: Comma-separated list of tags-f, --format
: Format of the secret (text, json, binary)
List all stored secrets:
secm list
Show additional information:
secm list -t # Show tags
secm list -d # Show descriptions
Retrieve a secret by its ID:
secm get <secret-id> # Output to stdout
secm get <secret-id> -o output.txt # Save to file
secm get <secret-id> -m # Show metadata
secm get <secret-id> -q # Quiet mode (only output value)
Requirements:
- Go
1.21
or later - Make
Available make commands:
make
: Build for current platformmake build-all
: Build for all platformsmake build-platform PLATFORM=darwin ARCH=arm64
: Build for specific platformmake clean
: Clean build directorymake test
: Run testsmake fmt
: Format codemake install
: Install locally
- Uses hybrid encryption (
RSA
,ECDH
for key exchange,AES-128
for data) - Secure file permissions (
0600
for keys,0700
for directories) - Unique hash-based IDs for secrets
- Base64 encoded encrypted data in YAML storage
- Basics of secrets management: workspace initialization, create secret, list and unfold secret
- Add
--profile
option on root level, default to~/.secm
: this should enable multiple instances or easily resurrect from an existing profile - Support
ed25519
key and eventually more - Enable transfer to another identity:
secm transfer <publicKey>
: it will just create a copy in the workspace of the same secret, only recipient can read the secret - After transfer, enable p2p direct transfer (preferrable implemented as plugin, not apart of the core util)
- Better document codes and the workflows
MIT License