{"id":13393688,"url":"https://github.com/piotrmurach/github_cli","last_synced_at":"2025-06-12T13:09:26.495Z","repository":{"id":2696183,"uuid":"3689496","full_name":"piotrmurach/github_cli","owner":"piotrmurach","description":"GitHub on your command line. Use your terminal, not the browser.","archived":false,"fork":false,"pushed_at":"2022-08-13T21:58:31.000Z","size":1118,"stargazers_count":268,"open_issues_count":7,"forks_count":35,"subscribers_count":14,"default_branch":"master","last_synced_at":"2025-05-25T00:43:12.677Z","etag":null,"topics":["cli","command-line-tool","console","github-api","ruby","ruby-gem","terminal-app"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/piotrmurach.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-03-11T20:35:23.000Z","updated_at":"2025-04-22T20:25:30.000Z","dependencies_parsed_at":"2022-07-18T23:18:30.800Z","dependency_job_id":null,"html_url":"https://github.com/piotrmurach/github_cli","commit_stats":null,"previous_names":["peter-murach/github_cli"],"tags_count":22,"template":false,"template_full_name":null,"purl":"pkg:github/piotrmurach/github_cli","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piotrmurach%2Fgithub_cli","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piotrmurach%2Fgithub_cli/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piotrmurach%2Fgithub_cli/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piotrmurach%2Fgithub_cli/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/piotrmurach","download_url":"https://codeload.github.com/piotrmurach/github_cli/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/piotrmurach%2Fgithub_cli/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259470951,"owners_count":22862999,"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","command-line-tool","console","github-api","ruby","ruby-gem","terminal-app"],"created_at":"2024-07-30T17:00:58.660Z","updated_at":"2025-06-12T13:09:26.467Z","avatar_url":"https://github.com/piotrmurach.png","language":"Ruby","readme":"\u003cdiv align=\"center\"\u003e\n  \u003ca href=\"http://piotrmurach.github.io/github/\"\u003e\u003cimg width=\"136\" src=\"https://github.com/piotrmurach/github_cli/raw/master/assets/github_api.png\" alt=\"github api logo\" /\u003e\u003c/a\u003e\n\u003c/div\u003e\n\n# [GithubCLI](https://piotrmurach.github.io/github/)\n\n[![Gem Version](https://badge.fury.io/rb/github_cli.svg)][gem]\n[![Build Status](https://secure.travis-ci.org/piotrmurach/github_cli.svg?branch=master)][travis]\n[![Build status](https://ci.appveyor.com/api/projects/status/dw97iaycnu9ea6u0?svg=true)][appveyor]\n[![Maintainability](https://api.codeclimate.com/v1/badges/38e4d21b00806fd865c1/maintainability)][codeclimate]\n[![Coverage Status](https://coveralls.io/repos/github/piotrmurach/github_cli/badge.svg?branch=master)][coverage]\n[![Inline docs](http://inch-ci.org/github/piotrmurach/github_cli.svg)][inchpages]\n\n[gem]: http://badge.fury.io/rb/github_cli\n[travis]: http://travis-ci.org/piotrmurach/github_cli\n[appveyor]: https://ci.appveyor.com/project/piotrmurach/github-cli\n[codeclimate]: https://codeclimate.com/github/piotrmurach/github_cli/maintainability\n[coverage]: https://coveralls.io/github/piotrmurach/github_cli\n[inchpages]: http://inch-ci.org/github/piotrmurach/github_cli\n\n\u003e GitHub on your command line. User your terminal, not the browser. Works hand-in-hand with `github_api` gem.\n\n![Interface](https://github.com/piotrmurach/github_cli/raw/master/assets/interface.png)\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n    gem 'github_cli'\n\nAnd then execute:\n\n    $ bundle\n\nOr install it yourself as:\n\n    $ gem install github_cli\n\n## Contents\n\n* [1. Usage](#1-usage)\n* [2. Interface](#2-interface)\n  * [2.1. Configuration file](#21-configuration-file)\n  * [2.2. Authorization](#22-authorization)\n  * [2.3. Arguments](#23-arguments)\n  * [2.4. Listing commands](#24-listing-commands)\n  * [2.5. Subcommands](#25-subcommands)\n  * [2.6. Output formatting](#26-output-formatting)\n  * [2.7. Output paging](#27-output-paging)\n* [3. API](#3-api)\n* [4. Development](#4-development)\n\n## 1. Usage\n\nRun it:\n\n```shell\n$ gcli\n```\n\n## 2. Interface\n\n### 2.1 Configuration file\n\nThe first step is to create a configuration file, either global in home directory or local inside the project:\n\n```shell\n$ gcli init [--local|-l]\n```\n\nWithout any options this command will setup a `.gcliconfig` configuration file in your home directory with all the global settings. By passing `--local` option the config file will be created locally in the current directory.\n\nMain configuration options are:\n\n```\nuser.token            # Authentication token\nuser.login            # User login\nuser.password         # User password\nuser.name             # Default user name\nuser.repo             # Default repo name\nuser.org              # Default organization name\ncore.editor           # Editor to be opened\ncore.endpoint         # The api endpoint, by default https://api.github.com\ncore.site             # The web endpoint, by default https://github.com\ncore.pager            # Pager to be used, by default less\ncore.format           # Output formating\ncore.quiet            # Surpass output to show only response status\ncore.ssl              # SSL settings\ncore.auto_pagination  # Switch on default results pagination, default false\n```\n\nMoreover, `gcli config` command allows you to set/get any configuration option such as output format, editor or oauth token.\n\nFor instance, to check value for your `authentication token` do\n\n```shell\n$ gcli config user.token\n```\n\nAnd to set the value do\n\n```shell\n$ gcli config user.token lh23l4kj234....\n```\n\nTo list specific options\n\n```shell\n$ gcli config --list [regex]\n```\n\nTo edit config in your favourite editor:\n\n```shell\n$ gcli config -e\n```\n\nFinally, to see a manpage about available configuration options do\n\n```shell\n$ gcli help config\n```\n\n### 2.2 Authorization\n\nTo create oauth tokens you need to setup your basic authentication.\n\nYou can either set it up manually like so\n\n```shell\n$ gcli init\n$ gcli config user.login '...'\n$ gcli config user.password '...'\n```\n\nThen to create your token do\n\n```shell\n$ gcli auth create --scopes=repo --note=github_cli --note-url=http://github.com/piotrmurach/github_cli\n```\n\nAlternatively `authorize` command has been provided that will guide you through authentication process by asking questions and then save the credentials to `.githubrc` file. Example\n\n```shell\n$ gcli authorize\n```\n\nTo see your current tokens do\n\n```shell\n$ gcli auth ls\n```\n\nTo see current tokens without configuration file pass `--login` and `--password` flags like so\n\n```shell\n$ gcli auth ls --login=... --password=...\n```\n\nFinally to add the token to your config do\n\n```shell\n$ gcli config user.token '...'\n```\n\n### 2.3. Arguments\n\nThe required arguments come first as per command description, then are followed by the optional arguments supplied as specific options.\n\nFor instance, one can create repository by supplying parameters in the following way:\n\n```shell\n$ gcli repo create github_api --desc='Test repo for kitty.'\n```\n\nTo create repository inside organization:\n\n```shell\n$ gcli repo create github/github_api --desc='Test repo for kitty.'\n```\n\nTo provide array argument, pass space delimited strings like so\n\n```\n$ gcli hook create \u003cuser\u003e \u003crepo\u003e --events=push issues status\n```\n\nTo provide hash argument, pass space delimited key:value pairs such as\n\n```\n$ gcli hook create \u003cuser\u003e \u003crepo\u003e --config=url:\"http://example.com/path\" content_type:json\n```\n\nTo find out which options are required and which are optional use `help` command:\n\n```shell\n$ gcli repo help create\n```\n\n### 2.4. Listing commands\n\nYou can list all GitHub APIs commands:\n\n```shell\n$ gcli list\n```\n\nto limit returned results pass `pattern`\n\n```shell\n$ gcli list re*   # Returns all commands matching the pattern\n```\n\n### 2.5. Subcommands\n\nTo see a list of subcommands that a given command provides just type top-level command like so\n\n```shell\n$ gcli repo\n```\n\n### 2.5. Output formatting\n\nThe API responses can be formatted as `csv` or `table`.\n\nBy default responses are in tabular format. Tables are available in `horizontal` and `vertical` mode. To enforce table display pass `:h` and `:v` respectively. Otherwise a default orientation will be picked depending on the request made and terminal size.\n\n\n![Command](https://github.com/piotrmurach/github_cli/raw/master/assets/command.png)\n\nTo get `csv` formatting for easy command piping do\n\n```shell\ngcli repo ls -u wycats --format=csv\n```\n\nTo suppress output pass `--quiet` option like so\n\n```shell\ngcli repo create ... --quiet=true\n```\n\n### 2.6. Output paging\n\nBy default all responses are paged. You can switch off paging by supplying `no-pager` flag.\n\n```shell\ngcli --no-pager user ls -u wycats\n```\n\nAlso you can supply you preferred `pager`, otherwise the paging program is taken from environment variable PAGER if defined or defaults to \"less\".\n\n### 3. API\n\nInteract with git data:\n\n```shell\n$ gcli blob\n$ gcli commit\n$ gcli ref\n$ gcli tag\n$ gcli tree\n```\n\nInteract with issues:\n\n```shell\n$ gcli issue\n$ gcli label\n$ gcli milestone\n$ gcli comment\n```\n\nInteract with repositories:\n\n```shell\n$ gcli repo\n$ gcli collab\n$ gcli content\n$ gcli download\n$ gcli fork\n$ gcli hook\n$ gcli key\n```\n\nInteract with activities:\n\n```shell\n$ gcli star\n$ gcli watch\n$ gcli event\n```\n\nInteract with gists:\n\n```shell\n$ gcli gist\n```\n\nInteract with users:\n\n```shell\n$ gcli user\n$ gcli email\n$ gcli follower\n```\n\nInteract with organizations:\n\n```shell\n$ gcli org\n$ gcli member\n$ gcli team\n```\n\nInteract with authorizations:\n\n```shell\n$ gcli auth\n```\n\nInteract with search:\n\n```shell\n$ gcli search\n```\n\n## 4. Development\n\nThe test suite includes both unit tests and end-to-end tests. The unit tests are in `spec` folder and can be run:\n\n```bash\n$ bundle exec rake spec\n```\n\nThe end-to-end tests are in `features` folder and can be run:\n\n```bash\n$ bundle exec rake features\n```\n\nIn order to run all the tests run:\n\n```bash\n$ bundle exec rake [ci]\n```\n\n## Contributing\n\nThis project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the [Contributor Covenant](http://contributor-covenant.org) code of conduct.\n\nBug reports and pull requests are welcome.\n\n1. Fork it\n2. Create your feature branch (`git checkout -b my-new-feature`)\n3. Commit your changes (`git commit -am 'Added some feature'`)\n4. Push to the branch (`git push origin my-new-feature`)\n5. Create new Pull Request\n\n## Copyright\n\nCopyright (c) 2012 Piotr Murach. See LICENSE for further details.\n","funding_links":[],"categories":["Command line","Ruby"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiotrmurach%2Fgithub_cli","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpiotrmurach%2Fgithub_cli","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpiotrmurach%2Fgithub_cli/lists"}