GitHub Auto-Sync
Connect your repository once and keep documentation current automatically. Every push triggers re-indexing of changed files.
All Plans
GitHub Auto-Sync is available on all plans, including Free.
How It Works
┌─────────────────────────────────────────────────────────────┐ │ GITHUB SYNC WORKFLOW │ │ │ │ 1. Connect GitHub account in Snipara settings │ │ 2. Configure repository, branch, and path filters │ │ 3. Snipara fetches markdown files from your repo │ │ 4. Files are indexed with embeddings for semantic search │ │ 5. Manual sync or webhook triggers re-indexing │ │ 6. Only changed files are updated (incremental sync) │ └─────────────────────────────────────────────────────────────┘
Supported File Types
Snipara automatically syncs the following documentation file types:
What's NOT Synced
The following are automatically excluded from sync:
- Binary files - Images, PDFs, videos, compiled assets
- Large files - Files over 1MB
- Dependencies -
node_modules/,vendor/,.venv/ - Build outputs -
dist/,build/,.next/ - Version control -
.git/ - Minified files -
*.min.js,*.min.css - Lock files -
package-lock.json,yarn.lock,pnpm-lock.yaml
Viewing Sync Status
Check your sync status in the dashboard:
- Navigate to Project → Settings → GitHub
- View the sync panel showing:
- Last sync time - When docs were last updated
- Commit SHA - The Git commit that was synced
- Document count - Number of files indexed
- Yellow indicator means pending changes detected
- Click Sync Now to trigger a manual sync
Setup Guide
Step 1: Connect Your GitHub Account
- Go to Settings in your Snipara dashboard
- Click Connect GitHub in the Integrations section
- Authorize Snipara to access your repositories
Note
Snipara requests read-only access to your repositories. We never modify your code.
Step 2: Configure Repository
In your project settings, configure the GitHub sync:
| Setting | Description | Example |
|---|---|---|
| Repository | The owner/repo format | acme/docs |
| Branch | Branch to sync from (default: main) | main |
| Path Filter | Directory or glob patterns (comma-separated) | docs/ or **/*.md |
Step 3: Initial Sync
Click Sync Now to perform the initial sync. Snipara will:
- Fetch all matching files from your repository
- Create document records for each file
- Generate embeddings for semantic search
- Record the latest commit SHA for change detection
Path Filtering
You can limit which files are synced using path filters. Snipara supports both directory paths and glob patterns:
Directory Paths
docs/→ Syncs all files in docs/ and subdirectoriessrc/components/→ Syncs all files in src/components/Glob Patterns
*.md→ All .md files in root directory**/*.md→ All .md files in any directory (recursive)docs/**/*.mdx→ All .mdx files under docs/Multiple Filters
Separate multiple paths or patterns with commas:
docs/, README.md, CONTRIBUTING.md→ All docs + specific files**/*.md, **/*.mdx→ All markdown and MDX filesSync Behavior
Incremental Updates
Snipara uses content hashing to detect changes. On each sync:
Created
New files in the repo are added as documents
Updated
Changed files have their content and embeddings refreshed
Deleted
Removed files are deleted from your project
Sync Results
After each sync, you'll see a summary:
{
"message": "Sync completed",
"created": 5,
"updated": 2,
"deleted": 1,
"unchanged": 42,
"errors": []
}Manual vs Automatic Sync
| Method | Trigger | Use Case |
|---|---|---|
| Manual Sync | Click "Sync Now" in dashboard | Initial setup, one-time updates |
| Webhook Sync | GitHub push event | Automatic updates on every commit |
| API Sync | POST to /api/projects/:id/github | CI/CD integration |
API Reference
Get Sync Status
GET /api/projects/{projectId}/github
X-API-Key: rlm_...
Response:
{
"isGitHubConnected": true,
"project": {
"githubRepo": "acme/docs",
"githubBranch": "main",
"githubPath": "docs/",
"githubLastSyncAt": "2025-01-20T12:00:00Z",
"githubLastCommitSha": "abc123...",
"githubSyncEnabled": true,
"documentCount": 45
},
"branches": ["main", "develop"],
"hasChanges": true,
"latestSha": "def456..."
}Configure Sync
PUT /api/projects/{projectId}/github
Content-Type: application/json
{
"githubRepo": "acme/docs",
"githubBranch": "main",
"githubPath": "docs/",
"githubSyncEnabled": true
}Trigger Sync
POST /api/projects/{projectId}/github
Response:
{
"message": "Sync completed",
"created": 5,
"updated": 2,
"deleted": 1,
"unchanged": 42,
"errors": []
}Private Repositories
Snipara fully supports private repositories. When connecting your GitHub account, you grant read access to your private repos. The sync process:
- Uses your OAuth token to authenticate with GitHub API
- Falls back to Contents API when download URLs aren't available
- Decodes base64 content for private repo files
- Never stores your GitHub credentials - only OAuth tokens
Troubleshooting
| Issue | Cause | Solution |
|---|---|---|
| "GitHub account not connected" | No OAuth token found | Connect GitHub in Settings |
| "Repository not found" | Invalid repo or no access | Check repo name and permissions |
| "Failed to list branches" | Token expired or revoked | Reconnect GitHub account |
| 0 files synced | No matching files found | Check path filter and file extensions |
| Slow sync | Large repository | Use path filters to limit scope |
Rate Limiting
Snipara includes a 100ms delay between file downloads to avoid hitting GitHub's rate limits. For large repositories, consider:
- Using path filters to limit the number of files
- Syncing during off-peak hours
- Using a GitHub App (coming soon) for higher rate limits