神刀安全网

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

gitsome

A Supercharged Git/Shell Autocompleter with GitHub Integration.

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

Motivation

Git Command Line

Although the standard Git command line is a great tool to manage your Git-powered repos, it can be tough to remember the usage of:

  • 150+ porcelain and plumbing commands
  • Countless command-specific options
  • Resources such as tags and branches

Out of the box, the Git command line does not provide integration with GitHub , forcing users to toggle between command line and browser.

gitsome : A Supercharged Git/Shell CLI with GitHub Integration

gitsome aims to supercharge the standard git/shell interface by focusing on:

  • Improving ease-of-use
  • Increasing productivity

GitHub Integration

gitsome provides direct integration with GitHub.

Not all GitHub workflows work well in a terminal; gitsome attempts to target those that do.

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

Git and GitHub Autocompleter with Interactive Help

gitsome will autocomplete and provide interactive help for the following:

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

General Autocompleter

gitsome will autocomplete the following:

  • Shell commands
  • Files and directories
  • Environment variables
  • Man pages
  • Python

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

Fish-Style Auto-Suggestions

gitsome supports Fish-style auto-suggestions. Use the right arrow key to complete a suggestion.

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

Python REPL

gitsome is powered by xonsh , which supports a Python REPL.

Run Python commands alongside shell commands:

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

Additional xonsh features can be found in the xonsh tutorial .

Command History

gitsome keeps track of commands you enter and stores them in ~/.xonsh_history.json . Use the up and down arrow keys to cycle through the command history.

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

Customizable Highlighting

You can control the ansi colors used for highlighting by updating your ~/.gitsomeconfig file.

Color options include:

'black', 'red', 'green', 'yellow', 'blue', 'magenta', 'cyan', 'white' 

For no color, set the value(s) to None .

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

Available Platforms

gitsome is available for Mac, Linux, Unix, andWindows.

TODO

Not all GitHub workflows work well in a terminal; gitsome attempts to target those that do.

  • Add additional GitHub API integrations

gitsome is just getting started. Feel free tocontribute!

Index

GitHub Integration Commands

Installation and Tests

  • Installation
    • Pip Installation
    • Virtual Environment Installation
    • Running the gh configure Command
    • Enabling Bash Completions
    • Enabling gh Tab Completions Outside of gitsome
    • Optional: Installing PIL or Pillow
    • Supported Python Versions
    • Supported Platforms
    • Windows Support
  • Developer Installation
    • Continuous Integration
    • Unit Tests and Code Coverage
    • Documentation

Misc

  • Contributing
  • Credits
  • Contact Info
  • License

GitHub Integration Commands Syntax

Usage:

$ gh <command> [param] [options] 

GitHub Integration Commands Listing

  configure            Configure gitsome.   create-comment       Create a comment on the given issue.   create-issue         Create an issue.   create-repo          Create a repo.   emails               List all the user's registered emails.   emojis               List all GitHub supported emojis.   feed                 List all activity for the given user or repo.   followers            List all followers and the total follower count.   following            List all followed users and the total followed count.   gitignore-template   Output the gitignore template for the given language.   gitignore-templates  Output all supported gitignore templates.   issue                Output detailed information about the given issue.   issues               List all issues matching the filter.   license              Output the license template for the given license.   licenses             Output all supported license templates.   me                   List information about the logged in user.   notifications        List all notifications.   octo                 Output an Easter egg or the given message from Octocat.   pull-request         Output detailed information about the given pull request.   pull-requests        List all pull requests.   rate-limit           Output the rate limit.   repo                 Output detailed information about the given filter.   repos                List all repos matching the given filter.   search-issues        Search for all issues matching the given query.   search-repos         Search for all repos matching the given query.   starred              Output starred repos.   trending             List trending repos for the given language.   user                 List information about the given user.   view                 View the given index in the terminal or a browser. 

GitHub Integration Commands Reference: COMMANDS.md

See the GitHub Integration Commands Reference in COMMANDS.md for a detailed discussion of all GitHub integration commands, parameters, options, and examples.

Check out the next section for a quick reference .

GitHub Integration Commands Quick Reference

Configuring gitsome

To properly integrate with GitHub, you must first configure gitsome :

$ gh configure 

Listing Feeds

Listing Your News Feed

$ gh feed 

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

Listing A User’s Activity Feed

