| Crates.io | smart-locker |
| lib.rs | smart-locker |
| version | 0.3.1 |
| created_at | 2025-03-31 18:08:23.036648+00 |
| updated_at | 2025-04-20 20:05:08.73605+00 |
| description | A smart locker CLI tool |
| homepage | https://github.com/WillIsback/smart-locker |
| repository | https://github.com/WillIsback/smart-locker |
| max_upload_size | |
| id | 1613747 |
| size | 150,294 |
A ultra-lightweight CLI tool written in Rust to encrypt, store, and manage sensitive secrets locally in a secure and durable way.
smart-locker solves a real-world problem:
In a fullstack project with CI/CD pipelines, tokens, private keys, passphrases, and API keys become critical.
Storing them in plain text is dangerous. Base64 encoding is not enough. smart-locker offers a reliable, simple, and effective solution.
At first start with smart-locker init.
smart-locker <command> [options]
MAIN COMMANDS:
encrypt Encrypt a secret and store it
decrypt Decrypt a `.slock` file
list List encrypted secrets
remove Delete a secret
init Generate the master key (locker.key)
backup-key Backup the encryption key
restore-key Restore the encryption key from a backup
export Export secrets to a file in a specified format
renew Renew the expiration date of a secret
EXAMPLE:
smart-locker encrypt -n openai_token -v sk-abc123...
smart-locker encrypt -n my_secret -v "my value" --tags "tag1,tag2"
smart-locker decrypt -n openai_token
smart-locker backup-key
smart-locker restore-key
smart-locker export --format env --output .env
smart-locker renew -n openai_token --days 30
ADVANCED:
OPENAI_API_KEY=$(echo smart-locker decrypt -n openai_token)
echo "This is a test" | smart-locker encrypt -n my_secret
smart-locker decrypt -n my_secret --clipboard
smart-locker export --format env --output .env
smart-locker is available for Linux and Windows. You can either build it from source (for Rust users), download a ready-to-use binary archive, or install it directly via cargo.
If you have Rust installed, you can install smart-locker directly from crates.io:
cargo install smart-locker
smartlocker_windows.zip archive.PATH environment variable for easier use.smart-locker.exe from any terminal (PowerShell, cmd, or Windows Terminal).Download the latest release from the Releases page.
Extract the smartlocker_linux.tar.gz archive:
tar -xzf smartlocker_linux.tar.gz
Move the binary into your path:
sudo mv dist/smart-locker /usr/local/bin/
Run:
smart-locker --version
Make sure Rust is installed:
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
Clone the repository:
git clone https://github.com/WillIsback/smart-locker.git
cd smart-locker
Build the project in release mode:
cargo build --release
Install the binary:
sudo cp target/release/smart-locker /usr/local/bin/
Verify:
smart-locker --version
Install Rust via rustup.
Clone the repository:
git clone https://github.com/WillIsback/smart-locker.git
cd smart-locker
Build in release mode:
cargo build --release
(Optional) Add to PATH:
$Env:Path += ";$PWD\target\release"
Test:
.\target\release\smart-locker.exe --version
~/.locker.slock or .aes extensionsmartlocker encrypt, decrypt, list, etc.cat secret.txt | smartlocker encrypt -n my_secret)backup-key and restore-key.env file with placeholders for secure decryptionrenewaes-gcm, rand, clap, serde, directoriesBecause managing secrets in a fullstack project means:
flowchart TD
A[smart-locker init] -->|Generates key 🔑| B[~/.locker/locker.key]
B --> C[smart-locker encrypt]
B --> D[smart-locker decrypt]
C -->|CLI input or STDIN| E[.slock encrypted file]
D -->|Read encrypted file| F[Decrypted secret]
Added the renew command to extend the expiration date of a secret.
Example:
smart-locker renew -n openai_token --days 30
This command updates the expiration metadata for the specified secret, ensuring it remains valid for the specified number of days.
Secrets can now have expiration dates set during encryption.
Example:
smart-locker encrypt -n my_secret -v "my value" --tags "tag1,tag2" --days 30
If a secret is expired, it will not be accessible until renewed using the renew command.
~/.locker/
├── locker.key # local symmetric key (or derived from a passphrase)
├── openai_token.slock
├── ssh_key_prod.slock
└── mydb_pass.slock
📝 Note: If you encounter any issues during installation, please check the Issues section or open a new ticket. 🦀🔐 smart-locker is a personal project to explore Rust deeply while building a useful security tool for everyday DevOps workflows.
This project is licensed under the MIT License. See the LICENSE file for details.
See the CHANGELOG for a detailed list of changes and updates.
Please use the commit message format feat: <description> for new features and fix: <description> for bug fixes. For more details, see the Contributing Guide.