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

gdit

v3.0.2

Published

πŸš€ Git-like version control for Google Drive. Stage, commit, and sync files using familiar Git commands.

Readme

πŸš€ gdit

Git-like Version Control for Google Drive

npm version TypeScript License: MIT

Stage β€’ Commit β€’ Push to Google Drive

Installation β€’ Quick Start β€’ Commands β€’ How It Works β€’ Contributing


🎯 What is gdit?

gdit is a command-line tool that brings familiar Git-like workflows to Google Drive. If you know Git, you already know gdit!

# Just like Git, but for Google Drive!
gdit add .
gdit commit -m "Add new feature"
gdit push

✨ Key Features

| Feature | Description | |---------|-------------| | πŸ“¦ Stage & Commit | Stage files and commit with messages, just like Git | | πŸš€ Smart Sync | Only uploads changed files (compares MD5 hashes) | | ⬇️ Pull & Clone | Download files from Drive or clone existing folders | | πŸ” Status & Diff | See what's changed between local and remote | | πŸ“œ Commit History | View your commit log with push status | | 🎯 Ignore Files | Support for .gditignore (like .gitignore) | | πŸ” Secure | OAuth 2.0 authentication, tokens stored locally | | 🎨 Beautiful CLI | Colorful output with spinners and progress bars |


πŸ“¦ Installation

npm install -g gdit

Requirements:

  • Node.js 18 or higher
  • A Google Cloud project (free)

πŸš€ Quick Start

Step 1: Set Up Google Credentials (One-time)

gdit setup-creds

This guides you through creating OAuth credentials. You'll need to:

  1. Go to Google Cloud Console
  2. Create a project (or use existing)
  3. Enable the Google Drive API
  4. Create OAuth 2.0 credentials (Desktop app)
  5. Copy your Client ID and Client Secret

Step 2: Login

gdit login

A browser window opens for Google authentication. After approval, you're ready!

Step 3: Initialize & Sync

# Create a new project
mkdir my-project && cd my-project

# Initialize gdit (creates a Drive folder)
gdit init

# Add all files
gdit add .

# Commit your changes
gdit commit -m "Initial commit"

# Push to Google Drive
gdit push

πŸŽ‰ That's it! Your files are now synced to Google Drive.


πŸ“‹ Commands

πŸ”§ Setup Commands

| Command | Description | |---------|-------------| | gdit setup-creds | Configure Google API credentials (one-time) | | gdit login | Authenticate with Google | | gdit logout | Remove stored tokens | | gdit whoami | Show current user info and storage usage |

πŸ“ Repository Commands

| Command | Description | |---------|-------------| | gdit init | Initialize a new repository (creates Drive folder) | | gdit clone <folder-id> | Clone an existing Drive folder | | gdit remote | Show remote folder info | | gdit remote open | Open Drive folder in browser |

πŸ“¦ Working with Files

| Command | Description | |---------|-------------| | gdit add <files...> | Stage specific files | | gdit add . | Stage ALL files | | gdit rm <files...> | Unstage files | | gdit reset | Clear the staging area |

πŸ“ Commits & Syncing

| Command | Description | |---------|-------------| | gdit commit -m "message" | Commit staged files | | gdit amend -m "message" | Change last commit message | | gdit push | Push commits to Google Drive | | gdit push -f | Force push ALL files | | gdit pull | Download files from Drive | | gdit pull --theirs | Always use remote version (conflicts) | | gdit pull --ours | Always keep local version (conflicts) |

πŸ“Š Information

| Command | Description | |---------|-------------| | gdit status | Show repository status | | gdit log | View commit history | | gdit log --files | Show files in each commit | | gdit log -n 5 | Show last 5 commits | | gdit diff | Compare local vs remote files |


🧠 How It Works

Architecture Overview

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                        YOUR COMPUTER                          β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                               β”‚
β”‚   my-project/                    ~/.gdit/                     β”‚
β”‚   β”œβ”€β”€ .gdit/          ───────►   β”œβ”€β”€ credentials.json        β”‚
β”‚   β”‚   β”œβ”€β”€ config.json            └── token.json              β”‚
β”‚   β”‚   β”œβ”€β”€ stage.json                  (global auth)          β”‚
β”‚   β”‚   β”œβ”€β”€ commits.json                                        β”‚
β”‚   β”‚   └── remote.json                                         β”‚
β”‚   β”œβ”€β”€ src/                                                    β”‚
β”‚   β”‚   └── index.ts                                           β”‚
β”‚   └── package.json                                            β”‚
β”‚                                                               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                            β”‚
                            β”‚ gdit push / pull
                            β–Ό
