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:

.md.mdx.markdown.txt.rst.adoc

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:

  1. Navigate to Project → Settings → GitHub
  2. 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
  3. Yellow indicator means pending changes detected
  4. Click Sync Now to trigger a manual sync

Setup Guide

Step 1: Connect Your GitHub Account

  1. Go to Settings in your Snipara dashboard
  2. Click Connect GitHub in the Integrations section
  3. 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:

SettingDescriptionExample
RepositoryThe owner/repo formatacme/docs
BranchBranch to sync from (default: main)main
Path FilterDirectory or glob patterns (comma-separated)docs/ or **/*.md

Step 3: Initial Sync

Click Sync Now to perform the initial sync. Snipara will:

  1. Fetch all matching files from your repository
  2. Create document records for each file
  3. Generate embeddings for semantic search
  4. 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 subdirectories
src/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 files

Sync 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

MethodTriggerUse Case
Manual SyncClick "Sync Now" in dashboardInitial setup, one-time updates
Webhook SyncGitHub push eventAutomatic updates on every commit
API SyncPOST to /api/projects/:id/githubCI/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:

  1. Uses your OAuth token to authenticate with GitHub API
  2. Falls back to Contents API when download URLs aren't available
  3. Decodes base64 content for private repo files
  4. Never stores your GitHub credentials - only OAuth tokens

Troubleshooting

IssueCauseSolution
"GitHub account not connected"No OAuth token foundConnect GitHub in Settings
"Repository not found"Invalid repo or no accessCheck repo name and permissions
"Failed to list branches"Token expired or revokedReconnect GitHub account
0 files syncedNo matching files foundCheck path filter and file extensions
Slow syncLarge repositoryUse 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

Next Steps