Skip to main content

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.toml so repeated setup takes less time.

Requirements

  • Python 3.8+
  • git
  • gh authenticated with gh 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:

  1. Verifies git and gh are installed and that gh is authenticated.
  2. Creates the remote GitHub repository with gh repo create.
  3. Applies an optional bundled or custom template.
  4. Fetches a .gitignore suggestion from GitHub's gitignore templates API.
  5. Initializes the local git repository, commits, adds the remote, and pushes.

Commands

repo

Create a repository in the current directory.

Options:

  • --public create a public repository
  • --private create a private repository
  • --template <name> choose a scaffold template
  • -y, --yes skip the confirmation prompt
  • --open open the repository in the browser after a successful push
  • --version print 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 route
  • fastapi: Minimal FastAPI service
  • react: React + Vite starter
  • django: Minimal Django project scaffold
  • cli: Click-based Python CLI scaffold
  • ml: 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.0 is pushed

To publish a release:

  1. Update code and docs.
  2. Push to main and confirm CI passes.
  3. Create and push a version tag:
git tag v1.0.0
git push origin v1.0.0
  1. Ensure the repository has a PYPI_API_TOKEN secret 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)

Source distribution for ghinit 1.0.1
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)

Table of built distributions (wheels) for ghinit 1.0.1
File Interpreter ABI Platform Actions
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.

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page