feat: add persistent profile storage to ~/.kvs/config.json

Implemented roadmap #1: Configuration file for persistent profiles.

Features:
- Auto-saves profiles to ~/.kvs/config.json on add/use/remove
- Auto-loads profiles on shell startup
- File created with 0600 permissions for token security
- Shows active profile in welcome message
- Added 'profile save' and 'profile load' commands for manual control

Technical details:
- Created config.go with LoadConfig/SaveConfig functions
- Profile changes automatically trigger persistence
- ~/.kvs directory created with 0700 permissions if missing
- Gracefully handles missing config file on first run

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-10-05 23:47:13 +03:00
parent 0c9e314d7c
commit 39a1d4482a
5 changed files with 159 additions and 1 deletions

View File

@@ -27,10 +27,12 @@ KVS Interactive Shell - Available Commands:
Connection & Authentication:
connect <url> - Connect to KVS server
auth <token> - Set authentication token
profile - List all profiles
profile add <name> <token> <user-uuid> [url] - Add user profile
profile use <name> - Switch to user profile
profile remove <name> - Remove user profile
profile - List all profiles
profile save - Save profiles to ~/.kvs/config.json
profile load - Load profiles from ~/.kvs/config.json
Key-Value Operations:
get <key> - Retrieve value for key