View your activity feed or another user’s activity feed, optionally through a pager with -p/--pager . Thepager optionis available for many commands.

$ gh feed donnemartin -p 

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

Listing A Repo’s Activity Feed

$ gh feed donnemartin/gitsome -p 

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

Listing Notifications

$ gh notifications 

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

Listing Pull Requests

View all pull requests for your repos:

$ gh pull-requests 

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

Filtering Issues

View all open issues where you have been mentioned:

$ gh issues --issue_state open -issue_filter mentioned 

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

View all issues, filtering for only those assigned to you, regardless of state (open, closed):

$ gh issues --issue_state all --issue_filter assigned 

For more information about the filter and state qualifiers, visit the gh issues reference inCOMMANDS.md.

Filtering Starred Repos

$ gh starred "repo filter" 

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

Searching Issues and Repos

Searching Issues

Search issues that have the most +1s:

$ gh search-issues "is:open is:issue sort:reactions-+1-desc" -p 

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

Search issues that have the most comments:

$ gh search-issues "is:open is:issue sort:comments-desc" -p 

Search issues with the "help wanted" tag:

$ gh search-issues "is:open is:issue label:/"help wanted/"" -p 

Search issues that have your user name tagged @donnemartin :

$ gh search-issues "is:issue donnemartin is:open" -p 

Search all your open private issues:

$ gh search-issues "is:open is:issue is:private" -p 

For more information about the query qualifiers, visit the searching issues reference .

Searching Repos

Search all Python repos created on or after 2015, with >= 1000 stars:

$ gh search-repos "created:>=2015-01-01 stars:>=1000 language:python" --sort stars -p 

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

For more information about the query qualifiers, visit the searching repos reference .

Listing Trending Repos and Devs

View trending repos:

$ gh trending [language] [-w/--weekly] [-m/--monthly] [-d/--devs] [-b/--browser] 

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

View trending devs (devs are currently only supported in browser):

$ gh trending [language] --devs --browser 

Viewing Content

The view command

View the previously listed notifications, pull requests, issues, repos, users etc, with HTML nicely formatted for your terminal, or optionally in your browser:

