ghinit is a Python CLI for creating GitHub repositories and bootstrapping the
current directory without leaving the terminal.
It wraps gh and git, adds interactive prompts with sensible defaults, and
can scaffold a starter project template before the first push.
- Create a GitHub repo from the terminal with one command.
- Avoid the repeated
git init,git add,git commit, remote setup, and push flow. - Reuse starter templates for APIs, CLIs, frontends, and ML projects.
- Keep defaults in
~/.ghinit.tomlso repeated setup takes less time.
- Python 3.8+
gitghauthenticated withgh auth login
From PyPI:
pip install ghinitFor local development:
pip install -e ".[dev]"If your shell does not find the installed repo command, add:
export PATH="$HOME/.local/bin:$PATH"Create a repo with guided prompts:
repoCreate a private Flask project without confirmation:
repo my-api --private --template flask --yesCreate a public React repo and open it in the browser after push:
repo my-ui --public --template react --openWhen you run repo, ghinit:
- Verifies
gitandghare installed and thatghis authenticated. - Creates the remote GitHub repository with
gh repo create. - Applies an optional bundled or custom template.
- Fetches a
.gitignoresuggestion from GitHub's gitignore templates API. - Initializes the local git repository, commits, adds the remote, and pushes.
Create a repository in the current directory.
Options:
--publiccreate a public repository--privatecreate a private repository--template <name>choose a scaffold template-y, --yesskip the confirmation prompt--openopen the repository in the browser after a successful push--versionprint the installed version
View or update persistent defaults stored in ~/.ghinit.toml.
Examples:
repo config
repo config --show
repo config --resetConfig shape:
[defaults]
visibility = "private"
template = "none"
remote = "origin"
[templates]
custom_dir = "~/my-templates"List the available built-in templates plus any templates discovered in the configured custom template directory.
flask: Minimal Flask API with a health check routefastapi: Minimal FastAPI servicereact: React + Vite starterdjango: Minimal Django project scaffoldcli: Click-based Python CLI scaffoldml: Notebook-first machine learning project scaffold
Templates can declare metadata through template.toml and may use:
{{repo_name}}{{author}}
These variables are rendered into file contents and template paths during copy.
Set a custom template directory:
repo configPoint custom_dir to a folder that contains one subdirectory per template. Each
template can include a template.toml file:
[meta]
name = "Internal API"
description = "Company starter service"
language = "Python"
post_install = "Run: uv sync"Run tests:
python -m unittest discover -s tests -vBuild a distribution locally:
python -m buildThe repository includes GitHub Actions workflows for:
- running tests on every push and pull request
- building and publishing to PyPI when a tag like
v1.0.0is pushed
To publish a release:
- Update code and docs.
- Push to
mainand confirm CI passes. - Create and push a version tag:
git tag v1.0.0
git push origin v1.0.0- Ensure the repository has a
PYPI_API_TOKENsecret configured.
The README is prepared for a future GIF or terminal recording section. No demo asset is bundled in the repository yet.