node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »



NPM version Build status Coveralls status

Open git/hg/svn remote url from web browser.


  • Mac OS X
  • Windows
  • Linux/Unix


  • git
  • hg
  • svn


If you use GitBucket, tell me.


$ npm install -g gitopen


$ git remote -v
origin (fetch)
origin (push)
$ git branch
* master
$ cd subdir
$ gitopen                       # Open git repository homepage, like:
$ gitopen :master               # Open git repository on given branch name.
$ gitopen -b master             # Same the `:master`
$ gitopen issues                #
$ gitopen #1                    #
$ gitopen pr                    # New a pull-request
$ gitopen !1                    # Open merge/pull request by id.
$ gitopen prs                   #, alias `pulls`, `mrs`.
$ gitopen wiki                  # Open wiki pages.
$ gitopen release               # Open releases page.
$ gitopen tags                  # Open tags page.
$ gitopen commits               # Open commits page.
$ gitopen brs                   # Open branches page, alias `branchs` and `branches`.
$ gitopen {hash}                # Open commit page by hash code.
$ gitopen             # Open remote blob url. default use current working branch.
$ gitopen -b branch   # Open remote blob url by given branch.
$ gitopen :branch     # Open remote blob url by given branch.
$ gitopen path/to/dir           # Open remote tree url. default use current working branch.
# global command.
$ gitopen @lizzie               #
$ gitopen @hotoo/gitopen        #


Default support,,,,, and CSDN.

If you use GitHub Enterprise, GitLab Community Edition (CE), GitLab Enterprise Edition (EE), Atlassian Stash, GitCafe Enterprise you need config like:

  type: github
  protocol: https
  type: gitlab
  protocol: http
  •, is you git web server domain.
    • type is the type of you git web server, support github, gitlab, gitbucket, coding, oschina, csdn.
    • protocol: protocol of you git web server, http or https.

Else if you use other custom web system build you owner git server, you need config like:
  type: custom
  protocol: http
    issues: /path/to/issues
    wiki: /path/to/wikis
    more: [reference to github scheme](./lib/scheme/github.js)

You can git alias in ~/.gitconfig:

  open = !gitopen

Then you can use command like:

$ git open

gitopen Commands

$ gitopen

Open git repository homepage.

$ gitopen issues

Open git repository issues list page.

$ gitopen issue [title]

Open new issue with title (optional).

$ gitopen #1

Open git repository issue by id.

$ gitopen pulls

Open git repository pulls list page.

$ gitopen pull [branch-name]

Open pull request or merge request from given branch or current working branch for git repository.


  • $ gitopen pr
  • $ gitopen mr

for example:

$ gitopen pr        # current working branch to compare default branch.
$ gitopen pr a      # given branch(a) to compare default branch.
$ gitopen pr a b    # branch b to compare branch a.
$ gitopen pr a...b  # branch b to compare branch a.

$ gitopen !1

Open git repository pull request or merge request by id.


  • $ gitopen pr1
  • $ gitopen mr#1

support @, /, #, :, - or without sparator.

$ gitopen commits

Open git repository commits list page.


  • $ gitopen commit
  • $ gitopen ci

$ gitopen {hash}

Open commit page by hash code.

$ gitopen wiki

Open git repository wiki home page.


  • $ gitopen wikis

$ gitopen tags

Open git repository tags list page.


  • $ gitopen tag

$ gitopen milestones

Open git repository milestones list page.

$ gitopen milestones@id

Open git repository milestones by given id.


  • $ gitopen milestone@id

support @, /, #, :, - sparator.

$ gitopen milestone

Open new milestone for git.

$ gitopen releases

Open git repository releases list page.


  • $ gitopen release

$ gitopen release new [tag-name]

Open new release by tag name.

$ gitopen release edit

Edit release by tag name.

$ gitopen filename [--branch ]

Open given file on given branch, default use current working branch.


  • $ gitopen filename :branch
  • $ gitopen filename -b branch

$ gitopen directory [--branch ]

Open given directory on given branch, default use current working branch.


  • $ gitopen directory :branch
  • $ gitopen directory -b branch

$ gitopen snippet

[LOCAL COMMAND] Open new snippet.



  • $ gitopen snip
  • $ gitopen gist

$ gitopen network

Open network page.

$ gitopen @profile

[GLOBAL COMMAND] Open profile page on GitHub.

$ gitopen @profile/repository-name

[GLOBAL COMMAND] Open given repository homepage on GitHub.

hgopen Commands

Support all of gitopen in repository local commands (not support global commands), like:

  • $ hgopen open homepage.
  • $ hgopen issues open issues list page.
  • $ hgopen #id op issues by id.
  • ...

svnopen Commands

$ svnopen

Open svn repository on current working directory.


-p, --path

Specify file/directory path, default is current working directory.

If you want open a file or directory name is reserved words, like issues and pr, you can use --path option instead.

$ gitopen -p issues
$ gitopen --path pr

-b, --branch

Specify git/hg branch name, default is current working branch.

-r, --remote

Specify git remote name, default is origin.

-v, --verbose

Display detail information for debug.




If this tool is useful for you, please Star this repository.

And maybe you want to donate me via Alipay / WeChat:, WeChat:hotoome

or donate to my wife @lizzie, WeChat:SunsetSunrising

Thank you.