A CLI tool to estimate the active hours spent on a GitHub pull request. This tool fetches the commits associated with a specified pull request and calculates the active hours based on commit activity, rounding to the nearest half-hour interval.
- Node.js
- yarn
-
Clone the repository:
git clone https://github.com/0x4007/pull-time-estimator.git cd pull-time-estimator
-
Install the dependencies:
yarn install
-
Create a
.env
file in the root directory and add your GitHub token:GITHUB_TOKEN=your_github_token
npx tsx build -u <GitHub Pull Request URL>
npx tsx build -u https://github.com/ubiquibot/command-query-user/pull/6
-u, --url <url>
: GitHub pull request URL (required)
- Fetch Commits: The tool fetches all commits associated with the specified pull request.
- Calculate Time Differences: It calculates the time differences between consecutive commits.
- Clustering: Using the DBSCAN algorithm, it clusters the commit activities based on time differences.
- Calculate Active Hours: It sums up the time spent on each cluster and converts it into hours.
- Round to Nearest Half-Hour: The total active hours are rounded to the nearest half-hour interval.