Using the All Contributors CLI
All Contributors command line interface commands
섹션 제목: “All Contributors command line interface commands”You will mostly use four commands:
| Command | What it does |
|---|---|
init |
Prepare a project to use the CLI |
add |
Add a contributor or update their contribution types |
check |
Find contributors who are not yet acknowledged |
generate |
Regenerate the contributor tables and badge |
all-contributors init
섹션 제목: “all-contributors init”You can run all-contributors init when you first start using the All Contributors CLI. This command asks you a few questions and then sets up the project to support All Contributors.
npx all-contributors initpnpm dlx all-contributors inityarn dlx all-contributors initThe setup includes creating:
- an
.all-contributorsrcconfiguration file and - a contributor table in the
filesyou specify.
The default file for the contributor table is your README.md.
all-contributors add
섹션 제목: “all-contributors add”Use the add command to add:
- new contributors to your project, or
- new ways in which they have contributed.
If you run add without a username, the CLI asks who to add and which
contribution types to record.
npx all-contributors add? What is the contributor's GitHub username? lwasser? What are the contribution types? 💻 Code, 📖 DocumentationIf you pass a username and one or more contribution types, the CLI adds that person without those prompts. For instance, someone may already be credited for code, and you later want to credit a documentation pull request too. The contributor is updated in your configuration file, and the contributors file is updated just as if you used the generate command.
# Add new contributor <username>, who made a contribution of type <contribution>npx all-contributors add <username> <contribution># Example:npx all-contributors add jfmengels code,doc# Add new contributor <username>, who made a contribution of type <contribution>pnpm dlx all-contributors add <username> <contribution># Example:pnpm dlx all-contributors add jfmengels code,doc# Add new contributor <username>, who made a contribution of type <contribution>yarn dlx all-contributors add <username> <contribution># Example:yarn dlx all-contributors add jfmengels code,docWhere username is the user’s GitHub or Gitlab username, and contribution is a
,-separated list of contributions. See the Emoji Key (Contribution Types Reference)
for a list of valid contribution types.
all-contributors check
섹션 제목: “all-contributors check”Use check to compare people who have commits on GitHub or GitLab with
the ones credited in your .all-contributorsrc file.
The command prints two lists when it finds a mismatch: people who have
commits but are missing from .all-contributorsrc, and people credited
for code or tests who have no matching commits.
Missing contributors in .all-contributorsrc:octocat
Unknown contributors found in .all-contributorsrc:ghostnpx all-contributors checkpnpm dlx all-contributors checkyarn dlx all-contributors checkall-contributors generate
섹션 제목: “all-contributors generate”Use generate to read the contributors list from your .all-contributorsrc file
and update the contributor tables specified by the files key.
npx all-contributors generatepnpm dlx all-contributors generateyarn dlx all-contributors generate코맨드가 목록을 갱신하기 위해서는 해당 파일에서 다음 태그를 찾을 수 있어야 합니다.
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --><!-- ALL-CONTRIBUTORS-LIST:END -->또한 배지를 업데이트하기 위해서는 다음 태그를 찾을 수 있어야 합니다.
<!-- ALL-CONTRIBUTORS-BADGE:START - Do not remove or modify this section --><!-- ALL-CONTRIBUTORS-BADGE:END -->GitHub 사용자
섹션 제목: “GitHub 사용자”In some cases you may see the error message GitHub API rate limit exceeded for xxx. You may need to set an environment variable named PRIVATE_TOKEN to circumvent this GitHub rate limit.
Private Token은 GitHub API에서 인증을 위해 사용하는 개인 액세스 토큰(Personal Access Token, PAT)입니다.
GitLab 사용자
섹션 제목: “GitLab 사용자”Please note that if you are using a self-hosted GitLab instance,
If you are using a private repository, a self-hosted GitLab instance,
or encounter rate limits on GitLab.com, set an environment variable named PRIVATE_TOKEN.
# Linux에서 개인 토큰 설정export PRIVATE_TOKEN=your_private_token# Windows에서 개인 토큰 설정set PRIVATE_TOKEN=your_private_token