Skip to content

Commit

Permalink
docs(readme): add npx use examples (#532)
Browse files Browse the repository at this point in the history
closes #502
  • Loading branch information
giocodes authored and jimthedev committed Jun 18, 2018
1 parent d103b10 commit d5b8bc5
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion README.md
Expand Up @@ -14,6 +14,18 @@ npm install -g commitizen
#### Using the command line tool
Now, simply use `git cz` instead of `git commit` when committing.

_Alternatively_, if you are using **NPM 5.2+** you can [use `npx`](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) instead of installing globally:
```
npx git-cz
```
or as an npm script:
```json
...
"scripts": {
"commit": "npx git-cz"
}
```

When you're working in a Commitizen friendly repository, you'll be prompted to fill in any required fields and your commit messages will be formatted according to the standards defined by project maintainers.

[![Add and commit with Commitizen](https://github.com/commitizen/cz-cli/raw/master/meta/screenshots/add-commit.png)](https://github.com/commitizen/cz-cli/raw/master/meta/screenshots/add-commit.png)
Expand Down Expand Up @@ -101,7 +113,12 @@ Installing and running Commitizen locally allows you to make sure that developer

Install Commitizen with `npm install --save-dev commitizen`.

Once you have Commitizen installed as a local dev dependency you can execute `./node_modules/.bin/commitizen` or `./node_modules/.bin/git-cz` in order to actually use the commands.
On **NPM 5.2+** you can [use `npx`](https://medium.com/@maybekatz/introducing-npx-an-npm-package-runner-55f7d4bd282b) to initialize the conventional changelog adapter:
```
npx commitizen init cz-conventional-changelog --save-dev --save-exact
```

For **previous versions of NPM (< 5.2) ** you can execute `./node_modules/.bin/commitizen` or `./node_modules/.bin/git-cz` in order to actually use the commands.

You can then initialize the conventional changelog adapter using: `./node_modules/.bin/commitizen init cz-conventional-changelog --save-dev --save-exact`

Expand Down

0 comments on commit d5b8bc5

Please sign in to comment.