UNPKG

1.9 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#### GitHub
13
14`hophop gh setup` to set the GitHub API access token
15
16##### For GitHub Enterprise repos
17
181. add `.hophoprc` file in repo root folder with a valid "apiUrl" key (ex: `https://my.custom.url/api/v3`)
192. run `hophop gh setup` as usual from inside the repo
20
21#### Toggl
22
23`hophop toggl setup` to set the Toggl API access token
24
25`hophop toggl install-hooks` to install the toggl git hooks
26
27## GitHub Workflow
28
29`hophop gh feature` to create a local branch referencing an open issue (or, optionally, create a new issue on the fly).
30
31`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.
32
33`hophop gh commit` to create a commit that closes an open issue.
34
35## Toggl
36
37`hophop toggl start` to start a time entry for an issue (only while on a branch)
38
39`hophop toggl misc` to start a generic time entry titled 'miscellaneous'
40
41`hophop toggl test` to start a time entry titled 'test'
42
43`hophop toggl stop` to stop the current time entry
44
45## zsh autocompletion
46After installing the package, an autocompletion file is available at
47```
48NPM_PREFIX/lib/node_modules/@buildo/hophop/_hophop
49```
50
51where `NPM_PREFIX` is usually `/usr/local` and it can be retrieved using `npm prefix -g`
52
53#### Installation using oh-my-zsh
54If you use [oh-my-zsh](https://github.com/robbyrussell/oh-my-zsh), installing the autocompletion is as easy as:
55```bash
56mkdir -p ~/.oh-my-zsh/custom/plugins/hophop
57ln -s `(npm prefix -g)`/lib/node_modules/@buildo/hophop/_hophop _hophop
58```
59
60Then enable the plugin in your `.zshrc`, for example:
61```bash
62plugins=(git brew hophop)
63```