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

@tigtech/tig

v1.0.2

Published

Automatic AI context capture via post-commit hook for Cursor IDE

Readme

Tig - Automatic AI Context Capture

Tig automatically captures Cursor AI chats, code diffs, and commit context using post-commit git hooks with cloud storage via Supabase edge functions.

Features

  • Automatic Capture: Saves context on every commit via post-commit hook
  • Cloud Storage: Stores data in Supabase cloud storage via edge functions
  • Cursor Integration: Extracts AI chats directly from Cursor's SQLite database
  • No Manual Logging: Completely automatic - no need to remember to log interactions
  • Comprehensive Context: Includes commit info, changed files, diffs, and AI conversations
  • Simple & Clean: No local files or UUIDs - everything stored in the cloud
  • GitHub OAuth: Secure authentication with GitHub using OAuth device flow
  • PR View: Automatic comment on PRs with link to view all interactions from that PR
  • Tig Blame: Map any line of code back to the AI interaction that created it

Installation

Install globally via npm:

npm install -g @tigtech/tig

Quick Start (NPM Installation)

After installing via npm:

  1. Login to Tig with GitHub:

    tig login
  2. Run setup:

    tig setup

    During setup, you'll interactively select which AI platforms to extract from:

    • Cursor (enabled by default)
    • Claude Code (disabled by default)

    Use arrow keys and space to toggle, Enter to confirm.

  3. Start committing - Tig will automatically capture context on every commit!

Notes:

  • GitHub authentication is required for private repositories.
  • Tig setup automatically checks if the Tig Connector GitHub App is installed on your repository. If missing, it will:
    • Open the installation page in your browser
    • Wait for you to complete the installation
    • Verify and continue setup automatically
  • The GitHub App is required for automatic branch updates after PR merges.
  • For headless environments, use tig setup --no-interactive to skip prompts and use defaults.

How It Works

Post-Commit Hook

After you commit, the git hook automatically:

  1. Extracts all chats related to your project
  2. Captures current commit information (hash, message, author, changed files)
  3. Caches interactions in ~/.tig/config.json

Pre-Push Hook

  1. Sends data to Supabase cloud storage via edge function
  2. Logs success/failure status

Usage

Automatic (Recommended)

Just commit normally - context is saved automatically:

# Make your changes
git add .
git commit -m "Add authentication system"
git push origin main

Manual Commands

# Check setup status
tig status     # Verify Tig status

# Resolve code to AI interactions
tig blame path/to/file.py:42  # Find the exact prompt which generated a line of code

# Bulk upload all existing chats
tig upload-chats  # Upload all chats with a synthetic upload-chats commit

# GitHub OAuth authentication
tig login      # Login to GitHub using OAuth device flow
tig whoami     # Show current GitHub username
tig logout     # Logout from GitHub

# Uninstall from a repository
tig uninstall  # Remove git hooks from current repository

Tig Blame: Code-to-Conversation Resolution ✨

Tig blame maps any line of code back to the AI interaction that created it:

# Find which AI interaction introduced a specific line
tig blame src/app.py:127

# Real example output:
# File: src/app.py:127
# Commit: abc123def456
# Found 1 matching interaction(s):
#
# 1. Interaction: uuid-1234
#    Preview: Add user authentication with JWT tokens...
#    Link: https://app.usetig.dev/conversations/conv-id?interaction=uuid-1234

See documentation/database/blame/ for performance optimization options.

PR View: Automatic Comment Linking ✨ NEW

When you create a pull request, Tig automatically posts a comment with a link to view all AI interactions from commits in that PR:

How it works:

  1. Create a PR as usual on GitHub
  2. Tig GitHub App automatically detects the PR
  3. If interactions exist for commits in the PR, a comment is posted with a link
  4. Click the link to view all interactions chronologically in the Tig web app

Example:

PR created: feature/auth → main
↓
Tig posts comment: https://app.usetig.dev/repos/owner/repo/pulls/123
↓
Click link to see all AI interactions from this PR

Requirements:

  • Tig GitHub App must be installed on your repository
  • tig setup handles this automatically during installation

The PR view shows:

  • All AI interactions from commits in the PR
  • Chronological timeline of prompts and responses
  • Links to related conversations and commits
  • Clean, unified view of the development process

Bulk Upload Existing Chats

After setting up Tig in an existing project, you can backfill all your historical Cursor chats using:

tig upload-chats

This command:

  • Extracts all Cursor chat interactions for your project
  • Creates a synthetic commit with ID like 'upload-chats-<mock_commit_hash>'
  • Sets the commit timestamp to include all discovered chats
  • Uploads everything to Supabase in one bulk operation

Note: This is useful when you've been using Cursor for a while and want to capture all past AI interactions. The synthetic commit allows you to view all historical chats in your Tig dashboard.

Uninstalling from a Project

To remove Tig from a specific repository:

tig uninstall

This command will:

  • Remove the pre-commit and post-commit hooks from .git/hooks/
  • Only remove hooks that were created by Tig (verifies before removing)
  • Preserve all previously uploaded data in cloud storage
  • Keep your GitHub authentication (use tig logout to remove separately)

Complete Removal

To completely remove Tig from your system:

  1. Remove from each repository (where you've run tig setup):

    cd /path/to/your/project
    tig uninstall
  2. Logout from GitHub:

    tig logout
  3. Uninstall the npm package:

    npm uninstall -g tig-cursor

Note: Uninstalling does not delete your data from cloud storage. All previously captured interactions remain accessible in your Supabase dashboard.

GitHub OAuth Authentication

Tig supports secure authentication with GitHub using OAuth device flow:

Login

tig login

This will:

  1. Start the GitHub OAuth device flow
  2. Display a verification URL and code (e.g., https://github.com/login/device and code XXXX-XXXX)
  3. Wait for you to authorize the app in your browser
  4. Store the access token locally in ~/.tig/config.json

Check Login Status

tig whoami

Shows your GitHub username if logged in, or "Not logged in" if not authenticated.

Logout

tig logout

Clears the stored GitHub token and logs you out.

Token Storage

  • Tokens are stored securely in ~/.tig/config.json
  • The file contains a JSON object with a github_token property
  • Tokens are automatically validated when used
  • Tokens require user:email and repo scopes for full functionality
  • The repo scope is needed to access private repositories and organization repositories

Troubleshooting

GitHub Authentication Issues

Error: "Repository not found or not accessible"

  • Make sure you're logged in: tig login
  • Ensure your token has the repo scope (required for private repos and org repos)
  • If you previously logged in with insufficient scopes, run: tig logout then tig login

Error: "GitHub token expired or invalid"

  • Run tig logout then tig login to re-authenticate

Error: "Access denied to repository"

  • Check if you have access to the private repository
  • Ensure your GitHub token has the repo scope
  • For organization repositories, make sure you're a member with appropriate permissions