A Node.js CLI tool to automate initializing a local Git repository, configuring author identity, creating a corresponding GitHub repository, and pushing your code—all from the terminal.
- Node.js v18+
- Git installed and in your PATH
-
GitHub CLI (
gh
) installed and authenticated
You can use this tool directly via pnpm dlx
(recommended for one-off use):
pnpm dlx @emanuelsan/create-gh-repo
Or install globally:
pnpm add -g @emanuelsan/create-gh-repo
From any local project folder:
git-initializer
Example session:
? What should the repo be named? » my-new-project
? Visibility: ◉ private ○ public
? Description (optional): » CLI tool to create GitHub repos
...
✅ Git identity found: Emanuel Sandu <emanuel@example.com>
🔧 Initializing Git...
📦 Staging and committing files...
🚀 Creating and pushing GitHub repository...
✅ Done! Repository 'my-new-project' pushed to GitHub.
- Checks for Git and GitHub CLI (
gh
) - Prompts for repo name, visibility, and description (using Clack)
- Checks/validates global Git identity (
user.name
anduser.email
) - Initializes Git if missing, stages and commits all files
- Creates a GitHub repo and pushes code in one step
- Clear error handling and terminal output
MIT License