docs: update readme with new installation methods and cli options

This commit is contained in:
2026-02-01 13:50:09 +00:00
parent dba6d94eab
commit bfc1812ebf
8 changed files with 531 additions and 86 deletions

234
README.md
View File

@@ -4,6 +4,8 @@ English | [中文文档](README_zh.md)
A powerful AI-powered Git assistant for generating conventional commits, tags, and changelogs. Manage multiple Git profiles for different work contexts.
[Still in early development, some features may not be complete. Feedback and contributions are welcome.]
![Rust](https://img.shields.io/badge/rust-%23000000.svg?style=for-the-badge&logo=rust&logoColor=white)
![License](https://img.shields.io/badge/license-MIT-blue.svg)
@@ -19,9 +21,19 @@ A powerful AI-powered Git assistant for generating conventional commits, tags, a
## Installation
### Cargo Install
The cargo-installed version may temporarily lag behind the source code progress.
```bash
git clone https://github.com/yourusername/quicommit.git
cd quicommit
cargo install quicommit
```
### Install from Source
```bash
git clone https://git.lyz.one/SidneyZhang/QuiCommit.git
cd QuiCommit
cargo build --release
cargo install --path .
```
@@ -50,6 +62,12 @@ quicommit commit -a
# Skip confirmation
quicommit commit --yes
# Use date-based commit message
quicommit commit --date
# Push after committing
quicommit commit --push
```
### Create Tag
@@ -63,6 +81,12 @@ quicommit tag --bump minor
# Custom tag name
quicommit tag -n v1.0.0
# AI-generate tag message
quicommit tag --generate
# Create tag and push to remote
quicommit tag --push
```
### Generate Changelog
@@ -73,6 +97,15 @@ quicommit changelog
# Generate for specific version
quicommit changelog -v 1.0.0
# AI-generate changelog
quicommit changelog --generate
# Initialize new changelog file
quicommit changelog --init
# Specify output file
quicommit changelog -o RELEASE_NOTES.md
```
### Manage Profiles
@@ -84,11 +117,41 @@ quicommit profile add
# List profiles
quicommit profile list
# Show profile details
quicommit profile show
# Switch profile
quicommit profile switch
# Set default profile
quicommit profile set-default personal
# Set profile for current repo
quicommit profile set-repo personal
# Apply profile to current repo
quicommit profile apply
# Apply profile globally
quicommit profile apply --global
# Copy profile
quicommit profile copy personal work
# Edit profile
quicommit profile edit personal
# Remove profile
quicommit profile remove old-profile
# Check profile
quicommit profile check
# View usage statistics
quicommit profile stats
# Manage profile tokens
quicommit profile token
```
### Configure LLM
@@ -109,17 +172,41 @@ quicommit config set-anthropic-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
# 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
# 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
# Set commit format
quicommit config set-commit-format conventional
# Set version prefix
quicommit config set-version-prefix v
# Set changelog path
quicommit config set-changelog-path CHANGELOG.md
# Set output language
quicommit config set-language en
# Set keep commit types in English
quicommit config set-keep-types-english true
# Set keep changelog types in English
quicommit config set-keep-changelog-types-english true
# Test LLM connection
quicommit config test-llm
# Reset configuration to defaults
quicommit config reset
```
## Command Reference
@@ -137,17 +224,23 @@ quicommit config test-llm
| Option | Description |
|--------|-------------|
| `-t, --commit-type` | Commit type (feat, fix, etc.) |
| `--commit-type` | Commit type (feat, fix, etc.) |
| `-s, --scope` | Commit scope |
| `-m, --message` | Commit description |
| `--body` | Commit body |
| `--breaking` | Mark as breaking change |
| `-b, --breaking` | Mark as breaking change |
| `-d, --date` | Use date-based commit message |
| `--manual` | Manual input, skip AI |
| `-a, --all` | Stage all changes |
| `-S, --sign` | GPG sign commit |
| `--amend` | Amend previous commit |
| `--dry-run` | Show without committing |
| `--conventional` | Use Conventional Commits format |
| `--commitlint` | Use commitlint format |
| `--no-verify` | Skip commit message verification |
| `-y, --yes` | Skip confirmation |
| `--push` | Push after committing |
| `--remote` | Specify remote repository (default: origin) |
### Tag Options
@@ -158,14 +251,35 @@ quicommit config test-llm
| `-m, --message` | Tag message |
| `-g, --generate` | AI-generate message |
| `-S, --sign` | GPG sign tag |
| `--lightweight` | Create lightweight tag |
| `--push` | Push to remote |
| `-l, --lightweight` | Create lightweight tag |
| `-f, --force` | Force overwrite existing tag |
| `-p, --push` | Push to remote |
| `-r, --remote` | Specify remote repository (default: origin) |
| `--dry-run` | Dry run |
| `-y, --yes` | Skip confirmation |
### Changelog Options
| Option | Description |
|--------|-------------|
| `-o, --output` | Output file path |
| `-v, --version` | Generate for specific version |
| `-f, --from` | Generate from specific tag |
| `-t, --to` | Generate to specific ref (default: HEAD) |
| `-i, --init` | Initialize new changelog file |
| `-g, --generate` | AI-generate changelog |
| `--prepend` | Prepend to existing changelog |
| `--include-hashes` | Include commit hashes |
| `--include-authors` | Include authors |
| `--format` | Format (keep-a-changelog, github-releases) |
| `--dry-run` | Dry run (output to stdout) |
| `-y, --yes` | Skip confirmation |
## Configuration File
Location:
- Linux/macOS: `~/.config/quicommit/config.toml`
- Linux: `~/.config/quicommit/config.toml`
- macOS: `~/Library/Application Support/quicommit/config.toml`
- Windows: `%APPDATA%\quicommit\config.toml`
```toml
@@ -174,15 +288,27 @@ default_profile = "personal"
[profiles.personal]
name = "personal"
user_name = "John Doe"
user_email = "john@example.com"
user_name = "Your Name"
user_email = "your.email@example.com"
description = "Personal projects"
is_work = false
[profiles.work]
name = "work"
user_name = "John Doe"
user_email = "john@company.com"
user_name = "Your Name"
user_email = "your.name@company.com"
description = "Work projects"
is_work = true
organization = "Acme Corp"
organization = "Your Company"
[profiles.work.ssh]
private_key_path = "/home/user/.ssh/id_rsa_work"
agent_forwarding = true
[profiles.work.gpg]
key_id = "YOUR_GPG_KEY_ID"
program = "gpg"
use_agent = true
[llm]
provider = "ollama"
@@ -198,19 +324,50 @@ model = "llama2"
model = "gpt-4"
base_url = "https://api.openai.com/v1"
[llm.anthropic]
model = "claude-3-sonnet-20240229"
[llm.kimi]
model = "moonshot-v1-8k"
[llm.deepseek]
model = "deepseek-chat"
[llm.openrouter]
model = "openai/gpt-4"
[commit]
format = "conventional"
auto_generate = true
allow_empty = false
gpg_sign = false
max_subject_length = 100
require_scope = false
require_body = false
body_required_types = ["feat", "fix"]
[tag]
version_prefix = "v"
auto_generate = true
gpg_sign = false
include_changelog = true
[changelog]
path = "CHANGELOG.md"
auto_generate = true
format = "keep-a-changelog"
include_hashes = false
include_authors = false
group_by_type = true
[theme]
colors = true
icons = true
date_format = "%Y-%m-%d"
[repo_profiles]
"/path/to/work/project" = "work"
"/path/to/personal/project" = "personal"
```
## Environment Variables
@@ -227,14 +384,32 @@ group_by_type = true
# View current configuration
quicommit config list
# Show configuration details
quicommit config show
# Edit configuration file
quicommit config edit
# Set configuration value
quicommit config set llm.provider ollama
# Get configuration value
quicommit config get llm.provider
# Test LLM connection
quicommit config test-llm
# List available models
quicommit config list-models
# Edit configuration
quicommit config edit
# Export configuration
quicommit config export -o config-backup.toml
# Import configuration
quicommit config import -i config-backup.toml
# Reset configuration
quicommit config reset --force
```
## Contributing
@@ -253,8 +428,8 @@ Contributions are welcome! Please follow these steps:
```bash
# Clone repository
git clone https://github.com/YOUR_USERNAME/quicommit.git
cd quicommit
git clone https://git.lyz.one/SidneyZhang/QuiCommit.git
cd QuiCommit
# Fetch dependencies
cargo fetch
@@ -282,11 +457,36 @@ cargo fmt --check
```
src/
├── commands/ # CLI command implementations
│ ├── commit.rs
│ ├── tag.rs
│ ├── changelog.rs
│ ├── profile.rs
│ ├── config.rs
│ └── init.rs
├── config/ # Configuration management
│ ├── manager.rs
│ └── profile.rs
├── generator/ # AI content generation
├── git/ # Git operations
│ ├── commit.rs
│ ├── tag.rs
│ └── changelog.rs
├── llm/ # LLM provider implementations
└── utils/ # Utility functions
│ ├── ollama.rs
│ ├── openai.rs
│ ├── anthropic.rs
│ ├── kimi.rs
│ ├── deepseek.rs
│ └── openrouter.rs
├── i18n/ # Internationalization support
│ ├── messages.rs
│ └── translator.rs
├── utils/ # Utility functions
│ ├── validators.rs
│ ├── formatter.rs
│ ├── crypto.rs
│ └── editor.rs
└── main.rs # Program entry point
```
## License