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 🙏

© 2025 – Pkg Stats / Ryan Hefner

simple-git-manager

v1.0.0

Published

Cross-platform Git automation with auto-startup

Readme

Simple Git Manager - Cross-Platform Auto-Sync

A lightweight Git automation tool that works on laptops, phones, and desktops with automatic startup and intelligent sync workflow.

✨ Key Features

  • 🔄 Smart Sync Workflow: Pull → Commit → Push automatically
  • 📁 Multi-vault tracking - Monitor multiple folders
  • 📱 Cross-Platform: Windows, macOS, Linux, Android (via Termux)
  • 🚀 Auto-Startup: Starts automatically when device boots
  • ⏰ Periodic Sync: Automatic sync every 30 minutes
  • 🎯 Conflict Resolution: Intelligent stashing and merging
  • ⚙️ Configurable Git Operations: Custom commit messages, delays, and patterns
  • 📊 Real-time Monitoring: Track all Git operations
  • 🎯 Smart File Filtering: Include/exclude patterns using glob syntax
  • 🌐 Optional web UI: Manage vaults through browser
  • 🔧 Standalone Operation: Works without web interface for headless servers

🚀 Quick Setup

1. Install Dependencies

```bash npm install ```

2. Install as System Service (Auto-Startup)

```bash

Install auto-startup service

npm run install-service

Start immediately

npm start ```

3. Add Your First Vault

```bash

Add Obsidian vault with auto-sync

npm run cli add \ -n "My Notes" \ -p "/path/to/obsidian-vault" \ -r "https://github.com/username/notes.git"

Add project folder

npm run cli add \ -n "My Project" \ -p "/path/to/project" \ -r "[email protected]:username/project.git" ```

📱 Platform-Specific Setup

🖥️ Windows

```bash

Install Node.js from nodejs.org

Clone and setup

git clone cd simple-git-manager npm install npm run install-service ```

🍎 macOS

```bash

Install Node.js via Homebrew

brew install node

Setup

git clone cd simple-git-manager npm install npm run install-service ```

🐧 Linux

```bash

Install Node.js

sudo apt install nodejs npm # Ubuntu/Debian

or

sudo dnf install nodejs npm # Fedora

Setup

git clone cd simple-git-manager npm install npm run install-service ```

📱 Android (Termux)

```bash

Install Termux from F-Droid or Play Store

In Termux:

pkg install nodejs git git clone cd simple-git-manager npm install

Setup auto-start (add to ~/.bashrc)

echo "cd ~/simple-git-manager && npm start &" >> ~/.bashrc ```

🔄 Smart Sync Workflow

The application follows this intelligent workflow:

  1. 📥 Initial Pull: On startup, pull latest changes from all remotes
  2. 👀 File Watching: Monitor file changes in real-time
  3. 🔄 Auto-Sync on Changes:
    • Pull latest changes (with stashing if needed)
    • Commit local changes
    • Push to remote
  4. ⏰ Periodic Sync: Every 30 minutes, sync all vaults
  5. 🔧 Conflict Resolution: Automatic stashing and merging

🎯 Usage Options

1. CLI Commands (Recommended)

```bash

Vault Management

npm run cli add -n "Name" -p "/path" -r "remote-url" npm run cli list npm run cli remove

Manual Operations

npm run cli commit npm run cli push npm run cli pull

Service Management

npm run cli start # Start daemon npm run cli start --no-web # Headless mode npm run install-service # Install auto-startup npm run uninstall-service # Remove auto-startup

Status & Monitoring

npm run cli status ```

2. Programmatic API

```javascript const SimpleGitManager = require('./src/index')

const manager = new SimpleGitManager() await manager.start()

// Add vault await manager.addVault({ name: 'My Project', path: '/path/to/folder', remote_url: 'https://github.com/user/repo.git', auto_commit: true, auto_push: true, auto_pull: true })

// Manual operations await manager.commitVault(vaultId) await manager.pushVault(vaultId) await manager.pullVault(vaultId) ```

3. Web Interface

Access the web dashboard at http://localhost:3000:

  • 📊 Dashboard: View all vaults and their status
  • Add Vaults: Create new vaults through UI
  • 🔄 Manual Operations: Commit, push, pull buttons
  • 📝 Activity Log: Real-time operation history
  • ⚙️ Settings: Configure sync intervals and options

4. Headless Mode

```bash

Start without web interface

npm run cli start --no-web ```