$ gh view [#] [-b/--browser] 

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

The issue command

View an issue:

$ gh issue donnemartin/saws/1 

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

The pull-request command

View a pull request:

$ gh pull-request donnemartin/awesome-aws/2 

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

Setting Up .gitignore

List all available .gitignore templates:

$ gh gitignore-templates 

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

Set up your .gitignore :

$ gh gitignore-template Python > .gitignore 

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

Setting Up LICENSE

List all available LICENSE templates:

$ gh licenses 

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

Set up your or LICENSE :

$ gh license MIT > LICENSE 

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

Summoning Octocat

Call on Octocat to say the given message or an Easter egg:

$ gh octo [say] 

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

Viewing Profiles

Viewing A User’s Profile

$ gh user octocat 

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

Viewing Your Profile

View your profile with the gh user [YOUR_USER_ID] command or with the following shortcut:

$ gh me 

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

Creating Comments, Issues, and Repos

Create a comment:

$ gh create-comment donnemartin/gitsome/1 -t "hello world" 

Create an issue:

$ gh create-issue donnemartin/gitsome -t "title" -b "body" 

Create a repo:

$ gh create-repo gitsome 

Option: View in a Pager

Many gh commands support a -p/--pager option that displays results in a pager, where available.

Usage:

$ gh <command> [param] [options] -p $ gh <command> [param] [options] --pager 

Option: View in a Browser

Many gh commands support a -b/--browser option that displays results in your default browser instead of your terminal.

Usage:

$ gh <command> [param] [options] -b $ gh <command> [param] [options] --browser 

See theCOMMANDS.md for a detailed listing of all GitHub integration commands, parameters, options, and examples.

Having trouble remembering these commands? Check out the handyautocompleter with interactive helpto guide you through each command.

Note, you can combine gitsome with other utilities such asGit-Extras.

Installation

Pip Installation

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

gitsome is hosted on PyPI . The following command will install gitsome :

$ pip install gitsome 

You can also install the latest gitsome from GitHub source which can contain changes not yet pushed to PyPI:

$ pip install git+https://github.com/donnemartin/gitsome.git 

If you are not installing in a virtualenv, run with sudo :

$ sudo pip install gitsome 

Once installed, run the optional gitsome autocompleter with interactive help:

$ gitsome 

Run GitHub-integrated commands:

$ gh <command> [param] [options] 

Note: Running the gitsome shell is not required to execute gh commands. Afterinstalling gitsome you can run gh commands from your shell.

Running the gitsome shell will provide you with autocompletion, interactive help, fish-style suggestions, a Python REPL, etc.

Virtual Environment Installation

It is recommended that you install Python packages in a virtualenv to avoid potential issues with dependencies or permissions.

To view gitsome virtualenv installation instructions, clickhere.

Running the gh configure Command

To properly integrate with GitHub, gitsome must be properly configured:

$ gh configure 

View more details in thegh configure section.

Enabling Bash Completions

By default, gitsome looks at the following locations to enable bash completions .

To add additional bash completions, update the ~/.xonshrc file with the location of your bash completions.

If ~/.xonshrc does not exist, create it:

$ touch ~/.xonshrc 

For example, if additional completions are found in usr/local/etc/my_bash_completion.d/completion.bash , add the following line in ~/.xonshrc :

$BASH_COMPLETIONS.append('/usr/local/etc/my_bash_completion.d/completion.bash') 

You will need to restart gitsome for the changes to take effect.

Enabling gh Tab Completions Outside of gitsome

You can run gh commands outside of the gitsome shell completer. To enable gh tab completions for this workflow, copy the gh_complete.sh file locally.

Let bash know completion is available for the gh command within your current session:

$ source /path/to/gh_complete.sh 

To enable tab completion for all terminal sessions, add the following to your bashrc file:

source /path/to/gh_complete.sh 

Reload your bashrc :

$ source ~/.bashrc 

Tip: . is the short form of source , so you can run this instead:

$ . ~/.bashrc 

Optional: Installing PIL or Pillow

Displaying the avatar for the gh me and gh user commands will require installing the optional PIL or Pillow dependency.

Windows* and Mac:

$ pip install Pillow 

*See theWindows Supportsection for limitations on the avatar.

Ubuntu users, check out these instructions on askubuntu

Supported Python Versions

  • Python 3.4
  • Python 3.5

gitsome is powered by xonsh which does not currently support Python 2.x, as discussed in thisticket.

Supported Platforms

  • Mac OS X
    • Tested on OS X 10.10
  • Linux, Unix
    • Tested on Ubuntu 14.04 LTS
  • Windows
    • Tested on Windows 10

Windows Support

gitsome has been tested on Windows 10 with cmd and cmder .

Although you can use the standard Windows command prompt, you’ll probably have a better experience with eithercmder orconemu.

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

Text Only Avatar

The commands gh user and gh me will always have the -t/--text_avatar flag enabled, since img2txt does not support the ansi avatar on Windows.

Config File

On Windows, the .gitsomeconfig file can be found in %userprofile% . For example:

C:/Users/dmartin/.gitsomeconfig 

Developer Installation

If you’re interested in contributing to gitsome , run the following commands:

$ git clone https://github.com/donnemartin/gitsome.git $ pip install -e . $ pip install -r requirements-dev.txt $ gitsome $ gh <command> [param] [options] 

Continuous Integration

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

Continuous integration details are available on Travis CI .

Unit Tests and Code Coverage

Run unit tests in your active Python environment:

$ python tests/run_tests.py 

Run unit tests with tox on multiple Python environments:

$ tox 

Documentation

Source code documentation will soon be available on Readthedocs.org . Check out thesource docstrings.

Run the following to build the docs:

$ scripts/update_docs.sh 

Contributing

Contributions are welcome!

Review the Contributing Guidelines for details on how to:

  • Submit issues
  • Submit pull requests

Credits

  • click bymitsuhiko
  • github_trends_rss byryotarai
  • github3.py bysigmavirus24
  • html2text byaaronsw
  • img2txt byhit9
  • python-prompt-toolkit byjonathanslenders
  • requests bykennethreitz
  • xonsh byscopatz

Contact Info

Feel free to contact me to discuss any issues, questions, or comments.

My contact info can be found on myGitHub page.

License

Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

Copyright 2016 Donne Martin  Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at     http://www.apache.org/licenses/LICENSE-2.0  Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. 

转载本站任何文章请注明:转载至神刀安全网,谢谢神刀安全网 » Gitsome: A Supercharged Git/Shell Autocompleter with GitHub Integration

分享到:更多 ()

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址