β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                      GOOGLE DRIVE                             β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚                                                               β”‚
β”‚   πŸ“ my-project/                                              β”‚
β”‚   β”œβ”€β”€ πŸ“„ src/index.ts                                        β”‚
β”‚   └── πŸ“„ package.json                                        β”‚
β”‚                                                               β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Workflow Diagram

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    gdit add     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   gdit commit   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”   gdit push   β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚   Working   β”‚ ──────────────► β”‚   Staging   β”‚ ──────────────► β”‚   Commits   β”‚ ────────────► β”‚   Google    β”‚
β”‚  Directory  β”‚                 β”‚    Area     β”‚                 β”‚   (Local)   β”‚               β”‚    Drive    β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                 β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜               β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
     β”‚                                                                                              β”‚
     β”‚                                              gdit pull                                       β”‚
     │◄──────────────────────────────────────────────────────────────────────────────────────────────

Smart Sync

gdit uses MD5 checksums to detect changes:

$ gdit push

[1/3] Processing src/index.ts...
  βœ“ Already up to date: src/index.ts    # Hash matches, skip
[2/3] Processing package.json...
  βœ“ Updated: package.json                # Hash differs, upload
[3/3] Processing README.md...
  βœ“ Created: README.md                   # New file, create

πŸ“Š Push Summary
━━━━━━━━━━━━━━━━━━━━
  βœ“ New files:     1
  ↻ Updated:       1
  β—‹ Skipped:       1

πŸ“ Project Structure

gdit/
β”œβ”€β”€ src/                      # TypeScript source code
β”‚   β”œβ”€β”€ index.ts              # CLI entry point
β”‚   β”œβ”€β”€ types/                # Type definitions
β”‚   β”‚   └── index.ts          # All TypeScript interfaces
β”‚   β”œβ”€β”€ core/                 # Core functionality
β”‚   β”‚   β”œβ”€β”€ config.ts         # Paths and constants
β”‚   β”‚   β”œβ”€β”€ auth.ts           # Google OAuth
β”‚   β”‚   └── drive.ts          # Drive API operations
β”‚   β”œβ”€β”€ commands/             # CLI commands
β”‚   β”‚   β”œβ”€β”€ init.ts           # gdit init
β”‚   β”‚   β”œβ”€β”€ stage.ts          # gdit add/rm/reset
β”‚   β”‚   β”œβ”€β”€ commit.ts         # gdit commit/amend
β”‚   β”‚   β”œβ”€β”€ push.ts           # gdit push
β”‚   β”‚   β”œβ”€β”€ pull.ts           # gdit pull/clone
β”‚   β”‚   β”œβ”€β”€ status.ts         # gdit status/log/diff
β”‚   β”‚   └── info.ts           # gdit whoami/remote
β”‚   └── utils/                # Utilities
β”‚       β”œβ”€β”€ ui.ts             # Terminal output
β”‚       β”œβ”€β”€ prompts.ts        # User input
β”‚       └── files.ts          # File operations
β”œβ”€β”€ dist/                     # Compiled JavaScript
β”œβ”€β”€ package.json              # Dependencies
β”œβ”€β”€ tsconfig.json             # TypeScript config
└── README.md                 # You're reading it!

πŸ“ Ignoring Files

Create a .gditignore file in your project root:

# Dependencies
node_modules

# Build output
dist
*.min.js

# IDE
.vscode
.idea

# OS files
.DS_Store
Thumbs.db

# Logs
*.log
npm-debug.log*

# Environment
.env
.env.local

Default ignored patterns:

  • .gdit/ (gdit config)
  • .git/ (git directory)
  • node_modules/
  • Hidden files (starting with .)

πŸ” Security

Where are my credentials stored?

| File | Location | Contains | |------|----------|----------| | credentials.json | ~/.gdit/ | Your OAuth Client ID & Secret | | token.json | ~/.gdit/ | OAuth access & refresh tokens |

⚠️ Important

  • Never share your credentials.json or token.json
  • Each user must create their own OAuth credentials
  • Tokens are refreshed automatically when expired

Revoking Access

To revoke gdit's access to your Google account:

  1. Go to Google Account Security
  2. Find "gdit" in the list
  3. Click "Remove Access"

Then locally:

gdit logout

πŸ› οΈ Development

Building from Source

# Clone the repository
git clone https://github.com/your-username/gdit.git
cd gdit

# Install dependencies
npm install

# Build TypeScript
npm run build

# Link for local testing
npm link

# Now you can use `gdit` globally
gdit --version

Development Mode

# Watch mode - recompiles on changes
npm run dev

Testing

npm test

🀝 Contributing

Contributions are welcome! Please read our Contributing Guide first.

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

πŸ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ™ Acknowledgments

Built with these awesome libraries:


Made with ❀️ for developers who love both Git and Google Drive

⬆ Back to Top