Cordyceps is a CLI tool that allows you to easily clone all the repositories in a GitHub organization with just one command.
In the series The Last of Us, Cordyceps is a fungus that infects humans and turns them into zombies. Similarly, Cordyceps is a tool that can "infect" your GitHub organization and clone all the repositories in it with ease.
- Clone this repository:
git clone https://github.com/camipozas/cordyceps.git
- Install the dependencies:
yarn install
- Create a GitHub Personal Access Token here, then add it to the
.env
file. You can also add the organization name, the path where you want to clone the repositories, and the branch you want to clone (default is Home).
There are two ways to do it in GitHub:
-
Fine-grained personal access tokens (beta): You can select the permissions you want to give to the token. Here y have to select in resource owner: your organization. Then you have to select the permissions you want to give to the token. In this case, you need to select repository access:
All repositories
.Then at repositories permissions you have to select:
- Commit statuses:
read-only
- Contents:
read-only
- Metadata:
read-only
- Pull requests:
read-only
- Commit statuses:
-
Personal access tokens (classic): Here are the permissions you need to give to the token:
- repo:
Full control of private repositories
- admin:org:
read:org
GITHUB_TOKEN=
- repo:
-
Build the project and install it globally:
yarn build
npm install -g .
Is important to know if you change the
.env
file you need to build the project again.
- Run the script:
cordyceps
- GitHub Organization: The name of the organization you want to clone.
- Folder: The path where you want to clone the repositories. If the folder doesn't exist, it will be created.
I want to clone all the repositories in the organization called test
into the folder ~/test
:
- Node.js
- Yarn
- If you select get all repositories, don't ask for the folder name.
- If you select break, don't ask GitHub organization or folder name.
- Add option to clone only specific repositories.
- Add option to clone repositories from multiple organizations.
- Improve error handling and messaging.
Contributions are welcome! If you'd like to contribute, please create a pull request with your proposed changes.
This project is licensed under the MIT License - see the LICENSE file for details.