{"id":15107144,"url":"https://github.com/rednafi/fork-sweeper","last_synced_at":"2025-09-17T09:31:18.080Z","repository":{"id":225907987,"uuid":"766339024","full_name":"rednafi/fork-sweeper","owner":"rednafi","description":"Remove unused GitHub forks","archived":false,"fork":false,"pushed_at":"2025-09-08T05:09:36.000Z","size":38,"stargazers_count":23,"open_issues_count":3,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-08T07:08:00.824Z","etag":null,"topics":["cli","delete-forks","forks","github","github-api","go","golang","remove-forks"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rednafi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-03-03T01:28:07.000Z","updated_at":"2025-09-08T05:09:33.000Z","dependencies_parsed_at":"2024-03-08T04:26:56.707Z","dependency_job_id":"327e23e2-b583-46c8-8446-8c9c7ce53a3c","html_url":"https://github.com/rednafi/fork-sweeper","commit_stats":null,"previous_names":["rednafi/fork-sweeper"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/rednafi/fork-sweeper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rednafi%2Ffork-sweeper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rednafi%2Ffork-sweeper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rednafi%2Ffork-sweeper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rednafi%2Ffork-sweeper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rednafi","download_url":"https://codeload.github.com/rednafi/fork-sweeper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rednafi%2Ffork-sweeper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274249923,"owners_count":25249391,"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-09-09T02:00:10.223Z","response_time":80,"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":["cli","delete-forks","forks","github","github-api","go","golang","remove-forks"],"created_at":"2024-09-25T21:04:45.324Z","updated_at":"2025-09-17T09:31:17.831Z","avatar_url":"https://github.com/rednafi.png","language":"Go","readme":"\u003cdiv align=\"center\"\u003e\n\u003cpre align=\"center\"\u003e\n\u003ch1 align=\"center\"\u003e\nfork\nsweeper\n|\n\\|/\n-|-\n// \\\\\n/// \\\\\\\n//// \\\\\\\\\n\u003c/h1\u003e\n\u003ch4 align=\"center\"\u003e\nRemove unused GitHub forks\n\u003c/h4\u003e\n\u003c/pre\u003e\n\u003c/div\u003e\n\n## Installation\n\n-   On macOS, brew install:\n\n    ```sh\n    brew tap rednafi/fork-sweeper https://github.com/rednafi/fork-sweeper \\\n        \u0026\u0026 brew install fork-sweeper\n    ```\n\n-   Elsewhere, go install:\n\n    ```sh\n    go install github.com/rednafi/fork-sweeper/cmd/fork-sweeper\n    ```\n\n## Prerequisites\n\n-   Collect your GitHub API [access token]. The token will be sent as `Bearer \u003ctoken\u003e` in\n    the HTTP header while making API requests.\n-   The token must have write and delete access to the forked repos.\n-   Set the `GITHUB_TOKEN` to your current shell environment with\n    `export GITHUB_TOKEN=\u003ctoken\u003e` command.\n\n## Usage\n\n-   Run help:\n\n    ```sh\n    fork-sweeper -h\n    ```\n\n    ```txt\n    Usage of fork-sweeper:\n      -delete\n            Delete forked repos\n      -guard value\n            List of repos to protect from deletion (fuzzy match name)\n      -max-page int\n            Maximum number of pages to fetch (default 100)\n      -older-than-days int\n            Fetch forked repos modified more than n days ago (default 60)\n      -owner string\n            GitHub repo owner (required)\n      -per-page int\n            Number of forked repos fetched per page (default 100)\n      -token string\n            GitHub access token (required)\n      -version\n            Print version\n    ```\n\n-   List forked repos older than `n` days. By default, it'll fetch all forked repositories\n    that were modified at least 60 days ago. The following command lists all forked\n    repositories.\n\n    ```sh\n    fork-sweeper --owner rednafi --token $GITHUB_TOKEN --older-than-days 0\n    ```\n\n    This returns:\n\n    ```txt\n    Fetching forked repositories for rednafi...\n\n    Guarded forked repos [won't be deleted]:\n\n    Unguarded forked repos [will be deleted]:\n        - https://github.com/rednafi/cpython\n        - https://github.com/rednafi/dysconfig\n        - https://github.com/rednafi/pydantic\n    ```\n\n-   The CLI won't delete any repository unless you explicitly tell it to do so with the\n    `--delete` flag:\n\n    ```sh\n    fork-sweeper --owner rednafi --token $GITHUB_TOKEN --delete\n    ```\n\n-   You can explicitly protect some repositories from deletion with the `--guard` parameter:\n\n    ```sh\n    fork-sweeper --owner \"rednafi\" --token $GITHUB_TOKEN --older-than-days 0 --guard 'py'\n    ```\n\n    This prints:\n\n    ```txt\n    Fetching forked repositories for rednafi...\n\n    Guarded forked repos [won't be deleted]:\n        - https://github.com/rednafi/cpython\n        - https://github.com/rednafi/pydantic\n\n    Unguarded forked repos [will be deleted]:\n        - https://github.com/rednafi/dysconfig\n    ```\n\n    The `--guard` parameter can be passed multiple times to filter out multiple repos.\n\n-   By default, the CLI will fetch 100 pages of forked repositories with 100 entries on each\n    page. If you need more, you can set the page number as follows:\n\n    ```sh\n    fork-sweeper --owner rednafi --token $GITHUB_TOKEN --max-page 200 --per-page 100\n    ```\n\n[access token]:\n    https://docs.github.com/en/rest/authentication/authenticating-to-the-rest-api?apiVersion=2022-11-28\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frednafi%2Ffork-sweeper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frednafi%2Ffork-sweeper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frednafi%2Ffork-sweeper/lists"}