{"id":31760545,"url":"https://github.com/managedkaos/list-github-repos","last_synced_at":"2025-10-09T21:32:41.604Z","repository":{"id":308218766,"uuid":"1032033844","full_name":"managedkaos/list-github-repos","owner":"managedkaos","description":"A tool for listing a GitHub user's public repositories along with their description.","archived":false,"fork":false,"pushed_at":"2025-08-04T20:30:00.000Z","size":24,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-09-11T08:45:53.337Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/managedkaos.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}},"created_at":"2025-08-04T17:45:23.000Z","updated_at":"2025-08-04T20:30:03.000Z","dependencies_parsed_at":"2025-08-04T21:39:54.936Z","dependency_job_id":"cbccec29-f4a3-413d-aaa7-76f4ef4658bc","html_url":"https://github.com/managedkaos/list-github-repos","commit_stats":null,"previous_names":["managedkaos/list-github-repos"],"tags_count":0,"template":false,"template_full_name":"managedkaos/python-container-template","purl":"pkg:github/managedkaos/list-github-repos","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/managedkaos%2Flist-github-repos","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/managedkaos%2Flist-github-repos/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/managedkaos%2Flist-github-repos/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/managedkaos%2Flist-github-repos/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/managedkaos","download_url":"https://codeload.github.com/managedkaos/list-github-repos/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/managedkaos%2Flist-github-repos/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279002057,"owners_count":26083286,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-10-09T02:00:07.460Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":"2025-10-09T21:30:29.778Z","updated_at":"2025-10-09T21:32:41.594Z","avatar_url":"https://github.com/managedkaos.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Repository Lister CLI\n\nA command-line tool to retrieve and display GitHub user repositories using the GitHub API.\n\n## Features\n\n- Fetch repositories for any GitHub username\n- **Automatic pagination** - retrieves all repositories\n- **Pagination controls** - limit pages, repositories per page, and total repositories\n- Multiple output formats (default, detailed, JSON, compact)\n- Rate limit handling with and without authentication\n- Docker container support\n- Comprehensive error handling\n- **Progress reporting** - shows pagination progress to stderr\n\n## Installation\n\n### Local Development\n\n1. Install Python dependencies:\n\n   ```bash\n   pip install -r requirements.txt\n   ```\n\n2. (Optional) Set up development environment:\n\n   ```bash\n   make development-requirements\n   make pre-commit-install\n   ```\n\n### Docker\n\nBuild and run the Docker container:\n\n```bash\n# Build the image\ndocker build -t github-repo-lister .\n\n# Run with a username\ndocker run github-repo-lister octocat\n```\n\n## Usage\n\n### Basic Usage\n\n```bash\n# List repositories for a user (default format)\npython main.py octocat\n\n# List repositories with detailed output\npython main.py octocat --format detailed\n\n# Output as JSON\npython main.py octocat --format json\n\n# Compact output format\npython main.py octocat --format compact\n```\n\n### Pagination Controls\n\n```bash\n# Limit total number of repositories\npython main.py octocat --limit 10\n\n# Limit number of pages to retrieve\npython main.py octocat --pages 2\n\n# Set repositories per page (1-100)\npython main.py octocat --repos-per-page 50\n\n# Combine multiple controls\npython main.py octocat --pages 2 --repos-per-page 25 --limit 30\n```\n\n### Authentication\n\nFor higher rate limits, set the `GITHUB_TOKEN` environment variable:\n\n```bash\nexport GITHUB_TOKEN=your_github_token_here\npython main.py octocat\n```\n\nOr use with Docker:\n\n```bash\ndocker run -e GITHUB_TOKEN=your_github_token_here github-repo-lister octocat\n```\n\n### Skip Token Usage\n\nTo force running without a token (useful for testing):\n\n```bash\npython main.py octocat --no-token\n```\n\n## Command Line Options\n\n| Option | Short | Description |\n|--------|-------|-------------|\n| `--repos-per-page` | `-r` | Number of repositories per page (1-100, default: 100) |\n| `--pages` | `-p` | Maximum number of pages to retrieve (default: no limit) |\n| `--limit` | `-l` | Maximum total repositories to retrieve (default: no limit) |\n| `--format` | | Output format: default, detailed, json, compact |\n| `--no-token` | | Skip using GITHUB_TOKEN environment variable |\n\n## Output Formats\n\n### Default Format\n\n```\n- repo-name: Repository description\n```\n\n### Detailed Format\n\n```\nName: repo-name\nDescription: Repository description\nURL: https://github.com/user/repo-name\nPrivate: False\nFork: False\nStars: 10\nWatchers: 5\nSize: 100 KB\nVisibility: public\nLast Updated: 2023-01-01T00:00:00Z\nTopics: python, cli\n==================================================\n```\n\n### JSON Format\n\nComplete repository data in JSON format (same as GitHub API response).\n\n### Compact Format\n\n```\n- repo-name | Repository description | 10 stars\n```\n\n## Progress Reporting\n\nThe application shows pagination progress to stderr:\n\n```\nFetching page 1...\nRetrieved 100 repositories from page 1\nFetching page 2...\nRetrieved 50 repositories from page 2\nReached repository limit (150)\nTotal repositories fetched: 150\n```\n\nThis allows you to see the progress while the application fetches repositories, especially useful for users with many repositories.\n\n## Error Handling\n\nThe application handles various error scenarios:\n\n- **Rate Limit Exceeded**: When GitHub API rate limit is reached\n- **Network Errors**: Connection issues or timeouts\n- **API Errors**: Invalid usernames or other API issues\n- **Missing Token**: Graceful degradation when no token is provided\n- **Invalid Parameters**: Validates pagination control parameters\n\n## Development\n\n### Running Tests\n\n```bash\npython -m pytest test_main.py\n```\n\n### Code Quality\n\nThe project includes pre-commit hooks for code quality:\n\n```bash\n# Install pre-commit hooks\nmake pre-commit-install\n\n# Run pre-commit on all files\nmake pre-commit-run\n\n# Format code\nmake fmt\n\n# Run linting\nmake lint\n```\n\n## API Reference\n\nThe application uses the GitHub REST API v3:\n\n- **Endpoint**: `https://api.github.com/users/{username}/repos`\n- **Authentication**: Bearer token (optional)\n- **Pagination**: Automatically handles all pages (configurable repos per page)\n- **Rate Limits**:\n  - 60 requests/hour (unauthenticated)\n  - 5000 requests/hour (authenticated)\n\n## License\n\nThis project is licensed under the MIT License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanagedkaos%2Flist-github-repos","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmanagedkaos%2Flist-github-repos","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmanagedkaos%2Flist-github-repos/lists"}