> ## Documentation Index
> Fetch the complete documentation index at: https://context7.com/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Library Import

> Move library content from Context7 Cloud into an airgapped on-premise install

Airgapped on-premise installs can't reach Context7 Cloud, but you may still want the content of public libraries that the cloud already indexes. Library Import lets you select those libraries in the cloud dashboard, download them as a single file, and import that file into your on-premise install.

This feature is available only to customers with an **offline (airgapped) license**. Installs running an online license fetch public library content from the cloud directly and don't need it.

## How It Works

The export bundle carries only snippet content, not embeddings. Embeddings are tied to a specific embedding model, so they aren't portable between deployments. When you import, your on-premise install re-embeds the snippets with its own configured embedding provider. This means imported libraries match the rest of your index and stay fully searchable, with nothing but text crossing the airgap.

```mermaid theme={null}
flowchart LR
    subgraph cloud["Context7 Cloud"]
        direction TB
        A["Select<br/>libraries"] --> B["Download<br/>.zip bundle"]
    end

    subgraph onprem["On-Premise install"]
        direction TB
        C["Upload<br/>and import"] --> D["Re-embed<br/>locally"] --> E["Searchable<br/>library"]
    end

    B -. "transfer<br/>across airgap" .-> C

    classDef cloud fill:#dbeafe,stroke:#3b82f6,color:#1e3a8a;
    classDef step fill:#ede9fe,stroke:#8b5cf6,color:#5b21b6;
    classDef done fill:#dcfce7,stroke:#16a34a,color:#166534;
    class A,B cloud;
    class C,D step;
    class E done;
```

## Before You Start

* An **offline on-premise license**. The export page is only visible to accounts that hold one.
* Your on-premise **AI provider is configured** (Settings → completed setup wizard). Import re-embeds snippets, so it needs a working embedding provider.

## Exporting from Context7 Cloud

