Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

gh

Package Overview
Dependencies
Maintainers
2
Versions
136
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gh

Github command line tools helps you improve using git and github from the terminal.

  • 0.1.10
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
25K
increased by26.79%
Maintainers
2
Weekly downloads
 
Created
Source

node-gh Build Status NPM version

Class Octocat

All the power of GitHub in your terminal.

Usage

gh  [command] [--flags]

Install

[sudo] npm install -g gh

Dependencies

In order to sucessfully run this project you must have NodeJS installed.

Available commands

gh help

Pull requests

1. List

OptionUsageType
-l, --listRequiredBoolean
-a, --allOptionalBoolean
-b, --branchOptionalString
-r, --repoOptionalString
-s, --userOptionalString
Examples
  • List open pulls requests for the current branch.

gh pr --list ```

  • List open pulls requests for all branches.

gh pr --list --all ```

  • List open pulls requests for a branch.

gh pr --list --branch master ```

2. Fetch

OptionUsageType
-f, --fetchRequiredBoolean
-n, --numberRequiredNumber
-M, --mergeOptionalBoolean
-R, --rebaseOptionalBoolean
-r, --repoOptionalString
-s, --userOptionalString
Examples
  • Fetch pull request and checkout into a new branch pull-1.

gh pr --number 1 --fetch ```

  • Fech pull request rebasing or merging into the current branch.

gh pr --number 1 --fetch --rebase gh pr --number 1 --fetch --merge ```

3. Merge or rebase

OptionUsageType
-M, --mergeRequiredBoolean
-R, --rebaseRequiredBoolean
-n, --numberOptionalNumber
-b, --branchOptionalString
-r, --repoOptionalString
-s, --userOptionalString

Omitting --number will try to guess the pull number from branch name e.g. pull-1 results in --number 1. Omitting --branch will merge or rebase into config.default_branch.

Examples
  • Merge or rebase pull request into a branch.

gh pr --merge [--number 1] [--branch master] ```

```

gh pr --rebase [--number 1] [--branch master] ```

4. Comment

OptionUsageType
-c, --commentRequiredString
-n, --numberRequiredNumber
-r, --repoOptionalString
-s, --userOptionalString
Examples
  • Comment on a pull request.

gh pr --number 1 --comment "Merged, thank you!" ```

5. Forward

OptionUsageType
--fwdRequiredString
-n, --numberRequiredNumber
Examples
  • Forward a pull request to another reviewer.

gh pr --number 1 --fwd username ```

6. Open or close

OptionUsageType
-o, --openRequiredBoolean
-C, --closeRequiredBoolean
-n, --numberRequiredNumber
-r, --repoOptionalString
-s, --userOptionalString
Examples
  • Open a pull request.

gh pr --number 1 --open ```

  • Close a pull request.

gh pr --number 1 --close ```

  • Open or close a pull request that you've sent to someone.

gh pr --number 1 --close --user eduardolundgren ```

7. Submit

OptionUsageType
-s, --submitRequiredString
-b, --branchOptionalString
-t, --titleOptionalString

Omitting --title will submit a pull request using current branch name as title.

Examples
  • Submit a pull request using the current branch.

gh pr --submit eduardolundgren --title 'Fix #32' ```

  • Submit a pull request using the current branch to dev branch.

gh pr --submit eduardolundgren --branch dev ```

Notifications

1. Latest

OptionUsageType
-l, --latestRequiredBoolean
-r, --repoOptionalString
-s, --userOptionalString
Examples
  • Display the latest activities on the current repository.

gh nt --latest ```

  • Display the latest activities on a certain repository.

gh nt --latest --user eduardolundgren --repo node-gh ```

2. Watch

OptionUsageType
-w, --watchRequiredBoolean
-r, --repoOptionalString
-s, --userOptionalString
Examples
  • Watch for any activity on the current repository.

gh nt --watch ```

  • Watch for any activity on a certain repository.

gh nt --watch --user eduardolundgren --repo node-gh ```

Issues

1. Create

OptionUsageType
-N, --newRequiredBoolean
-t, --titleRequiredString
-L, --labelOptionalString
-m, --messageOptionalString
-r, --repoOptionalString
-u, --userOptionalString
Examples
  • Create a new issue on the current repository.

gh is --new --title 'Node GH rocks!' --message 'Markdown support' ```

  • Create a new issue on a certain repository.

gh is --new --title 'Node GH rocks!' --message 'Markdown support' --user eduardolundgren --repo node-gh ```

  • Create a new issue with labels.

gh is --new --title 'Node GH rocks!' --label bug,question,test ```

2. Comment

OptionUsageType
-c, --commentRequiredString
-n, --numberRequiredNumber
-r, --repoOptionalString
-u, --userOptionalString
Examples
  • Comment on an issue of the current repository.

gh is --number 1 --comment 'Node GH rocks!' ```

  • Comment on an issue of a certain repository.

gh is --number 1 --comment 'Node GH rocks!' --user eduardolundgren --repo node-gh ```

3. List

OptionUsageType
-l, --listRequiredBoolean
-a, --allOptionalString
-r, --repoOptionalString
-u, --userOptionalString
Examples
  • List all issues on the current repository.

gh is --list ```

  • List all issues from all repositories.

gh is --list --all ```

  • List all issues on a certain repository.

gh is --list --user eduardolundgren --repo node-gh ```

Team

Eduardo LundgrenZeno Rocha
Eduardo LundgrenZeno Rocha

Contributing

Contribute new commands to this project by copying and editing the content of Hello World example.

History

  • v0.1.10 May 30, 2013

    • Cross platform process.env.HOME
  • v0.1.8 May 30, 2013

    • Open issue in browser
    • Open pull request url on the browser after sending it
  • v0.1.7 May 30, 2013

    • Add hability to set number without --number flag
  • v0.1.6 May 30, 2013

    • Add the hability to specify a title on gh pr --submit
    • Add password mask on authentication
    • Bug fixes
  • v0.1.5 May 29, 2013

    • Fix pull request integrity check
  • v0.1.4 May 28, 2013

    • Add the hability to create an Issue
    • Add the hability to comment on an Issue
    • Rename pull request --comment to --message
    • Rename pull request --pull to --number
  • v0.1.3 May 28, 2013

    • Remove mustache dependency
  • v0.1.2 May 28, 2013

    • Removing wrong number on submit
  • v0.1.1 May 27, 2013

    • Add Help task
    • Standardize logs
    • Bug fixes
  • v0.1.0 May 26, 2013

    • Allow log handlebars template from string
    • Move apply replacements logic to logger
    • Use handlebars templates instead of strings
    • Refactoring template integration with logger
    • Rename pull request --comment to --message
    • Add Issues task
  • v0.0.7 May 24, 2013

    • Add pull request forward command
    • Add Travis continous integration with JSHint
    • Create a new website under gh-pages branch
    • Update dependency version: git-wrapper@0.1.1
    • Add Hello World and Notification tasks
  • v0.0.6 May 17, 2013

    • Add hability to merge or rebase pull request
    • Add base.getUser and git.merge helpers
  • v0.0.5 May 16, 2013

    • Add login to be invoked by default in series
  • v0.0.4 May 16, 2013

    • Create ~/.gh.json if needed
  • v0.0.3 May 16, 2013

    • Merge user ~/.gh.json with default .gh.json
    • Add default .gh.json
    • Fix bin path
  • v0.0.2 May 16, 2013

    • Add fetch, open/close, message
    • Use moment humanize utility
  • v0.0.1 May 14, 2013

    • Initial commit

License

BSD License

Keywords

FAQs

Package last updated on 01 Jun 2013

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc