ugd
v1.0.1
Published
Automated weekly reports and code reviews using Git history and LLMs
Maintainers
Readme
DevDiary (ugd)
DevDiary (ugd) is a powerful CLI tool designed to automate your weekly reporting and code review processes. By leveraging your Git history and Large Language Models (LLMs), it generates high-quality, insightful summaries and reviews, saving you valuable time.
Features
- Automated Weekly Reports: Generates detailed weekly reports based on your git commit history.
- AI-Powered Code Review: Analyzes staged changes or specific branches for bugs, code style, performance, and security issues.
- Flexible Configuration: Supports custom LLM providers (OpenAI, local models, etc.) via
~/.ddrc. - Customizable Prompts: Fully customizable prompts using Markdown templates stored in
~/.dd/prompts/. - Multi-Branch Support: Easily aggregate work from multiple branches.
Installation
# Clone the repository
git clone <repository-url>
cd DevDiary
# Install dependencies
npm install
# Build the project
npm run build
# Link the binary globally
npm linkConfiguration
1. Setup LLM
Configure your LLM provider (e.g., OpenAI, LocalAI).
ugd config --baseURL https://api.openai.com/v1 --key YOUR_API_KEY --model gpt-3.5-turboOr use the interactive mode:
ugd configView current configuration:
ugd config --list2. Customize Prompts
Initialize default prompt templates:
ugd config --init-promptsThis creates report.md and review.md in ~/.dd/prompts/. You can edit these files to tailor the output to your needs (e.g., change language to Chinese, adjust tone).
Supported Placeholders:
- Report:
{{user}},{{from}},{{to}},{{commits}} - Review:
{{diff}}
Usage
Generating Weekly Reports
Generate a report for the current week (default):
ugd report --user "Your Name" --from 2023-10-01 --to 2023-10-07Generate a report including multiple branches:
ugd report --user "Your Name" --from 2023-10-01 --branches develop,feature-loginCode Review
Review staged changes (pre-commit):
ugd review --stagedReview a specific branch against the default branch:
ugd review --branch feature-loginReview changes in a specific time range on a branch:
ugd review --branch develop --from 2023-10-01 --to 2023-10-07Development
# Run in development mode
npm run dev
# Build for production
npm run buildLicense
ISC
