Package Exports
- @tigtech/tig
- @tigtech/tig/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@tigtech/tig) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
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/tigQuick Start (NPM Installation)
After installing via npm:
Login to Tig with GitHub:
tig login
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.
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-interactiveto skip prompts and use defaults.
How It Works
Post-Commit Hook
After you commit, the git hook automatically:
- Extracts all chats related to your project
- Captures current commit information (hash, message, author, changed files)
- Caches interactions in ~/.tig/config.json
Pre-Push Hook
- Sends data to Supabase cloud storage via edge function
- 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 mainManual 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 repositoryTig 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-1234See 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:
- Create a PR as usual on GitHub
- Tig GitHub App automatically detects the PR
- If interactions exist for commits in the PR, a comment is posted with a link
- 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 PRRequirements:
- Tig GitHub App must be installed on your repository
tig setuphandles 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-chatsThis 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 uninstallThis 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 logoutto remove separately)
Complete Removal
To completely remove Tig from your system:
Remove from each repository (where you've run
tig setup):cd /path/to/your/project tig uninstallLogout from GitHub:
tig logoutUninstall 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 loginThis will:
- Start the GitHub OAuth device flow
- Display a verification URL and code (e.g.,
https://github.com/login/deviceand codeXXXX-XXXX) - Wait for you to authorize the app in your browser
- Store the access token locally in
~/.tig/config.json
Check Login Status
tig whoamiShows your GitHub username if logged in, or "Not logged in" if not authenticated.
Logout
tig logoutClears 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_tokenproperty - Tokens are automatically validated when used
- Tokens require
user:emailandreposcopes for full functionality - The
reposcope 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
reposcope (required for private repos and org repos) - If you previously logged in with insufficient scopes, run:
tig logoutthentig login
Error: "GitHub token expired or invalid"
- Run
tig logoutthentig loginto re-authenticate
Error: "Access denied to repository"
- Check if you have access to the private repository
- Ensure your GitHub token has the
reposcope - For organization repositories, make sure you're a member with appropriate permissions