🔧 Configuration

Auto-Generated Config (git-manager-config.json)

```json { "vaults": [ { "id": "uuid", "name": "My Vault", "path": "/absolute/path", "remote_url": "https://github.com/user/repo.git", "branch": "main", "auto_commit": true, "auto_push": true, "auto_pull": true, "enabled": true, "commit_delay": 5000, "include_patterns": "/*", "exclude_patterns": ".git/,node_modules/**,*.tmp" } ] } ```

Environment Variables

```env PORT=3000 # Web interface port WEB_ENABLED=true # Enable/disable web interface LOG_LEVEL=info # Logging level SYNC_INTERVAL=30 # Sync interval in minutes CONFIG_PATH=./git-manager-config.json # Configuration file path ```

File Patterns

Use glob patterns for include/exclude rules:

  • **/* - All files and directories
  • *.md - All Markdown files
  • **/*.js - All JavaScript files recursively
  • .git/** - Exclude Git directory
  • node_modules/** - Exclude Node.js modules
  • *.tmp,*.log - Exclude temporary and log files

Commit Message Templates

Use placeholders in commit messages:

  • {timestamp} - Current timestamp
  • {filesChanged} - Number of files changed
  • {files} - List of changed files

Example: Auto-commit: {filesChanged} files changed at {timestamp}

📡 API Endpoints (Web Interface)

Vaults

  • GET /api/vaults - List all vaults
  • POST /api/vaults - Create new vault
  • GET /api/vaults/:id - Get vault details
  • PUT /api/vaults/:id - Update vault
  • DELETE /api/vaults/:id - Delete vault
  • POST /api/vaults/:id/commit - Manual commit
  • POST /api/vaults/:id/push - Manual push
  • POST /api/vaults/:id/pull - Manual pull

System

  • GET /api/status - System status
  • GET /api/logs - Activity logs
  • GET /health - Health check

🛠️ Development

```bash

Development mode with auto-reload

npm run dev

Run CLI commands

npm run cli ```

Project Structure

``` src/ ├── core/ │ ├── git-manager.js # Main Git automation logic │ ├── file-watcher.js # File system monitoring │ └── config-manager.js # Configuration management ├── routes/ │ ├── vaults.js # Vault API endpoints │ ├── status.js # Status endpoints │ └── logs.js # Logging endpoints ├── utils/ │ └── logger.js # Winston logging setup └── index.js # Application entry point ```

🔒 Security & Authentication

Git Authentication Setup

HTTPS with Token: ```bash

GitHub Personal Access Token

git config --global credential.helper store

Then use: https://username:[email protected]/user/repo.git

```

SSH Keys: ```bash

Generate SSH key

ssh-keygen -t ed25519 -C "[email protected]"

Add to GitHub/GitLab

cat ~/.ssh/id_ed25519.pub

Use SSH URL: [email protected]:user/repo.git

```

🔍 Troubleshooting

Common Issues

  1. Permission Errors ```bash

    Fix file permissions

    chmod -R 755 /path/to/vault ```

  2. Git Authentication ```bash

    Test Git access

    git ls-remote https://github.com/user/repo.git ```

  3. Service Not Starting ```bash

    Check service status (Linux)

    systemctl --user status simple-git-manager

    Restart service

    npm run uninstall-service npm run install-service ```

  4. File Watching Limits (Linux) ```bash

    Increase inotify limits

    echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf sudo sysctl -p ```

Android/Termux Specific

```bash

Grant storage permissions

termux-setup-storage

Install required packages

pkg install nodejs git openssh

Setup SSH for Git

ssh-keygen -t ed25519 ```

🚀 Advanced Usage

Multiple Device Sync

  1. Setup on Device 1: ```bash npm run cli add -n "Shared Notes" -p "/path/to/notes" -r "repo-url" ```

  2. Setup on Device 2: ```bash

    Clone the repo first

    git clone repo-url /path/to/notes

    Add to Git Manager

    npm run cli add -n "Shared Notes" -p "/path/to/notes" -r "repo-url" ```

  3. Both devices will now auto-sync!

Custom Sync Intervals

```bash

Sync every 10 minutes

SYNC_INTERVAL=10 npm start

Disable periodic sync (only on file changes)

SYNC_INTERVAL=0 npm start ```

📝 License

MIT License - Use freely for personal and commercial projects.


Simple Git Manager - Keep your files in sync across all your devices! 🚀📱💻