<Steps>
  <Step title="Open the export page">
    In the [Context7 Cloud dashboard](https://context7.com), open **More → Export Libraries**. The link only appears for accounts with an offline license.

    <Frame>
      <img src="https://mintcdn.com/context7/qwRIencKicoCiuHz/images/enterprise/library-import/export-menu.png?fit=max&auto=format&n=qwRIencKicoCiuHz&q=85&s=cb08d8488df82a03ef38f7151805a2a7" alt="Export Libraries link in the dashboard menu" width="1115" height="634" data-path="images/enterprise/library-import/export-menu.png" />
    </Frame>
  </Step>

  <Step title="Select libraries">
    Search for libraries by name and click **Add** to put them in your selection. The selection persists while you keep searching, so you can collect libraries from several searches before downloading. Remove a library from the selection with the **x** on its chip.

    You can export up to 50 libraries at once.

    <Frame>
      <img src="https://mintcdn.com/context7/qwRIencKicoCiuHz/images/enterprise/library-import/export-select.png?fit=max&auto=format&n=qwRIencKicoCiuHz&q=85&s=a1bd0b47cf81a39ddd466b329a4e4999" alt="Searching and selecting libraries to export" width="1115" height="851" data-path="images/enterprise/library-import/export-select.png" />
    </Frame>
  </Step>

  <Step title="Download the bundle">
    Click **Download selected**. Context7 gathers every code and info snippet for the chosen libraries and produces a single `context7-libraries.zip` file.
  </Step>
</Steps>

## Importing on Your On-Premise Install

<Steps>
  <Step title="Transfer the file">
    Move `context7-libraries.zip` into your airgapped environment using whatever method your security policy allows.
  </Step>

  <Step title="Open the import page">
    In your on-premise dashboard, click **Add Repo**, then choose the **Context7 Export** source. This source only appears on offline-license installs.

    <Frame>
      <img src="https://mintcdn.com/context7/qwRIencKicoCiuHz/images/enterprise/library-import/import-source.png?fit=max&auto=format&n=qwRIencKicoCiuHz&q=85&s=4dae7d2ab0014b1949fbb64ad8377f73" alt="Context7 Export source on the Add page" width="1115" height="462" data-path="images/enterprise/library-import/import-source.png" />
    </Frame>
  </Step>

  <Step title="Upload and import">
    Select your `.zip` export (up to 100 MB). To replace libraries that already exist on this install, enable **Overwrite existing libraries**. Click **Import**.

    <Frame>
      <img src="https://mintcdn.com/context7/qwRIencKicoCiuHz/images/enterprise/library-import/import-upload.png?fit=max&auto=format&n=qwRIencKicoCiuHz&q=85&s=6e2d177b81b12c6535667e9a8998dc31" alt="Uploading a Context7 export to import" width="1115" height="577" data-path="images/enterprise/library-import/import-upload.png" />
    </Frame>

    Each library is queued as its own job. Follow progress under the **Parse Queue** tab while snippets are re-embedded locally.
  </Step>
</Steps>

## After Import

Imported libraries appear in your Repositories list with an **Imported** badge and are queryable like any other library.

<Frame>
  <img src="https://mintcdn.com/context7/qwRIencKicoCiuHz/images/enterprise/library-import/imported-badge.png?fit=max&auto=format&n=qwRIencKicoCiuHz&q=85&s=bbf77f374ad15eb8b25d921df5d39395" alt="Imported badge on a library in the Repositories list" width="1115" height="448" data-path="images/enterprise/library-import/imported-badge.png" />
</Frame>

Because your install didn't parse these libraries from source, it can't refresh them. The Refresh action is disabled for imported libraries. To update one, export a fresh bundle from Context7 Cloud and import it again with **Overwrite existing libraries** enabled.

<Note>
  Re-importing a library you already have does nothing unless **Overwrite existing libraries** is checked. The import skips libraries that already exist and tells you which ones it skipped.
</Note>

## Automating with the API

Besides the dashboard flow, both sides expose an API so you can script imports. For example, you can sync a fixed set of libraries into on-premise on a schedule from a bridge host that can reach both networks.

<Steps>
  <Step title="Export from Context7 Cloud">
    Call the cloud export endpoint with your **enterprise license key** in the `Authorization` header. It returns one library's full content (every code and info snippet, without embeddings), already shaped for the import endpoint.

    ```bash theme={null}
    curl -X POST https://context7.com/api/v1/enterprise/export \
      -H "Authorization: Bearer YOUR_LICENSE_KEY" \
      -H "Content-Type: application/json" \
      -d '{"library":"vercel/next.js"}'
    ```

    Only public libraries can be exported this way.
  </Step>

  <Step title="Import into your on-premise install">
    Post that JSON to your install's [import endpoint](/enterprise/api/parse/import-libraries), authenticated with a [personal API key](/enterprise/api/authentication#creating-an-api-key). The body is `{ "libraries": [...], "force": false }`, which is exactly the export response shape.

    ```bash theme={null}
    curl -X POST https://your-instance.example.com/api/import-libraries \
      -H "Authorization: Bearer YOUR_API_KEY" \
      -H "Content-Type: application/json" \
      --data @library.json
    ```
  </Step>
</Steps>

From a host that can reach both networks, such as a bridge or import gateway, the two calls chain directly:

```bash theme={null}
curl -sf -X POST https://context7.com/api/v1/enterprise/export \
  -H "Authorization: Bearer YOUR_LICENSE_KEY" \
  -H "Content-Type: application/json" \
  -d '{"library":"vercel/next.js"}' \
| curl -X POST https://your-instance.example.com/api/import-libraries \
  -H "Authorization: Bearer YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  --data-binary @-
```

For a strictly airgapped install, save the export response to a file, transfer it the same way you would the `.zip`, then import it. The import endpoint also accepts the dashboard `.zip` bundle as a `multipart/form-data` upload (field `bundleFile`). See the [endpoint reference](/enterprise/api/parse/import-libraries) for details.

<Note>
  The import endpoint is available only on offline-license installs, the same gate as the dashboard flow. A library that already exists is skipped unless you overwrite it with `force`, either as a `?force=true` query param (handy when piping the export straight through) or a `"force": true` field in a JSON body. The response lists what it queued and skipped.
</Note>

## Limits

* Up to 50 libraries per export.
* Export files up to 100 MB per import.
* Only public libraries indexed by Context7 Cloud can be exported.
