feat: 新增系统密钥环安全存储API密钥与自动生成变更日志功能
This commit is contained in:
10
CHANGELOG.md
10
CHANGELOG.md
@@ -5,6 +5,16 @@ All notable changes to this project will be documented in this file.
|
||||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
||||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||
|
||||
## [Unreleased]
|
||||
|
||||
### ✨ 新功能
|
||||
- 自动生成和维护 Keep a Changelog 格式的变更日志
|
||||
- 交互式命令行界面,支持预览和确认
|
||||
|
||||
### 🔐 安全特性
|
||||
- 敏感数据加密存储(API 密钥、SSH 密码等)
|
||||
- 使用系统密钥环安全保存凭证
|
||||
|
||||
## [0.1.9] - 2026-03-06
|
||||
|
||||
### 🐞 错误修复
|
||||
|
||||
40
README.md
40
README.md
@@ -6,6 +6,8 @@ A powerful AI-powered Git assistant for generating conventional commits, tags, a
|
||||
|
||||
[Still in early development, some features may not be complete. Feedback and contributions are welcome.]
|
||||
|
||||
> ⚠️ **Important Notice**: QuiCommit now uses system keyring to store API keys securely. This change may cause breaking changes to your existing configuration. If you encounter issues after updating, please run `quicommit config reset --force` to reset your configuration, then reconfigure your settings.
|
||||
|
||||

|
||||

|
||||
|
||||
@@ -159,30 +161,30 @@ quicommit profile token
|
||||
```bash
|
||||
# Configure Ollama (local)
|
||||
quicommit config set-llm ollama
|
||||
quicommit config set-ollama --url http://localhost:11434 --model llama2
|
||||
quicommit config set-llm ollama --url http://localhost:11434 --model llama2
|
||||
|
||||
# Configure OpenAI
|
||||
quicommit config set-llm openai
|
||||
quicommit config set-openai-key YOUR_API_KEY
|
||||
quicommit config set-api-key YOUR_API_KEY
|
||||
|
||||
# Configure Anthropic Claude
|
||||
quicommit config set-llm anthropic
|
||||
quicommit config set-anthropic-key YOUR_API_KEY
|
||||
quicommit config set-api-key YOUR_API_KEY
|
||||
|
||||
# Configure Kimi (Moonshot AI)
|
||||
quicommit config set-llm kimi
|
||||
quicommit config set-kimi-key YOUR_API_KEY
|
||||
quicommit config set-kimi --base-url https://api.moonshot.cn/v1 --model moonshot-v1-8k
|
||||
quicommit config set-api-key YOUR_API_KEY
|
||||
quicommit config set-llm kimi --base-url https://api.moonshot.cn/v1 --model moonshot-v1-8k
|
||||
|
||||
# Configure DeepSeek
|
||||
quicommit config set-llm deepseek
|
||||
quicommit config set-deepseek-key YOUR_API_KEY
|
||||
quicommit config set-deepseek --base-url https://api.deepseek.com/v1 --model deepseek-chat
|
||||
quicommit config set-api-key YOUR_API_KEY
|
||||
quicommit config set-llm deepseek --base-url https://api.deepseek.com/v1 --model deepseek-chat
|
||||
|
||||
# Configure OpenRouter
|
||||
quicommit config set-llm openrouter
|
||||
quicommit config set-openrouter-key YOUR_API_KEY
|
||||
quicommit config set-openrouter --base-url https://openrouter.ai/api/v1 --model openai/gpt-4
|
||||
quicommit config set-api-key YOUR_API_KEY
|
||||
quicommit config set-llm openrouter --base-url https://openrouter.ai/api/v1 --model openai/gpt-4
|
||||
|
||||
# Set commit format
|
||||
quicommit config set-commit-format conventional
|
||||
@@ -205,8 +207,14 @@ quicommit config set-keep-changelog-types-english true
|
||||
# Test LLM connection
|
||||
quicommit config test-llm
|
||||
|
||||
# Check keyring availability
|
||||
quicommit config check-keyring
|
||||
|
||||
# Show config file path
|
||||
quicommit config path
|
||||
|
||||
# Reset configuration to defaults
|
||||
quicommit config reset
|
||||
quicommit config reset --force
|
||||
```
|
||||
|
||||
## Command Reference
|
||||
@@ -396,12 +404,24 @@ quicommit config set llm.provider ollama
|
||||
# Get configuration value
|
||||
quicommit config get llm.provider
|
||||
|
||||
# Set API key (stored in system keyring)
|
||||
quicommit config set-api-key YOUR_API_KEY
|
||||
|
||||
# Delete API key from keyring
|
||||
quicommit config delete-api-key
|
||||
|
||||
# Test LLM connection
|
||||
quicommit config test-llm
|
||||
|
||||
# List available models
|
||||
quicommit config list-models
|
||||
|
||||
# Check keyring availability
|
||||
quicommit config check-keyring
|
||||
|
||||
# Show config file path
|
||||
quicommit config path
|
||||
|
||||
# Export configuration
|
||||
quicommit config export -o config-backup.toml
|
||||
|
||||
|
||||
@@ -4,6 +4,13 @@
|
||||
# - macOS: ~/Library/Application Support/quicommit/config.toml
|
||||
# - Windows: %APPDATA%\quicommit\config.toml
|
||||
|
||||
# ⚠️ IMPORTANT: Keyring Feature Update
|
||||
# QuiCommit now uses system keyring to store API keys securely.
|
||||
# This change may cause breaking changes to your existing configuration.
|
||||
# If you encounter issues after updating, please reset your configuration:
|
||||
# quicommit config reset --force
|
||||
# Then reconfigure your settings using the CLI commands.
|
||||
|
||||
# Configuration version (for migration)
|
||||
version = "1"
|
||||
|
||||
|
||||
40
readme_zh.md
40
readme_zh.md
@@ -6,6 +6,8 @@
|
||||
|
||||
【目前还处在早期开发阶段,依然有一些功能未完善,欢迎反馈和贡献。】
|
||||
|
||||
> ⚠️ **重要提示**:QuiCommit 现在使用系统密钥环(keyring)来安全存储 API 密钥。此更改可能会对现有配置造成破坏性变更。如果在更新后遇到问题,请运行 `quicommit config reset --force` 重置配置,然后重新配置您的设置。
|
||||
|
||||

