Skip to content

About

Create a GitHub repo, init git, commit all files, and push - one command.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

2 Commits

Folders and files

Repository files navigation

github-repo-init

One command to create, init, commit & push any project to GitHub.

No gh CLI. No dependencies. Just Python.

Python License PyPI


What It Does

Drop this into any project folder, run it, and it will:

  1. Create a new GitHub repository (public or private)
  2. Init git if not already initialized
  3. Stage all files
  4. Commit with your message
  5. Push to GitHub

Done. Your project is live.

Installation

From source (recommended)

git clone https://github.com/CR3-Architect/github-repo-init.git
cd github-repo-init
pip install .

Or run directly without installing

git clone https://github.com/CR3-Architect/github-repo-init.git
cd github-repo-init
python -m github_repo_init.cli

Usage

Interactive mode (default)

Navigate to your project folder and run:

github-repo-init

It will walk you through:

  Repo name [my-project]: my-awesome-app
  Public or private? [public]: public
  Description (optional): A cool new project
  Commit message [Initial commit]: feat: initial release

Non-interactive mode (for scripts/CI)

Pass all flags to skip prompts:

github-repo-init -r my-project -m "Initial commit" --public -y

Command-line options

Flag Description Default
-r, --repo Repository name Current folder name
-m, --message Commit message Initial commit
-d, --description Repo description (none)
--private Create private repo false
--public Create public repo true
-t, --token GitHub token (from env/file)
-y, --yes Skip confirmations false
--version Show version —

GitHub Token Setup

The tool needs a GitHub Personal Access Token (PAT) to create repos and push.

Option 1: Environment variable

export GITHUB_TOKEN="ghp_xxxxxxxxxxxxxxxxxxxx"

Option 2: Saved file

The tool will prompt you to save your token to ~/.github_token (only you can read it).

Option 3: Pass with flag

github-repo-init -t ghp_xxxxxxxxxxxxxxxxxxxx

Creating a token

  1. Go to https://github.com/settings/tokens
  2. Click Generate new token → Generate new token (classic)
  3. Set a name and expiration
  4. Check repo scope (full control of private repos)
  5. Generate and copy

Examples

Create a public repo from current folder

cd my-project
github-repo-init
# Follow prompts → done

Create a private repo with a custom message

github-repo-init --private -m "feat: add authentication"

Use in a shell script

#!/bin/bash
cd /path/to/project
github-repo-init -r "my-app" -m "Initial commit" --public -y
echo "Repo is live!"

Use in CI/CD (GitHub Actions)

- name: Init and push
  env:
    GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
  run: |
    pip install github-repo-init
    github-repo-init -r my-app -m "Deploy" --private -y

Project Structure

github-repo-init/
├── github_repo_init/
│   ├── __init__.py      # Package metadata
│   ├── cli.py           # CLI entry point (argparse)
│   └── github.py        # GitHub API wrapper (stdlib only)
├── pyproject.toml       # Build config & metadata
├── requirements.txt     # Dependencies (none)
├── LICENSE              # MIT License
├── README.md            # This file
└── .gitignore

Requirements

  • Python 3.10+
  • Git installed and in PATH
  • GitHub account with a Personal Access Token

That's it. Zero Python dependencies — uses only the standard library.

Contributing

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/amazing)
  3. Commit (git commit -m 'Add amazing feature')
  4. Push (git push origin feature/amazing)
  5. Open a Pull Request

License

MIT License — see LICENSE for details.


Built with Python. No dependencies. Just works.

About

Create a GitHub repo, init git, commit all files, and push - one command.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages