{"id":38851726,"url":"https://github.com/amirashad/ghctl","last_synced_at":"2026-02-03T12:11:06.177Z","repository":{"id":53135355,"uuid":"211876839","full_name":"amirashad/ghctl","owner":"amirashad","description":"GitHub CLI management tool","archived":false,"fork":false,"pushed_at":"2023-03-07T00:38:11.000Z","size":1071,"stargazers_count":14,"open_issues_count":13,"forks_count":3,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-12-25T12:49:41.005Z","etag":null,"topics":["automation","cli","devops-tools","github","github-management","golang","portable","repository"],"latest_commit_sha":null,"homepage":"","language":"Go","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/amirashad.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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}},"created_at":"2019-09-30T14:17:01.000Z","updated_at":"2025-11-22T11:13:02.000Z","dependencies_parsed_at":"2024-06-19T04:12:25.652Z","dependency_job_id":"b139aebe-cbc4-4d5a-be33-a3294ba816e0","html_url":"https://github.com/amirashad/ghctl","commit_stats":{"total_commits":51,"total_committers":4,"mean_commits":12.75,"dds":"0.17647058823529416","last_synced_commit":"4782c0c40239b82cba54dbae3e596c4425f4b21c"},"previous_names":[],"tags_count":43,"template":false,"template_full_name":null,"purl":"pkg:github/amirashad/ghctl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amirashad%2Fghctl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amirashad%2Fghctl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amirashad%2Fghctl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amirashad%2Fghctl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/amirashad","download_url":"https://codeload.github.com/amirashad/ghctl/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/amirashad%2Fghctl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28509940,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-17T13:38:16.342Z","status":"ssl_error","status_checked_at":"2026-01-17T13:37:44.060Z","response_time":85,"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":["automation","cli","devops-tools","github","github-management","golang","portable","repository"],"created_at":"2026-01-17T14:12:57.088Z","updated_at":"2026-02-03T12:11:06.161Z","avatar_url":"https://github.com/amirashad.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ghctl\n[![GitHub release](http://img.shields.io/github/release/amirashad/ghctl.svg?style=flat)](https://github.com/amirashad/ghctl/releases)\n[![CII Best Practices](https://bestpractices.coreinfrastructure.org/projects/3272/badge)](https://bestpractices.coreinfrastructure.org/projects/3272)\n[![CircleCI](https://circleci.com/gh/amirashad/ghctl.svg?style=shield)](https://circleci.com/gh/amirashad/ghctl)\n[![SonarCloud Status](https://sonarcloud.io/api/project_badges/measure?project=amirashad_ghctl\u0026metric=alert_status)](https://sonarcloud.io/dashboard?id=amirashad_ghctl)\n[![Docker Hub](https://img.shields.io/badge/docker-ready-blue.svg)](https://hub.docker.com/r/amirashad/ghctl/)\n\u003c!-- [![Known Vulnerabilities](https://snyk.io/test/github/amirashad/ghctl/badge.svg)](https://snyk.io/test/github/amirashad/ghctl) --\u003e\n\na lightweight and portable command-line GitHub repository management tool\n\nThe aim of the project is to be automatize the creation of repositories with yaml files.\n\n## Why ghctl is needed?\n\nGitHub is a great version control system. For creating repositories with branch protection, adding some mandatory reviewers to repo is tedious. Additionally if your organisation works with microservices or serverless architecture, it means that every day you will create repo. \n\nTo automatize this kind of issues ghctl will help you apply your yaml configuration of repo and create repo with some pipeline. \n\n**`ghctl`** helps you create repository from command-line:\n![ghctl demo GIF](img/ghctl-demo.gif)\n\n## Installation\n\nYou can download the binary built for your architecture from [the latest release](https://github.com/amirashad/ghctl/releases/latest). \n\n\u003cdetails open\u003e\u003csummary\u003e\u003cstrong\u003emacOS\u003c/strong\u003e\u003c/summary\u003e\u003cp\u003e\n\nThe following is an example of installation on macOS:\n\n```console\n$ curl https://github.com/amirashad/ghctl/releases/download/v0.6.4/ghctl_darwin_amd64 -L -o /usr/local/bin/ghctl\n$ chmod +x /usr/local/bin/ghctl\n```\n\n\u003c/p\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e\u003cstrong\u003eLinux\u003c/strong\u003e\u003c/summary\u003e\u003cp\u003e\n\nFor Linux based OS, you can use following oneliner to download latest binary for AMD64 architecture.\n```console\n$ curl -L \"$(curl -Ls https://api.github.com/repos/amirashad/ghctl/releases/latest | grep -o -E \"https://.+?_linux_amd64\")\" -o /usr/local/bin/ghctl \u0026\u0026 chmod +x /usr/local/bin/ghctl \n```\n\n\u003c/p\u003e\u003c/details\u003e\n\n\u003cdetails\u003e\u003csummary\u003e\u003cstrong\u003eWindows\u003c/strong\u003e\u003c/summary\u003e\u003cp\u003e\n\nFor Windows OS, you can use following PowerShell command to download binary for AMD64 architecture.\n```\nInvoke-WebRequest https://github.com/amirashad/ghctl/releases/download/v0.6.4/ghctl_windows_amd64.exe -O ghctl.exe\n```\n\n\u003c/p\u003e\u003c/details\u003e\n\n### Docker\n\nYou can also use [ghctl via Docker](https://hub.docker.com/r/amirashad/ghctl/).\n\n```console\n$ docker run --rm -v $(pwd):/data -t amirashad/ghctl\n```\n\nYou can use this image to automatize repo creation with CI/CD tools like Travis CI, CircleCI, GitHub Actions. `curl` and `yq` was preinstalled to image. \n\n## Features\n\n - Apply with yaml file or with cli args\n - Create repository\n - Create branch on repository\n - Create protection on branch\n - Add mandatory reviewers to branch protection\n - Add required checks to branch protection\n - Add some files to repository, branch\n - Get repositories of organisation as yaml or json\n - Get repository by name as yaml or json\n - Get members of organisation as yaml or json\n - Get teams of organisation as yaml or json\n\n## Limitations\n\nghctl currently only manages repositories.\n\n## Usage\n\n1) ghctl to work properly should set environment variable `GITHUB_TOKEN`, `GITHUB_ORG` and `GITHUB_HOST` or specify as command-line argument `--token` and `--org` appropriately.\n\nTo get more help:\n```\n$ ghctl --help\nUsage: ghctl [OPTIONS] [COMMANDS] [FILE]\n\nOPTIONS:\n      --token                                   GitHub token\n      --org                                     GitHub organisation\n      --enterpriseurl                           Github Enterprise URL\n      --version                                 Display version and exit\n      --enterprise,                             Is GitHub Enterprise (default: false)\n  -o, --outputformat=[normal|json|yaml]         Output format (default: normal)\n  -v, --verbose,                                Show debug output (default: false)\n  -h, --help,                                   Display this help and exit\n\nCOMMANDS:\n  get\n    repos\n    members\n    teams\n  create\n    repo\n    branch\n    protection\n  add\n    file\n    collaborator\n    team\n  update\n    repo\n    branch\n    protection\n  apply\n```\n\n2) Create yaml file with needed configurations. For example, create repo.yml with following content\n\n```yaml\ngithub:\n  repo:\n    name: \u003c\u003c Repository name \u003e\u003e\n    description: \u003c\u003c Repository description \u003e\u003e\n    homepage: \n    private: false\n    defaultBranch: develop\n    onCreate:\n      autoInit: true\n      gitignore: Java\n      license: null\n    pages:\n      issues: true\n      projects: true\n      wiki: true\n    merge:\n      allowMergeCommit: true\n      allowSquashMerge: true\n      allowRebaseMerge: true\n    teams:\n      team-developers: push\n      team-admins: admin\n    branches:\n    - name: develop\n      minApprove: 2\n      codeOwners: true\n      includeAdmins: true\n      requiredStatusChecks:\n        requiredBranchesUpToDate: true\n        contexts:\n        - 'ci/circleci: validate_code'\n        - 'ci/circleci: validate_infra'\n      push:\n        users:\n        - \u003c\u003c Github username which has access to push to this branch \u003e\u003e\n        teams: []\n    - name: master\n      minApprove: 1\n      codeOwners: true\n      includeAdmins: true\n      requiredStatusChecks:\n        requiredBranchesUpToDate: true\n        contexts:\n        - 'ci/circleci: validate_code'\n        - 'ci/circleci: validate_infra'\n        - 'ci/circleci: security_checks'\n      push:\n        users:\n        - \u003c\u003c Github username which has access to push to this branch \u003e\u003e\n        teams: []\n```\n\n3) Apply script\n```console\n$ ghctl apply -f repo.yml\n```\n\n## Examples\n\n - [CircleCI example for automation of repo creation](examples/)\n\n\u003c!-- See [User guide](docs/guides) for each option. --\u003e\n\n## Exit Statuses\n\nghctl returns the following exit statuses on exit:\n\n- 0: No issues found\n- 1: Errors occurred\n\n## FAQ\n### Does ghctl create projects?\n- No. ghctl not yet supports project creation.\n\n### How to use `ghctl` with GitHub Enterprise?\n- Set the environment variable ENTERPRISE_URL or pass it directly using the --enterpriseurl flag, along with the --enterprise flag to enable Enterprise mode.\n```console\n$ ghctl create repo --name my-repo --enterprise\n```\n\n## Debugging\n\nIf you don't get the expected behavior, you can see the detailed logs when running with `--verbose` flag.\n\n```console\n$ ghctl create repo --name my-repo --verbose\n```\n\n\u003c!-- \n## Developing\n\nSee [Developer guide](docs/DEVELOPING.md). \n--\u003e","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famirashad%2Fghctl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Famirashad%2Fghctl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Famirashad%2Fghctl/lists"}