ghinit
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.
Why ghinit
- 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.
Requirements
- Python 3.8+
gitghauthenticated withgh auth login
Install
From PyPI:
pip install ghinit
For local development:
pip install -e ".[dev]"
If your shell does not find the installed repo command, add:
export PATH="$HOME/.local/bin:$PATH"
Quick Start
Create a repo with guided prompts:
repo
Create a private Flask project without confirmation:
repo my-api --private --template flask --yes
Create a public React repo and open it in the browser after push:
repo my-ui --public --template react --open
How It Works
When 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.
Commands
repo
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
repo config
View or update persistent defaults stored in ~/.ghinit.toml.
Examples:
repo config
repo config --show
repo config --reset
Config shape:
[defaults]
visibility = "private"
template = "none"
remote = "origin"
[templates]
custom_dir = "~/my-templates"
repo templates
List the available built-in templates plus any templates discovered in the configured custom template directory.
Built-In Templates
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.
Custom Templates
Set a custom template directory:
repo config
Point 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"
Development
Run tests:
python -m unittest discover -s tests -v
Build a distribution locally:
python -m build
Release Process
The 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.
Demo
The README is prepared for a future GIF or terminal recording section. No demo asset is bundled in the repository yet.
Metadata
Release files for ghinit 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| ghinit-1.0.1.tar.gz | 21.3 kB | Without provenance | Details for ghinit-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| ghinit-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for ghinit-1.0.1-py3-none-any.whl |
Total release size: 43.6 kB
Release files / ghinit-1.0.1.tar.gz
| Download URL | ghinit-1.0.1.tar.gz |
|---|---|
| Size | 21.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5fb83862b54eb81434ac9b5016260bd1eb81e76111e76c65daf10a8b42e12eb0
|
|
BLAKE2b-256 checksum How to use checksums |
9be1db768fa4859d263acd3da04533ca90e9d64cabcaa35a3f335f3166df7611
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Release files / ghinit-1.0.1-py3-none-any.whl
| Download URL | ghinit-1.0.1-py3-none-any.whl |
|---|---|
| Size | 22.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
bf30b33134d7118a437b75cbd04158203cb8ff67b0d85de1c66ba933f431e0cf
|
|
BLAKE2b-256 checksum How to use checksums |
3bc8241e885eeec15fa1782dca5c949540c80936d762d9658b283f3d9e0b5d52
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.13
|
Security for ghinit 1.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.