CLIのインストール
This guide explains how you can add the Command Line Interface to your project.
-
How to Install the All Contributors CLI tool
The all-contributors CLI module is distributed via npm which is bundled with node and should be installed as one of your project’s
devDependencies.To install it run:
ターミナルウィンドウ npm i -D all-contributors-cliターミナルウィンドウ pnpm add -D all-contributors-cliターミナルウィンドウ yarn add -D all-contributors-cliAlternatively, Arch Linux users can install the
all-contributors-clipackage from the AUR. -
Initialize the Project
Run
initand answer a few questions. The command creates an.all-contributorsrcfile in the root of your project.ターミナルウィンドウ npx all-contributors initターミナルウィンドウ pnpm all-contributors initターミナルウィンドウ yarn all-contributors initターミナルウィンドウ ./node_modules/.bin/all-contributors initA typical session looks like this:
? What's the name of the repository? all-contributors? Who is the owner of the repository? all-contributors? What is the repository type? GitHub? Where is the repository hosted? Hit Enter if it's on GitHub or GitLab https://github.com? In which file should contributors be listed? README.md? Do you want a badge tallying the number of contributors? Yes? In which file should the badge be shown? README.md? How big should the avatars be? (in px) 100? Do you want this badge to auto-commit when contributors are added? Yes? What commit convention would you want it to use? Angular? Do you want to add a footer with link to usage? Yes -
コントリビューターを追加
ターミナルウィンドウ npx all-contributors add jfmengels docnpx all-contributors generateターミナルウィンドウ pnpm all-contributors add jfmengels docpnpm all-contributors generateターミナルウィンドウ yarn all-contributors add jfmengels docyarn all-contributors generateFor more on the commands see CLI usage.
-
コントリビューションドキュメントを更新
Consider updating your
CONTRIBUTING.mdor similar with steps on how your contributors can add themselves. You can even link to the cli usage documentation. -
Optionally add shortcut scripts to your
package.jsonYou can optionally add shortcuts to your commands in your
package.jsonscriptsfield.例:
package.json {"scripts": {"contributors:add": "all-contributors add","contributors:generate": "all-contributors generate"}}To support shortcuts such as:
ターミナルウィンドウ npx contributors:add jfmengels docターミナルウィンドウ pnpm contributors:add jfmengels docターミナルウィンドウ yarn contributors:add jfmengels doc
