Skip to content

Release v0.1.4

✨ Smart Prompt Auto-Completion

Custom prompts just got a lot easier! gcop-rs now automatically appends missing required sections to your prompts.

Commit Prompts

Just write your instructions - gcop-rs handles the rest:

toml
[commit]
custom_prompt = "Generate commit message in Chinese, be concise"

If {diff} is missing, gcop-rs automatically appends the diff and context sections.

Review Prompts

For reviews, gcop-rs will:

  1. Append {diff} section if missing
  2. Always append JSON output format specification
toml
[review]
custom_prompt = "Review for security vulnerabilities, focus on SQL injection"

No need to write the JSON format yourself - it's automatically added.

🔍 Verbose Mode Shows Full Prompts

Use -v to see the complete prompt sent to LLM, including auto-completed sections:

bash
gcop-rs -v commit
gcop-rs -v review

This helps debug custom prompts and understand what the AI actually receives.

🐛 Fixed JSON Response Parsing

Fixed a bug in clean_json_response where the chain of unwrap_or(response) calls would incorrectly fall back to the original response instead of the intermediate result.

Now uses defensive parsing that extracts content between the first { and last }, making it robust against various LLM response formats:

rust
// Now handles any wrapper format:
// "Sure! Here's the JSON: ```json {...} ``` Hope this helps!"
// → Correctly extracts {...}

📦 Installation

bash
cargo install gcop-rs

Or build from source:

bash
git clone https://github.com/AptS-1547/gcop-rs.git
cd gcop-rs
cargo build --release

📚 Documentation