github的命令行接口发布api v2。

github-cli的Python项目详细描述


关于

github-cli提供了 名为ghi的可执行文件,可用于从 命令行

github cli是用Python编写的

安装

在大多数类unix系统上,您可能需要运行以下命令 `以根用户身份或使用sudo安装命令

pip

pip install github-cli

来自源

pip install git+http://github.com/jsmits/github-cli

git clone git://github.com/jsmits/github-cli.git
cd github-cli
python setup.py install

因此,ghi可执行文件将安装到系统中bin 目录

配置

确保您的github用户名和api令牌已添加到全局git配置:

git config --global github.user <your GitHub username>
git config --global github.token <your GitHub API token>

或者可以指定环境变量github_user和github_token

您可以在github的帐户页上找到用户名和api令牌

用法

在一个工作目录中 github(对于git存储库,远程名称为origingithub,或者 defaultgithub对于mercurial/hg-git存储库,您可以这样做(注意:使用 -r选项,命令可以从任何地方调用):

(github-cli)[jsmits@imac:~]$ ghi --help
Usage: ghi command [args] [options]

Examples:
ghi list [-s open|closed|all]       show open, closed or all issues
                                    (default: open)
ghi [-s o|c|a] -v                   same as above, but with issue details
ghi                                 same as: ghi list
ghi -v                              same as: ghi list -v
ghi [-s o|c] -w                     show issues' GitHub page in web browser
                                    (default: open)
ghi list -u <github_user>           show issues created by specified user

ghi show <nr>                       show issue <nr>
ghi show <nr> -v                    same as above, but with comments
ghi <nr>                            same as: ghi show <nr>
ghi <nr> -w                         show issue <nr>'s GitHub page in web
                                    browser
ghi open (o)                        create a new issue (with $EDITOR)
ghi open (o) -m <msg>               create a new issue with <msg> content
                                    (optionally, use \n for new lines; first
                                    line will be the issue title)
ghi close (c) <nr>                  close issue <nr>
ghi open (o) <nr>                   reopen issue <nr>
ghi edit (e) <nr>                   edit issue <nr> (with $EDITOR)
ghi label add (al) <label> <nr>     add <label> to issue <nr>
ghi label remove (rl) <label> <nr>  remove <label> from issue <nr>
ghi search (s) <term>               search for <term> (default: open)
ghi s <term> [-s o|c] -v            same as above, but with details
ghi s <term> -s closed              only search in closed issues
ghi comment (m) <nr>                create a comment for issue <nr>
                                    (with $EDITOR)
ghi comment (m) <nr> -m <msg>       create a comment for issue <nr>
                                    with <msg> content. (optionally use \n
                                    for new lines)
ghi -r <user>/<repo>                specify a repository (can be used for
                                    all commands)
ghi -r <repo>                       specify a repository (gets user from
                                    global git config)

Description: command-line interface to GitHub's Issues API (v2)

Options:
  -h, --help            show this help message and exit
  -v, --verbose         show issue details (only for show, list and search
                        commands) [default: False]
  -s STATE, --state=STATE
                        specify state (only for list and search (except `all`)
                        commands) choices are: open (o), closed (c), all (a)
                        [default: open]
  -u CREATED_BY, --user=CREATED_BY
                        issues created by <github_username> [default: all]
  -m MESSAGE, --message=MESSAGE
                        message content for opening or commenting on an issue
                        without using the editor
  -r REPO, --repo=REPO, --repository=REPO
                        specify a repository (format: `user/repo` or just
                        `repo` (latter will get the user from the global git
                        config))
  -w, --web, --webbrowser
                        show issue(s) GitHub page in web browser (only for
                        list and show commands) [default: False]
  -V, --version         show program's version number and exit

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
在IE10中重新加载另一个帧时,internet explorer Java小程序失败/消失   ThreadLocal变量的java性能   java系统。出来println不是打印输出   java从JAXB类获取元素属性   java组织。天啊。科尔巴。包裹。InvalidName:IDL:omg。org/CORBA/ORB/InvalidName:1.0   java有没有办法让非事务连接抛出异常?   java是否有任何方法可以使用JdbcTemplate和查询/条件Fluent API   javajpa级联类型。刷新不工作?   未考虑java Maven依赖关系管理   java MySQL MBR包含抛出MySQLExceptionError的语句   java验证整数并将其设为5位数   java发现了循环依赖的问题   java Hibernate left join fetch到使用@ManyToMany关联映射的softdeleted实体生成无效查询?   JavaH:commandButton多个操作:下载文件并呈现ajax表   Google Contacts API在Java、C#、Python或Ruby中是否有一个Hello World示例?