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

sanegit

v0.2.5

Published

SaneGit Command Assistant CLI

Readme

SaneGit

npm version npm downloads

🌐 Visit the website →

SaneGit is a CLI assistant that makes git usable by predicting problems, fixing them automatically, and explaining everything in plain English.

Stop struggling with cryptic git errors. SaneGit helps you understand repository state, avoid risky pushes, recover from failures, and commit with confidence.

Features

  • 🔍 Understand statesg status shows repository health in plain language
  • 📝 Smart commitssg commit proposes a message and file list; confirms before writing (requires a configured AI provider)
  • 🛡️ Safe pushessg push predicts risks and blocks unsafe operations
  • 🔧 Auto-recoverysg fix guides you through merge conflicts, detached HEAD, and more
  • 📊 What's the Fault?sg wtf diagnoses urgent problems; optional --learn (record fault signals) and --fix-ci (CI-focused remediation)
  • 🤖 AI-powered — OpenAI, Anthropic, Google (Gemini), Mistral, or a custom HTTP endpoint
  • 📖 Plain English — Structured output (summary, risk, recommendation, detail) across commands
  • 💾 Degrades gracefully — Rule-based fallbacks when AI is unavailable or not configured

📖 Full documentation

Quick Start

# Install from npm
npm install -g sanegit

# Check your repository state
cd my-project
sg status

# Configure AI provider (optional; needed for AI-heavy commands like explain/commit)
sg ai-configure --provider openai --credential-ref OPENAI_API_KEY

# Explore commands
sg explain        # Explain current changes (needs AI)
sg commit         # Proposed commit from staged changes (needs AI)
sg push           # Pre-push safety checks
sg check          # Merge readiness assessment
sg fix            # Recover from failures
sg undo           # List and apply safe rollbacks
sg wtf            # Diagnose problems; add --learn or --fix-ci as needed
sg ship           # Delivery flow; use sg ship --status to resume/track

Install

From npm (recommended):

npm install -g sanegit

From source:

git clone https://github.com/ntufar/sanegit.git
cd sanegit
npm install
npm run build
npm link

Commands at a Glance

| Command | Purpose | |---|---| | sg status | Repository state and next actions | | sg explain | Plain-English change explanation (AI) | | sg commit | Guided commit plan from staged changes (AI) | | sg push | Pre-push risk evaluation | | sg check | Merge readiness assessment | | sg fix | Guided recovery from common git failures | | sg undo | Safe rollback options with consequences | | sg wtf | Urgent diagnosis; --learn, --fix-ci | | sg sync | Preserve local work and synchronize with mainline | | sg ship | One-command delivery flow; --status for workflow state | | sg split | Propose logical commit groups from staged changes | | sg who | Collaborator ownership; optional --file (file or directory) | | sg queue --team | Merge queue impact and risk hints | | sg blame --file <path> --line <n> --explain | Line history with hosted context | | sg time-travel --to <ref> | Resolve refs safely, including natural-language targets | | sg pair | Pair sessions: --action start, status, or handoff (use --session with the latter two) | | sg doctor | Deep repository health diagnostics | | sg ai-configure | AI provider, --url for custom base URL, --credential-ref |

Configuration

SaneGit stores configuration in .sanegit/config.json (intended to be gitignored). Secrets are not stored in the file: pass a credential reference (environment variable name or keychain entry) via sg ai-configure --credential-ref …. Use --url with --provider custom for a custom API base URL.

sg ai-configure --provider openai --credential-ref OPENAI_API_KEY

# Add to .gitignore:
.sanegit/

Commands that depend on AI exit early with a clear message when no provider is configured; others use rule-based or hosted-context data where applicable.

Requirements

  • Node.js 22+ (see engines in package.json)
  • Git (any recent version)
  • Optional: API access for your chosen AI provider

Development

git clone https://github.com/ntufar/sanegit.git
cd sanegit
npm install

npm run build       # Compile TypeScript to dist/
npm run dev         # Run CLI via tsx (src/cli.ts)
npm run lint        # ESLint
npm run typecheck   # TypeScript --noEmit
npm run test        # Vitest (36 test files, 54 tests)
npm run format      # Prettier

# Focused suites (see package.json for more)
npm run test:unit
npm run test:integration
npm run test:contract

Contributing

Contributions are welcome! Please:

  1. Fork the repository
  2. Create a feature branch (git checkout -b feature/my-feature)
  3. Commit with descriptive messages
  4. Push and open a pull request

License

MIT — See LICENSE for details

Changelog

See CHANGELOG.md for release history.

Resources


Made with ❤️ to make git less frustrating.