git-init-simple
v0.1.0
Published
Git configuration, but explicit. No magic, just the commands you'd run by hand.
Maintainers
Readme
git-init-simple
Git configuration, but explicit.
Why this exists
Most Git setup tutorials show you commands, then you copy-paste them.
This tool runs those commands, but shows you what it's doing.
The goal isn't convenience—it's transparency.
- No hidden configuration
- No opinionated defaults
- No "trust us, it just works"
You should understand what happens to your .gitconfig.
Philosophy
This tool does nothing magical. It only runs the commands you would type by hand.
- Every command is visible
- Every change is backed up
- Every action can be dry-run
- No dependencies (Node core only)
Why?
Git setup guides tell you to run these commands:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"
git config --global init.defaultBranch mainThis tool runs those commands for you, but shows you what it's doing.
If you want to understand what's happening, read src/git/config.ts.
If you want to customize it, fork it.
Install
npm install -g git-init-simpleUsage
Check status
git-init-simple doctorOutput:
[✔] Git installed (v2.43.0)
[✔] user.name = "your-set-name"
[✔] user.email = "your-set-email"
[✗] init.defaultBranch not set
Run 'git-init-simple config' to set up.Configure Git (dry-run first)
git-init-simple config --dry-runThis shows what would happen without making changes.
Configure Git (for real)
git-init-simple configInteractive prompts will ask for:
user.nameuser.emailinit.defaultBranch(default: main)
Safety
Before making changes, git-init-simple automatically backs up your .gitconfig:
~/.gitconfig.backup.2026-01-29T04-15-08How it works:
- Shows your current config
- Asks for new values (name, email, branch)
- Only after all inputs are complete, backs up your
.gitconfig - Applies the changes
If you press Ctrl+C during input:
- No backup is created
- No changes are made
- Your
.gitconfigstays untouched
This ensures you never end up with a half-configured state.
If something goes wrong, use git-init-simple restore to recover.
Restore from backup
git-init-simple restoreSelect from available backups and restore.
Commands
| Command | Description |
|---------|-------------|
| config | Set up Git configuration |
| config --dry-run | Show what would be configured (no changes) |
| doctor | Check Git installation and configuration |
| restore | Restore .gitconfig from backup |
Project Structure
git-init-simple/
├─ src/
│ ├─ core/ # Node standard library wrappers
│ │ ├─ exec.ts # Command execution
│ │ ├─ prompt.ts # User input
│ │ ├─ os.ts # Platform detection
│ │ └─ which.ts # Command availability check
│ ├─ git/ # Git domain logic
│ │ ├─ check.ts # Git installation check
│ │ ├─ install.ts # Installation guide
│ │ ├─ config.ts # Configuration operations
│ │ └─ backup.ts # Backup/restore
│ └─ cli/ # Command implementations
│ ├─ doctor.ts # Diagnostic command
│ ├─ config.ts # Configuration command
│ └─ restore.ts # Restore commandTotal: ~300 lines of TypeScript, zero dependencies.
Design Principles
1. No magic
Every Git command is visible. Use --dry-run to see exactly what will execute.
2. No auto-install
If Git isn't installed, we tell you how to install it. We don't install it for you.
3. No dependencies
Only Node.js core modules (child_process, fs, readline). No npm packages.
4. Easy to read
Each file is 20-50 lines, organized by responsibility (core/, git/, cli/).
For Developers
The src/core/ modules are deliberately simple and dependency-free.
You can copy them into your own CLI projects:
core/exec.ts- 50 lines, wrapschild_processcore/prompt.ts- 30 lines, wrapsreadlinecore/os.ts- 20 lines, wrapsos
No attribution required (MIT License).
License
MIT
Author
a-lost-social-misfit - Built with the philosophy: Terminal-first, No magic, Nothing hidden.
Repository
https://github.com/a-lost-social-misfit/git-init-simple
