{"id":17402742,"url":"https://github.com/dammak/github_kit","last_synced_at":"2026-04-18T17:03:30.697Z","repository":{"id":257828424,"uuid":"872365266","full_name":"DAMMAK/github_kit","owner":"DAMMAK","description":"GitHubKit is a comprehensive Dart package for interacting with the GitHub API. ","archived":false,"fork":false,"pushed_at":"2024-10-16T09:25:58.000Z","size":49,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-23T01:36:23.525Z","etag":null,"topics":["dart-package","flutter-package","github","github-action","github-actions","github-api","octocat"],"latest_commit_sha":null,"homepage":"","language":"Dart","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/DAMMAK.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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}},"created_at":"2024-10-14T10:06:24.000Z","updated_at":"2024-10-16T09:26:02.000Z","dependencies_parsed_at":null,"dependency_job_id":"2fee89a4-fd6e-465a-aaf4-22b2b511f0b3","html_url":"https://github.com/DAMMAK/github_kit","commit_stats":{"total_commits":13,"total_committers":1,"mean_commits":13.0,"dds":0.0,"last_synced_commit":"b18ca3b43fc2f0f841e7989e9e5e85ff4c2b814e"},"previous_names":["dammak/github_kit"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DAMMAK%2Fgithub_kit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DAMMAK%2Fgithub_kit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DAMMAK%2Fgithub_kit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DAMMAK%2Fgithub_kit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DAMMAK","download_url":"https://codeload.github.com/DAMMAK/github_kit/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245934961,"owners_count":20696551,"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","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":["dart-package","flutter-package","github","github-action","github-actions","github-api","octocat"],"created_at":"2024-10-16T18:08:22.770Z","updated_at":"2026-04-18T17:03:30.645Z","avatar_url":"https://github.com/DAMMAK.png","language":"Dart","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHubKit\n\n[![GitHub License][license-badge]][license-link]\n[![PRs Welcome][prs-badge]][prs-link]\n[![Watch on GitHub][github-watch-badge]][github-watch-link]\n[![Star on GitHub][github-star-badge]][github-star-link]\n[![Watch on GitHub][github-forks-badge]][github-forks-link]\n\n[license-badge]: https://img.shields.io/github/license/DAMMAK/github_kit.svg?style=for-the-badge\n[license-link]: https://github.com/DAMMAK/github_kit/blob/master/LICENSE\n[prs-badge]: https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=for-the-badge\n[prs-link]: https://github.com/DAMMAK/github_kit/issues\n\n[github-watch-badge]: https://img.shields.io/github/watchers/DAMMAK/github_kit.svg?style=for-the-badge\u0026logo=github\u0026logoColor=ffffff\n[github-watch-link]: https://github.com/DAMMAK/github_kit/watchers\n[github-star-badge]: https://img.shields.io/github/stars/DAMMAK/github_kit.svg?style=for-the-badge\u0026logo=github\u0026logoColor=ffffff\n[github-star-link]: https://github.com/DAMMAK/github_kit/stargazers\n[github-forks-badge]: https://img.shields.io/github/forks/DAMMAK/github_kit.svg?style=for-the-badge\u0026logo=github\u0026logoColor=ffffff\n[github-forks-link]: https://github.com/DAMMAK/github_kit/network/members\n\n\nGitHubKit is a comprehensive Dart package for interacting with the GitHub API. It provides an easy-to-use interface for common GitHub operations and supports advanced features like GitHub Actions, code scanning, and secret scanning.\n\n## Table of Contents\n\n- [Features](#features)\n- [Installation](#installation)\n- [Usage](#usage)\n  - [Initialization](#initialization)\n  - [Repositories](#repositories)\n  - [Issues](#issues)\n  - [Pull Requests](#pull-requests)\n  - [GitHub Actions](#github-actions)\n  - [Code Scanning](#code-scanning)\n  - [Secret Scanning](#secret-scanning)\n  - [GraphQL API](#graphql-api)\n- [Error Handling](#error-handling)\n- [Pagination](#pagination)\n- [Rate Limiting](#rate-limiting)\n- [Logging](#logging)\n- [Testing](#testing)\n- [Examples](#examples)\n- [Contributing](#contributing)\n- [License](#license)\n\n## Features\n\n- Complete coverage of GitHub REST API v3\n- Support for GitHub GraphQL API v4\n- Repositories management\n- Issues and Pull Requests handling\n- GitHub Actions workflow management\n- Code scanning and Secret scanning APIs\n- Automatic pagination handling\n- Built-in rate limit handling and automatic retries\n- Comprehensive logging system\n- Easy error handling with custom exceptions\n- Full support for authentication (Personal Access Tokens)\n- Extensive documentation and examples\n\n## Installation\n\nAdd this to your package's `pubspec.yaml` file:\n\n```yaml\ndependencies:\n  github_kit: ^1.0.0\n```\n\nThen run:\n\n```\n$ dart pub get\n```\n\n## Usage\n\n### Initialization\n\nFirst, import the package and create an instance of `GitHubKit`:\n\n```dart\nimport 'package:github_kit/github_kit.dart';\n\nfinal gitHubKit = GitHubKit(token: 'your_personal_access_token');\n```\n\n### Repositories\n\n```dart\n// Get a repository\nfinal repo = await gitHubKit.repositories.getRepository('octocat', 'Hello-World');\nprint('Repository: ${repo.fullName}');\n\n// Create a repository\nfinal newRepo = await gitHubKit.repositories.createRepository('New-Repo', private: true);\nprint('Created new repository: ${newRepo.fullName}');\n\n// List repositories\nfinal repos = await gitHubKit.repositories.listRepositories('octocat');\nfor (var repo in repos) {\nprint('Repo: ${repo.name}');\n}\n```\n\n### Issues\n\n```dart\n// Create an issue\nfinal issue = await gitHubKit.issues.createIssue('octocat', 'Hello-World', 'Bug report', body: 'This is a bug report');\nprint('Created issue #${issue.number}');\n\n// Get an issue\nfinal fetchedIssue = await gitHubKit.issues.getIssue('octocat', 'Hello-World', 1);\nprint('Issue title: ${fetchedIssue.title}');\n\n// List issues\nfinal issues = await gitHubKit.issues.listIssues('octocat', 'Hello-World', state: 'open');\nfor (var issue in issues) {\nprint('Issue #${issue.number}: ${issue.title}');\n}\n```\n\n### Pull Requests\n\n```dart\n// Create a pull request\nfinal pr = await gitHubKit.pullRequests.createPullRequest('octocat', 'Hello-World', 'New feature', 'feature-branch', 'main');\nprint('Created PR #${pr.number}');\n\n// Get a pull request\nfinal fetchedPR = await gitHubKit.pullRequests.getPullRequest('octocat', 'Hello-World', 1);\nprint('PR title: ${fetchedPR.title}');\n\n// List pull requests\nfinal prs = await gitHubKit.pullRequests.listPullRequests('octocat', 'Hello-World', state: 'open');\nfor (var pr in prs) {\nprint('PR #${pr.number}: ${pr.title}');\n}\n```\n\n### GitHub Actions\n\n```dart\n// List workflows\nfinal workflows = await gitHubKit.actions.listWorkflows('octocat', 'Hello-World');\nfor (var workflow in workflows) {\nprint('Workflow: ${workflow.name}');\n}\n\n// Create a workflow dispatch event\nawait gitHubKit.actions.createWorkflowDispatch('octocat', 'Hello-World', 'main.yml', 'main');\nprint('Workflow dispatch created');\n```\n\n### Code Scanning\n\n```dart\n// List code scanning alerts\nfinal alerts = await gitHubKit.codeScanning.listCodeScanningAlerts('octocat', 'Hello-World');\nfor (var alert in alerts) {\nprint('Alert #${alert.number}: ${alert.state}');\n}\n```\n\n### Secret Scanning\n\n```dart\n// List secret scanning alerts\nfinal secretAlerts = await gitHubKit.secretScanning.listSecretScanningAlerts('octocat', 'Hello-World');\nfor (var alert in secretAlerts) {\nprint('Secret Alert #${alert.number}: ${alert.state}');\n}\n```\n\n### GraphQL API\n\n```dart\nfinal result = await gitHubKit.graphql('''\n  query {\n    viewer {\n      login\n      repositories(first: 10) {\n        nodes {\n          name\n          stargazerCount\n        }\n      }\n    }\n  }\n''');\nprint('Logged in as: ${result['viewer']['login']}');\n```\n\n## Error Handling\n\nGitHubKit uses custom exceptions for error handling. Always wrap your API calls in a try-catch block:\n\n```dart\ntry {\nfinal repo = await gitHubKit.repositories.getRepository('octocat', 'Hello-World');\nprint('Repository: ${repo.fullName}');\n} catch (e) {\nif (e is GitHubException) {\nprint('GitHub API Error: ${e.message} (Status: ${e.statusCode})');\n} else {\nprint('Error: $e');\n}\n}\n```\n\n## Pagination\n\nMost list methods in GitHubKit handle pagination automatically. You can control pagination using the `perPage` and `page` parameters:\n\n```dart\nfinal repos = await gitHubKit.repositories.listRepositories('octocat', perPage: 100, page: 2);\n```\n\n## Rate Limiting\n\nGitHubKit automatically handles rate limiting by retrying requests when limits are hit. You can configure retry behavior when creating the GitHubKit instance:\n\n```dart\nfinal gitHubKit = GitHubKit(\n  token: 'your_token',\n  maxRetries: 5,\n  retryDelay: Duration(seconds: 10),\n);\n```\n\n## Logging\n\nGitHubKit includes a built-in logging system. You can configure logging when creating the GitHubKit instance:\n\n```dart\nfinal gitHubKit = GitHubKit(token: 'your_token');\ngitHubKit.setLogLevel(LogLevel.debug);\n```\n\n## Testing\n\nTo run the tests for GitHubKit:\n\n```\n$ dart test\n```\n\n## Examples\n\nFor more examples, check the `example` folder in the repository.\n\n## Contributing\n\nContributions are welcome! Please read our [Contributing Guide](CONTRIBUTING.md) for more information.\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%2Fdammak%2Fgithub_kit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdammak%2Fgithub_kit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdammak%2Fgithub_kit/lists"}