UNPKG

2.04 kBMarkdownView Raw
1# Hophop
2![](https://img.shields.io/npm/v/@buildo/hophop.svg)
3
4A minimal tool to accelerate the GitHub workflow from the command line.
5
6## Installation
7
8`npm install -g @buildo/hophop` with a non-ancient version of `npm`
9
10## Config
11
12`hophop gh setup` to set the GitHub API access token
13
14`hophop gh setup [accountName]` to set up the GitHub Enterprise API access token
15 - the `[accountName]` parameter is for GitHub Enteprise support. Names are (currently) brutally hardcoded [here]( https://github.com/buildo/hophop/blob/master/src/utils/index.js#L71-L77).
16 - e.g. for omnilab, use `hophop gh setup omnilab`
17 - for github.com just leave out the parameter
18
19`hophop toggl setup` to set the Toggl API access token
20
21`hophop toggl install-hooks` to install the toggl git hooks
22
23## GitHub Workflow
24
25`hophop gh feature` to create a local branch referencing an open issue (or, optionally, create a new issue on the fly).
26
27`hophop gh pr` to push the current feature branch and, if needed, open a Pull Request. The name of the pull request will cause GH to auto-close the issue when the PR is merged.
28
29`hophop gh commit` to create a commit that closes an open issue.
30
31## Toggl
32
33`hophop toggl start` to start a time entry for an issue (only while on a branch)
34
35`hophop toggl misc` to start a generic time entry titled 'miscellaneous'
36
37`hophop toggl test` to start a time entry titled 'test'
38
39`hophop toggl stop` to stop the current time entry
40
41## zsh autocompletion
42After installing the package, an autocompletion file is available at
43```
44NPM_PREFIX/lib/node_modules/@buildo/hophop/_hophop
45```
46
47where `NPM_PREFIX` is usually `/usr/local` and it can be retrieved using `npm prefix -g`
48
49#### Installation using oh-my-zsh
50If you use [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh), installing the autocompletion is as easy as:
51```bash
52mkdir -p ~/.oh-my-zsh/custom/plugins/hophop
53ln -s `(npm prefix -g)`/lib/node_modules/@buildo/hophop/_hophop _hophop
54```
55
56Then enable the plugin in your `.zshrc`, for example:
57```bash
58plugins=(git brew hophop)
59```