> ## Documentation index
> Fetch the complete documentation index at: https://upstash-context7-git-ctx7-4291-onprem-key-rotation-ecs-d-dae4a0.docs7.io/llms.txt
> Ask it with GET https://upstash-context7-git-ctx7-4291-onprem-key-rotation-ecs-d-dae4a0.docs7.io/ask?q=<keywords or question>. Short keywords rank best.
> Use these to discover all available pages before exploring further.
> Feature requests: https://upstash-context7-git-ctx7-4291-onprem-key-rotation-ecs-d-dae4a0.docs7.io/resources/feature-requests.md lists what users asked for and how to vote for a request or add one.
> Page rating: `GET https://upstash-context7-git-ctx7-4291-onprem-key-rotation-ecs-d-dae4a0.docs7.io/feedback?path=/howto/private-sources&helpful={true|false}&comment={comment}` records whether this page helped. The `comment` (URL-encoded, at most 500 characters) says what helped, or what was missing or wrong; a `helpful=false` rating needs it. It is anonymous and needs no key. Comments hold no code, secrets or personal data.

# Add Private Sources

> Add and manage private source documentation

Add private sources to Context7 to make your internal documentation available to AI coding agents. You can add sources from GitHub, GitLab, Bitbucket, other Git providers, Confluence, Notion, OpenAPI specifications, and PDF or DOCX files.

![Private Sources card showing a table of added sources and source type options](/images/dashboard/private-sources-card.png)

## Adding Private Sources

<Steps>
  <Step title="Open the Sources tab">
    Go to your teamspace's **Sources** tab.
  </Step>
  <Step title="Select a source type">
    Pick a source type on the **Add Private Source** card:

    - **GitHub** — connect your GitHub account and select a repository
    - **GitLab** — connect your GitLab account and select a project
    - **Bitbucket** — connect your Bitbucket account and select a repository
    - **Other Git** — add any Git repository by URL
    - **Confluence** — connect your Confluence workspace
    - **Notion** — connect your Notion workspace
    - **OpenAPI** — add an OpenAPI specification
    - **File** — upload PDF or DOCX files, or a folder
  </Step>
  <Step title="Authorize access">
    Authorize Context7 to access your source (if required).
  </Step>
  <Step title="Configure LLM analysis (optional)">
    For repositories with little or no written documentation, check **Generate docs** to have Context7 generate documentation from the source code. Also available as the `generateDocs` flag in the [API](/api-guide). You can turn **Generate docs** on or off later in the library's admin panel. Each refresh with new commits runs the agent again and is billed each time.
  </Step>
  <Step title="Submit for parsing">
    Submit the source for parsing.
  </Step>
</Steps>

<Note>You must have a Pro or Enterprise plan to add private sources. Public sources can be added from the [Add Library](https://context7.com/add-library) page.</Note>

## Source Management

### Refreshing Documentation

Keep your private documentation up to date:

1. **Click the refresh icon** next to the source
2. Context7 re-parses the source
3. **You're only charged for changed content** — cached pages are free

Uploaded files cannot be refreshed. To update one, upload the file again.

**When to refresh**:

- After major documentation updates
- After releasing new features
- When you notice outdated information

<Tip>Refresh private sources only after significant documentation changes to minimize costs.</Tip>

On Pro and Enterprise, private GitHub libraries can also refresh on a schedule or after every push. See [Automatic Refresh](/howto/automatic-refresh). To manage the list of private GitHub libraries from a manifest file, see [GitOps](/howto/gitops).

### Removing Sources

<Steps>
  <Step title="Delete the source">
    Click the trash icon next to the source.
  </Step>
  <Step title="Confirm deletion">
    Confirm in the modal. The source documentation becomes unavailable immediately.
  </Step>
</Steps>

<Warning>
  This action is permanent. The source will no longer be accessible via the API.
</Warning>

## Permissions

Access to private source management is restricted by role. Only Owners and Admins can add or remove private sources. All members, including Developers, can view and refresh private sources.

See [Teamspace Management](/howto/teamspace#roles) for the complete permissions table.

## Configuration

### Using `context7.json`

Add a `context7.json` file to your repository root for better control over parsing. Context7 reads this file only for repositories on github.com and gitlab.com:

```json
{
  "$schema": "https://context7.com/schema/context7.json",
  "projectTitle": "Your Project Name",
  "description": "Brief description of your project",
  "folders": ["docs", "guides"],
  "excludeFolders": ["tests", "dist", "node_modules"],
  "excludeFiles": ["CHANGELOG.md"],
  "rules": ["Always validate user input", "Use TypeScript strict mode"]
}
```

See the [Library Owners](/library-owners) page for complete configuration options.
