{"id":48086254,"url":"https://github.com/tschaefer/gh-issues-stats","last_synced_at":"2026-04-04T15:20:20.243Z","repository":{"id":331473901,"uuid":"1125723091","full_name":"tschaefer/gh-issues-stats","owner":"tschaefer","description":"Analyze Github repository issues lifecycle.","archived":false,"fork":false,"pushed_at":"2026-01-21T21:05:10.000Z","size":60,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-22T09:57:06.730Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"https://blog.tschaefer.org/github-issues","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tschaefer.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-12-31T08:28:31.000Z","updated_at":"2026-01-21T21:04:27.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/tschaefer/gh-issues-stats","commit_stats":null,"previous_names":["tschaefer/github-issues","tschaefer/gh-issues-stats"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/tschaefer/gh-issues-stats","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tschaefer%2Fgh-issues-stats","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tschaefer%2Fgh-issues-stats/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tschaefer%2Fgh-issues-stats/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tschaefer%2Fgh-issues-stats/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tschaefer","download_url":"https://codeload.github.com/tschaefer/gh-issues-stats/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tschaefer%2Fgh-issues-stats/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31403955,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T10:20:44.708Z","status":"ssl_error","status_checked_at":"2026-04-04T10:20:06.846Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-04-04T15:20:18.426Z","updated_at":"2026-04-04T15:20:20.223Z","avatar_url":"https://github.com/tschaefer.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gh-issues-stats\n\n[![Tag](https://img.shields.io/github/tag/tschaefer/gh-issues-stats.svg)](https://github.com/tschaefer/gh-issues-stats/releases)\n![Ruby Version](https://img.shields.io/badge/Ruby-%3E%3D%203.3-%23007d9c)\n[![Contributors](https://img.shields.io/github/contributors/tschaefer/gh-issues-stats)](https://github.com/tschaefer/gh-issues-stats/graphs/contributors)\n[![License](https://img.shields.io/github/license/tschaefer/gh-issues-stats)](./LICENSE)\n\nA Ruby gem for analyzing GitHub repository issues with statistics and visualizations.\n\n## Description\n\n`gh-issues-stats` is a command-line tool that helps you analyze and understand the issues lifecycle in any GitHub repository. It provides detailed statistics, visualizations, and insights about issues including:\n\n- Issue creation trends over time (yearly/monthly breakdowns)\n- Closing time statistics (average and median)\n- Label-based filtering and analysis\n- Visual charts and tables for data representation\n- Cached data for faster subsequent queries\n\n## Installation\n\n### Install as a Gem\n\n```bash\ngem install gh-issues-stats\n```\n\n### Install from Source\n\n```bash\ngit clone https://github.com/tschaefer/gh-issues-stats.git\ncd gh-issues-stats\nbundle install\nrake install\n```\n\n## Requirements\n\n- Ruby \u003e= 3.3.0\n- A GitHub account (optional, but recommended for higher API rate limits)\n\n## Usage\n\n\u003e [!IMPORTANT]\n\u003e Initial data fetching may take some time and consume a significant amount of\n\u003e memory depending on the number of issues in the repository.\n\n### Basic Commands\n\n#### View Issues by Year\n\nDisplay yearly statistics for a repository:\n\n```bash\ngh-issues-stats yearly owner/repository\n```\n\nExample:\n```bash\ngh-issues-stats yearly rails/rails\n```\n\nOptions:\n- `--format FORMAT`- Specify output format (table, chart, json). (default: table)\n- `--label LABEL` - Filter by specific label (can be used multiple times; prefix with `!` to exclude)\n- `--[no-]finished` - Show finished stats (default: false)\n- `--[no-]legend` - Toggle legend display (default: true)\n- `--[no-]pager` - Toggle output paging (default: false)\n\n#### View Issues by Month\n\nDisplay monthly statistics for a specific year:\n\n```bash\ngh-issues-stats monthly YEAR owner/repository\n```\n\nExample:\n```bash\ngh-issues-stats monthly 2023 rails/rails\n```\n\nOptions: Same as yearly command\n\n#### List All Labels\n\nDisplay all labels used in a repository:\n\n```bash\ngh-issues-stats labels owner/repository\n```\n\n### Global Options\n\n- `--configuration-file FILE` - Specify a configuration file (default: ~/.config/gh-issues-stats.json)\n- `--cache-path PATH` - Specify cache directory (default:\n  ~/.cache/gh-issues-stats)\n- `--refresh INTERVAL` - Set refresh interval (e.g., 30minutes, 2.5hours, 1day) (default: 24hours)\n- `-v, --version` - Show version information\n- `-m, --man` - Show manual page\n\n### Examples\n\nFilter issues by multiple labels:\n```bash\ngh-issues-stats yearly --label bug --label '!enhancement' rails/rails\n```\n\nShow monthly breakdown with chart visualization:\n```bash\ngh-issues-stats monthly --format chart 2023 rails/rails\n```\n\nUse with custom refresh interval:\n```bash\ngh-issues-stats --refresh 2hours yearly rails/rails\n```\n\n## Configuration\n\n### Authentication\n\nFor higher API rate limits, you can provide GitHub credentials through the\nconfiguration file. See [Octokit Authentication](https://github.com/octokit/octokit.rb?tab=readme-ov-file#authentication) for supported authentication methods.\n\n### Caching\n\nIssue data is cached locally in to improve performance on subsequent queries.\nThe cache is automatically refreshed on call based on the refresh interval\n(default: 24 hours).\n\n## Features\n\n- **Statistical Analysis**: Calculate average and median closing times for issues\n- **Time-based Grouping**: View issues grouped by year or month\n- **Label Filtering**: Filter issues by one or more labels\n- **Multiple Output Formats**: Choose between tables and charts\n- **Smart Caching**: Local SQLite database for fast repeated queries\n- **Flexible Refresh**: Configurable data refresh intervals\n- **Pagination Support**: Built-in pager for large datasets\n- **Issue Detection**: Skips draft issues and pull requests\n\n## Development\n\n### Setup\n\n```bash\ngit clone https://github.com/tschaefer/gh-issues-stats.git\ncd gh-issues-stats\nbundle install\n```\n\n### Running Tests\n\n```bash\nbundle exec rspec\n```\n\n### Code Quality\n\n```bash\n# Run RuboCop\nbundle exec rubocop\n\n# Run with auto-correct\nbundle exec rubocop -a\n```\n\n## Architecture\n\nThe gem is structured around several key components:\n\n- **Database Layer**: SQLite-based storage for issue data\n- **Fetch Module**: Retrieves issues from GitHub API using Octokit\n- **Statistics Module**: Calculates various metrics (average, median, etc.)\n- **Group Module**: Organizes issues by time periods\n- **App Layer**: CLI interface built with Clamp\n\n## Dependencies\n\n- `clamp` - Command-line parsing\n- `faraday-retry` - HTTP request retries\n- `hashie` - Enhanced Hash functionality\n- `octokit` - GitHub API client\n- `pastel` - Terminal color output\n- `sqlite3` - Local data caching\n- `tty-pager` - Output pagination\n- `tty-table` - Table rendering\n- `unicode_plot` - Chart visualization\n\n## Contributing\n\n1. Fork the repository\n2. Create your feature branch (`git checkout -b feature/amazing-feature`)\n3. Commit your changes (`git commit -am 'Add some amazing feature'`)\n4. Push to the branch (`git push origin feature/amazing-feature`)\n5. Open a Pull Request\n\nPlease ensure:\n- All tests pass\n- Code follows RuboCop style guidelines\n- New features include appropriate tests\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftschaefer%2Fgh-issues-stats","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftschaefer%2Fgh-issues-stats","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftschaefer%2Fgh-issues-stats/lists"}