{"id":15445222,"url":"https://github.com/jhermann/gh-commander","last_synced_at":"2025-07-04T11:32:39.513Z","repository":{"id":28707594,"uuid":"32228151","full_name":"jhermann/gh-commander","owner":"jhermann","description":":wrench: :octocat: GitHub Commander is a tool to access the GitHub APIv3 from the CLI and automate otherwise tedious tasks.","archived":false,"fork":false,"pushed_at":"2024-12-16T22:47:27.000Z","size":193,"stargazers_count":15,"open_issues_count":8,"forks_count":2,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-05-23T23:05:17.612Z","etag":null,"topics":["cli-utilities","github","github-api","productivity"],"latest_commit_sha":null,"homepage":"http://jhermann.github.io/gh-commander","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jhermann.png","metadata":{"files":{"readme":"README.md","changelog":null,"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,"zenodo":null}},"created_at":"2015-03-14T19:25:46.000Z","updated_at":"2023-12-05T15:06:13.000Z","dependencies_parsed_at":"2025-04-20T15:15:30.415Z","dependency_job_id":null,"html_url":"https://github.com/jhermann/gh-commander","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/jhermann/gh-commander","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhermann%2Fgh-commander","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhermann%2Fgh-commander/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhermann%2Fgh-commander/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhermann%2Fgh-commander/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jhermann","download_url":"https://codeload.github.com/jhermann/gh-commander/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jhermann%2Fgh-commander/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262035371,"owners_count":23248367,"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":["cli-utilities","github","github-api","productivity"],"created_at":"2024-10-01T19:44:21.451Z","updated_at":"2025-07-04T11:32:39.466Z","avatar_url":"https://github.com/jhermann.png","language":"Python","readme":"# gh-commander\n\n![logo](https://raw.githubusercontent.com/jhermann/gh-commander/master/docs/_static/logo-64.png) | *GitHub Commander* is a tool to access the [GitHub API v3](https://developer.github.com/v3/) from the CLI and automate otherwise tedious tasks.\n:----: | :----\n**Project** | [![Groups](https://img.shields.io/badge/Google_groups-gh--commander-orange.svg)](https://groups.google.com/forum/#!forum/gh-commander) [![License](https://img.shields.io/pypi/l/gh-commander.svg)](https://github.com/jhermann/gh-commander/blob/master/LICENSE)\n**QA** | [![Travis CI](https://api.travis-ci.org/jhermann/gh-commander.svg)](https://travis-ci.org/jhermann/gh-commander) [![Coveralls](https://img.shields.io/coveralls/jhermann/gh-commander.svg)](https://coveralls.io/r/jhermann/gh-commander) [![GitHub Issues](https://img.shields.io/github/issues/jhermann/gh-commander.svg)](https://github.com/jhermann/gh-commander/issues)\n**Release** | [![Latest Version](https://img.shields.io/pypi/v/gh-commander.svg)](https://pypi.python.org/pypi/gh-commander/) [![Download format](https://img.shields.io/pypi/format/gh-commander.svg)](https://pypi.python.org/pypi/gh-commander/)\n\n\n## Overview\n\n*GitHub Commander* implements the ``gh`` command line tool,\nwhich provides a ‘fluent’ interface\nusing [click](https://github.com/mitsuhiko/click)\n(see [Usage](#usage) below).\nIt allows to access the\n[GitHub API v3](https://developer.github.com/v3/)\nfrom a shell prompt for things usually done in the browser,\nand also automates tasks that otherwise are tedious at best,\nwhen done by clicking around on a web page.\n*GitHub Commander* is powered by [github3.py](https://github.com/sigmavirus24/github3.py).\n\n:information_source: | Initially, the focus of the project will be to provide task automation, not completeness of covering every API aspect!\n---- | :----\n\n\n## Examples\n\nTo give you a quick impression of what this tool can do for you, here are some example calls:\n\n```sh\n$ gh user show foo\nACCOUNT     Maciek Pacut [foo / User #33384]\nSINCE/LAST  2008-11-08T18:01:02Z / 2015-03-30T21:35:31Z\nURL         https://api.github.com/users/foo\nEMAIL       maciek.pacut@gmail.com\nREPOS/GISTS 14 ☑ ⎇  / -1 ☒ ⎇  / 0 ☑ ✍ / -1 ☒ ✍\nSTATS       ⇦ ⋮ 1 / ⇨ ⋮ 0 / -1 ◔\n\n$ gh label ls foo/ii\n⎇   foo/ii\n┌─────────────┬─────────┐\n│ Name        │ Color   │\n├─────────────┼─────────┤\n│ maciekpacut │ #000000 │\n└─────────────┴─────────┘\n\n$ gh label export --format yaml jhermann/gh-commander to -\n- {Color: '#fc2929', Name: bug}\n- {Color: '#cccccc', Name: duplicate}\n- {Color: '#84b6eb', Name: enhancement}\n- {Color: '#159818', Name: help wanted}\n- {Color: '#ededed', Name: in progress}\n- {Color: '#e6e6e6', Name: invalid}\n- {Color: '#cc317c', Name: question}\n- {Color: '#ededed', Name: ready}\n- {Color: '#ffffff', Name: wontfix}\n\n$ gh label export waif rituals to labels.xls\n```\n\n![labels.xls](https://raw.githubusercontent.com/jhermann/gh-commander/master/docs/_static/label_export_excel.png)\n\n\n## A Practical Use-Case\n\nThe following shows how to ease the management of a bunch of projects,\nvia an [Invoke](http://www.pyinvoke.org/) task that synchronizes labels\nacross a set of projects from a\n[master definition](https://github.com/jhermann/gh-commander/blob/master/examples/labels.yaml).\n\n```py\nimport os\nimport tempfile\n\nimport requests\nfrom invoke import ctask as task\n\nPROJECTS = \"\"\"\n    my/project\n    my/other-project\n\"\"\"\nPROJECTS = [i.strip() for i in PROJECTS.splitlines() if i]\nLABEL_MASTER_URL = 'https://raw.githubusercontent.com/jhermann/gh-commander/master/examples/labels.yaml'\n\n\n@task(name='sync-labels')\ndef sync_labels(ctx):\n    \"\"\"Sync labels into managed projects.\"\"\"\n    labels_yaml = requests.get(LABEL_MASTER_URL).text\n    with tempfile.NamedTemporaryFile(suffix='.yaml', prefix='gh-label-sync-', delete=False) as handle:\n        handle.write(labels_yaml)\n\n    try:\n        ctx.run('gh label import {} from {}'.format(' '.join(PROJECTS), handle.name))\n    finally:\n        os.remove(handle.name)\n```\n\nSee this [tasks.py](https://github.com/jhermann/Stack-O-Waffles/blob/master/tasks.py) for the real-world application.\n\n\n## Installation\n\n*GitHub Commander* can be installed via ``pip install gh-commander`` as usual,\nsee [releases](https://github.com/jhermann/gh-commander/releases) for an overview of available versions.\nTo get a bleeding-edge version from source, use these commands:\n\n```sh\nrepo=\"jhermann/gh-commander\"\npip install -r \"https://raw.githubusercontent.com/$repo/master/requirements.txt\"\npip install -UI -e \"git+https://github.com/$repo.git#egg=${repo#*/}\"\n```\n\nSee [Contributing](#contributing) on how to create a full development environment.\n\nTo add bash completion, read the [Click docs](http://click.pocoo.org/4/bashcomplete/#activation) about it,\nor just follow these instructions:\n\n```sh\ncmdname=gh\nmkdir -p ~/.bash_completion.d\n( export _$(tr a-z A-Z \u003c\u003c\u003c\"$cmdname\")_COMPLETE=source ; \\\n  $cmdname \u003e~/.bash_completion.d/$cmdname.sh )\ngrep /.bash_completion.d/$cmdname.sh ~/.bash_completion \u003e/dev/null \\\n    || echo \u003e\u003e~/.bash_completion \". ~/.bash_completion.d/$cmdname.sh\"\n. \"/etc/bash_completion\"\n```\n\n\n## Configuration\n\n### Login Credentials\nBefore you can use *GitHub Commander*, you have to provide some minimal configuration,\nmost importantly credentials for API access. The recommended way for doing so is this:\n\n 1. In the [Settings › Applications](https://github.com/settings/applications) of your GitHub account,\n    press the “Generate new token” button of the “Personal access tokens” section, and follow the instructions.\n    Copy the generated token to the clipboard, for use in the next step.\n 2. Create the file ``~/.netrc`` with the following contents (or add that to the existing file):\n\n        machine api.github.com\n            user «your GitHub username»\n            password «your personal access token»\n\n 3. Call ``chmod 600 ~/.netrc`` to protect your sensitive data.\n\nThis way, the sensitive authentication information is separate from the rest of the configuration.\nUse the ``gh help`` command to check whether your credentials actually work\n– if they do, your GitHub user information is displayed, otherwise you'll get an error indicator.\n\n\n### Main Configuration File\n\n**TODO**\n\n\n## Usage\n\nMost of the commands are intentionally self-explanatory,\nso usually they are just listed without further details,\nin the hope that it's quite obvious what they do.\n\n\n### General Options\n\nThese options must appear before any sub-command, directly after ``gh``.\n\n * ``--user ‹account name›`` – Override account name from config.\n * ``--token ‹API token›`` – Override API token from config.\n * ``--site ‹base URL›`` – Override site URL for on-premise installations of GitHub.\n\n\n### Common Options\n\nMany of the commands do similar things, like exporting data.\nThat fact is reflected in some shared options that always behave the same.\nSee the ``--help`` message of every command for details and specific options.\n\n * ``--format ‹choice›`` – Specifies the output format to use, but is only\n   needed in absence of a filename with a clear extension. The choices are\n   ``json``, ``yaml``, ``csv``, ``xls``, and ``dbf``.\n\n\n### Common Arguments\n\n * ``‹repo›`` – A repository name, either fully qualified in the form\n   ``‹account›/‹repo›``, or else a plain repository name assumed to be\n   owned by the current user.\n\n\n### Labels\n\n * :heavy_check_mark: ``gh label list ‹repo›…``\n * :heavy_check_mark: ``gh label export [--format=…] ‹repo›… [to] ‹filename.ext›``\n * :heavy_check_mark: ``gh label import ‹repo› [from] ‹filename.ext›``\n\n\n### Users\n\n * :heavy_check_mark: ``gh user show [‹username›…]``\n\n\n### Miscellaneous\n\n * :heavy_check_mark: ``gh help`` – Show information about the installation \u0026 configuration, and how to get further help.\n\n\n## Contributing\n\nTo create a working directory for this project, call these commands:\n\n```sh\ngit clone \"https://github.com/jhermann/gh-commander.git\"\ncd \"gh-commander\"\n. .env --yes --develop\ninvoke ci\n```\n\nSee [CONTRIBUTING](https://github.com/jhermann/gh-commander/blob/master/CONTRIBUTING.md) for more.\n\n[![Throughput Graph](https://graphs.waffle.io/jhermann/gh-commander/throughput.svg)](https://waffle.io/jhermann/gh-commander/metrics)\n\n\n## References\n\n**General**\n\n* [GitHub API v3](https://developer.github.com/v3/)\n\n**Similar Projects**\n\n* [sigmavirus24/github-cli](https://github.com/sigmavirus24/github-cli)\n* [harshasrinivas/cli-github](https://github.com/harshasrinivas/cli-github)\n* [github-issues-import](https://github.com/IQAndreas/github-issues-import)\n* [geet](https://github.com/saveriomiroddi/geet)\n\n**Tools**\n\n* [Cookiecutter](http://cookiecutter.readthedocs.io/en/latest/)\n* [PyInvoke](http://www.pyinvoke.org/)\n* [pytest](http://pytest.org/latest/contents.html)\n* [tox](https://tox.readthedocs.io/en/latest/)\n* [Pylint](http://docs.pylint.org/)\n* [twine](https://github.com/pypa/twine#twine)\n* [bpython](http://docs.bpython-interpreter.org/)\n* [yolk3k](https://github.com/myint/yolk#yolk)\n\n**Packages**\n\n* [github3.py](http://github3py.readthedocs.io/)\n* [Rituals](https://jhermann.github.io/rituals)\n* [Click](http://click.pocoo.org/)\n* [sh](http://amoffat.github.io/sh/)\n* [tablib](http://docs.python-tablib.org/en/latest/)\n\n\n## Acknowledgements\n\n * Logo elements from [clker.com Free Clipart](http://www.clker.com/).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhermann%2Fgh-commander","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjhermann%2Fgh-commander","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjhermann%2Fgh-commander/lists"}