npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

git-init-simple

v0.1.0

Published

Git configuration, but explicit. No magic, just the commands you'd run by hand.

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 main

This 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-simple

Usage

Check status

git-init-simple doctor

Output:

[✔] 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-run

This shows what would happen without making changes.

Configure Git (for real)

git-init-simple config

Interactive prompts will ask for:

  • user.name
  • user.email
  • init.defaultBranch (default: main)

Safety

Before making changes, git-init-simple automatically backs up your .gitconfig:

~/.gitconfig.backup.2026-01-29T04-15-08

How it works:

  1. Shows your current config
  2. Asks for new values (name, email, branch)
  3. Only after all inputs are complete, backs up your .gitconfig
  4. Applies the changes

If you press Ctrl+C during input:

  • No backup is created
  • No changes are made
  • Your .gitconfig stays 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 restore

Select 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 command

Total: ~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, wraps child_process
  • core/prompt.ts - 30 lines, wraps readline
  • core/os.ts - 20 lines, wraps os

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