Skip to content

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

kv_storage

A simple command-line key-value storage tool for persisting personal credentials, passwords, API keys, etc.

Features

  • Simple interactive command-line interface
  • Persistent data storage
  • Full CRUD operations
  • Pretty table output
  • Automatic duplicate tag handling (adds -1, -2 suffix)
  • Cross-platform support (macOS / Linux / Windows)

Data Structure

Each entry contains three fields:

  • Tag - Tag name to identify the entry (e.g., "Google", "GitHub")
  • Account - Username or email
  • Password - Password or API key

Build & Install

# Clone the project
cd kv_storage

# Build release
cargo build --release

After compilation, the executable is at target/release/kv_storage

Usage

Initialize Storage

First-time use requires initialization:

kv_storage init

Add New Entry

Interactive adding:

kv_storage add

Follow the prompts to enter Tag, Account, and Password.

If the tag already exists, it will automatically append a suffix like -1, -2, etc. to avoid duplicates.

List All Entries

List all stored entries (shows all fields including password):

kv_storage list

Output:

Total 2 entries:

┌────────┬──────────────────┬──────────────┐
│ Tag    │ Account          │ Password     │
├────────┼──────────────────┼──────────────┤
│ GitHub │ user             │ mypass       │
│ Google │ user@gmail.com   │ apikey123    │
└────────┴──────────────────┴──────────────┘

Search Password

Fuzzy search by tag, show password in plain text:

kv_storage get <keyword>

Searches for all entries whose tag contains the keyword and displays the password.

Edit Entry

Edit an existing entry by exact tag:

kv_storage edit <tag>

Leave empty to keep the current value.

Delete Entry

Delete entry by exact tag:

kv_storage delete <tag>
# or use the shorthand alias
kv_storage del <tag>

Requires confirmation before deletion.

Clear All Entries

Clear all entries (requires confirmation):

kv_storage clear

This operation is irreversible.

Storage Location

Data file is stored in the system standard application data directory:

  • macOS: ~/Library/Application Support/kv_storage/storage.bin
  • Linux: ~/.local/share/kv_storage/storage.bin
  • Windows: %APPDATA%\kv_storage\storage.bin

Dependencies

This project uses these Rust crates:

License

MIT

About

存储key-value类数据的Rust项目

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages