An automation for GitHub repository creation, both in GitHub and locally in your chosen path.
You need to install the PyGithub package.
pip3 install PyGithub
or:
pip install PyGithub
... and fzy
and git
.
- After cloning the project:
-
create GitHub toke and edit
config.py
:github_token = "ghp_.........................."
-
and add your credentials.
- Then, just run
python3 github-repo.py
github-repo.py [org name [repo name]]
- default
repo_name
is actual directory name ...
as'org name'
mean interactive choice
./github-repo.py 'org name'
./github-repo.py ...
./github-repo.py 'org name' repo_name
./github-repo.py ... repo_name
Create an alias for it in your .zshrc
or .bashrc
.
For example, in my case I created this:
alias gh-repo="python3 ~/lib/github-repo-autocreate/github-repo.py"
or
cd ~/.local/bin
ln -s ~/lib/github-repo-autocreate/github-repo.py gh-repo
So now whenever I type gh-repo
in my terminal
I'm able to create the repo in just a few seconds.
This small project was possible with the help of the great package PyGithub.