The git-task-analyzer
is a Command-Line Interface (CLI) tool designed to analyze git repositories within a specified time frame. It extracts commit information, processes these commits using AI, and creates detailed, human-readable task descriptions suitable for project management or client invoicing.
- Interactive commit grouping
- Extraction of git commits within a specified date range
- Analysis of commits using OpenAI
- Generation of detailed task descriptions
- Computation of estimated time for task completion
To get started with git-task-analyzer
, you need to have Node.js and npm installed on your system. Once you have them:
-
Clone the repository:
git clone https://github.com/vlazic/git-task-analyzer.git cd git-task-analyzer
-
Install the dependencies:
npm install
-
Link the CLI for global usage:
npm link
To run the git-task-analyzer
:
git-task-analyzer [options]
-
-u, --user <user>
: Specify the user for commit analysis. If not provided, commits from all authors will be considered. -
-r, --repo <path>
: Specify the repository path. If not provided, the tool will analyze the repository in the current directory. -
-s, --sort <order>
: Sort results in ascending (asc
) or descending (desc
) order. By default, results are sorted in ascending order. -
-o, --output <file>
: Specify the file where tasks should be saved. If this option is not provided, tasks will be displayed on the screen. -
-e, --exclude <files>
: Exclude specified files from the analysis. Provide a comma-separated list of files or patterns, e.g.'package-lock.json,yarn.lock'
. By default, typical lock files and other common noise files like.DS_Store
,*.log
, etc., are excluded. -
--debug
: Display debug logs.
-
Analyze commits from user "john.doe" in the repository located at
./my-project
, and sort the results in descending order:git-task-analyzer --user john.doe --repo ./my-project --sort desc
-
Analyze commits in the repository located at
./my-project
, save the results totasks.json
, and excludeyarn.lock
andpackage-lock.json
:git-task-analyzer -r ./my-project -o tasks.json --exclude yarn.lock,package-lock.json
-
Analyze commits from the repository in the current directory and exclude
*.log
files:git-task-analyzer --exclude *.log
- Specify the start and end dates for the analysis.
- Group commits interactively or process individual ones.
- Review the groups and commits before sending them to AI for analysis.
- Obtain a detailed task list after AI processing.
- Review total time estimates for all tasks.
The project uses various libraries including:
chalk
: For colorful console logs.commander
: To handle CLI input.inquirer
andinquirer-date-prompt
: For interactive prompts.openai
: For OpenAI API interactions.
Got it! I've made the modifications based on your clarifications. Here's the revised TODO
section for your README.md
:
As we continue to develop and enhance git-task-analyzer
, here are some planned features and improvements:
-
Implement Local LLM Models: Integrate local LLM models via LocalAi.
-
Stream AI Responses: Once local LLM implementation is complete, consider a feature to display streaming responses from the AI, especially if there's a delay in getting the results.
-
Parallelize OpenAI Calls: Speed up the processing by making concurrent calls to OpenAI.
-
Token Count Warning: For OpenAI calls, count the number of tokens in the request and issue a warning if it exceeds 16,000 tokens.
-
Dynamic OpenAI Model Selection:
- Allow users to specify the OpenAI model via a CLI flag.
- Implement logic to choose the OpenAI model dynamically based on the number of tokens in the request.
-
Data Export: Implement CSV/TSV export functionality with options to customize column names and their order.
-
Packaging as an NPM Library and CLI:
- Package the tool for NPM to be used both as a CLI and as a library for those who want to integrate it into their applications.
-
CLI Flags for System Prompts:
--prompt
: Allow users to specify a custom system prompt that is sent to the AI.--show-prompt
: Display the current system prompt to the user.
-
Commit Exclusion: Allow users to exclude specific commits or tasks from the list.
-
Date Input via Flags: Add flags to directly input the start and end dates for analysis, bypassing the prompts.
-
Loading Indicators: Display spinners or other visual indicators during API calls to signal ongoing processing.
-
Utilize OpenAI "Functions": Incorporate the use of "functions" in OpenAI calls to ensure we receive the desired structured response.
Vladimir Lazić - [email protected] | https://vlazic.com/
This project is licensed under the MIT License.
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.