|
||||

|
||||
|
||||
@@ -159,30 +161,30 @@ quicommit profile token
|
||||
```bash
|
||||
# 配置Ollama(本地)
|
||||
quicommit config set-llm ollama
|
||||
quicommit config set-ollama --url http://localhost:11434 --model llama2
|
||||
quicommit config set-llm ollama --url http://localhost:11434 --model llama2
|
||||
|
||||
# 配置OpenAI
|
||||
quicommit config set-llm openai
|
||||
quicommit config set-openai-key YOUR_API_KEY
|
||||
quicommit config set-api-key YOUR_API_KEY
|
||||
|
||||
# 配置Anthropic Claude
|
||||
quicommit config set-llm anthropic
|
||||
quicommit config set-anthropic-key YOUR_API_KEY
|
||||
quicommit config set-api-key YOUR_API_KEY
|
||||
|
||||
# 配置Kimi
|
||||
quicommit config set-llm kimi
|
||||
quicommit config set-kimi-key YOUR_API_KEY
|
||||
quicommit config set-kimi --base-url https://api.moonshot.cn/v1 --model moonshot-v1-8k
|
||||
quicommit config set-api-key YOUR_API_KEY
|
||||
quicommit config set-llm kimi --base-url https://api.moonshot.cn/v1 --model moonshot-v1-8k
|
||||
|
||||
# 配置DeepSeek
|
||||
quicommit config set-llm deepseek
|
||||
quicommit config set-deepseek-key YOUR_API_KEY
|
||||
quicommit config set-deepseek --base-url https://api.deepseek.com/v1 --model deepseek-chat
|
||||
quicommit config set-api-key YOUR_API_KEY
|
||||
quicommit config set-llm deepseek --base-url https://api.deepseek.com/v1 --model deepseek-chat
|
||||
|
||||
# 配置OpenRouter
|
||||
quicommit config set-llm openrouter
|
||||
quicommit config set-openrouter-key YOUR_API_KEY
|
||||
quicommit config set-openrouter --base-url https://openrouter.ai/api/v1 --model openai/gpt-4
|
||||
quicommit config set-api-key YOUR_API_KEY
|
||||
quicommit config set-llm openrouter --base-url https://openrouter.ai/api/v1 --model openai/gpt-4
|
||||
|
||||
# 设置提交格式
|
||||
quicommit config set-commit-format conventional
|
||||
@@ -205,8 +207,14 @@ quicommit config set-keep-changelog-types-english true
|
||||
# 测试LLM连接
|
||||
quicommit config test-llm
|
||||
|
||||
# 检查密钥环可用性
|
||||
quicommit config check-keyring
|
||||
|
||||
# 显示配置文件路径
|
||||
quicommit config path
|
||||
|
||||
# 重置配置为默认值
|
||||
quicommit config reset
|
||||
quicommit config reset --force
|
||||
```
|
||||
|
||||
## 命令参考
|
||||
@@ -396,12 +404,24 @@ quicommit config set llm.provider ollama
|
||||
# 获取配置值
|
||||
quicommit config get llm.provider
|
||||
|
||||
# 设置API密钥(存储在系统密钥环中)
|
||||
quicommit config set-api-key YOUR_API_KEY
|
||||
|
||||
# 从密钥环删除API密钥
|
||||
quicommit config delete-api-key
|
||||
|
||||
# 测试LLM连接
|
||||
quicommit config test-llm
|
||||
|
||||
# 列出可用模型
|
||||
quicommit config list-models
|
||||
|
||||
# 检查密钥环可用性
|
||||
quicommit config check-keyring
|
||||
|
||||
# 显示配置文件路径
|
||||
quicommit config path
|
||||
|
||||
# 导出配置
|
||||
quicommit config export -o config-backup.toml
|
||||
|
||||
|
||||
Reference in New Issue
Block a user