A simple Bash script to create a new GitHub repository using the GitHub API.
./create_repo [OPTIONS]
- -r, --repo: Repository name (required)
- -d, --description: Repository description
- -p, --private: Set repository as private
- -h, --help: Print this help message and exit
./create_repo -r my-new-repo -d "My awesome repository" -p
This will create a new GitHub repository named "my-new-repo" with the description "My awesome repository" and set it as private.
To authenticate with GitHub, the script uses a personal access token.
Ensure that you have a valid token and set it in the token
variable inside the script.
You can also set the github_token
environment variable, and the script will automatically use it.
export github_token= YOUR TOKEN
- Log in to your GitHub account.
- Go to the settings page by clicking on your profile picture in the top right corner and selecting "Settings".
- In the left sidebar, select "Developer settings".
- Click on "Personal access tokens".
- Click on "Generate token" button.
- Give a name to your token and select the scope of the token (permissions it will have).
- Click on "Generate token" button to create the token.
Contributions are welcome! Feel free to open issues, submit pull requests, or provide suggestions. Please follow the Contributing Guidelines.
This project is licensed under the MIT License