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

> ## Agent Instructions
> Agents: start with https://docs.pre.dev/agents.md, which has complete recipes, plan access, polling rules, errors and limits.
> Authenticate with the workspace API key (pdk_…) from Integrations → Built-in, sent as Authorization: Bearer <key>.
> REST API: https://api.pre.dev (OpenAPI: https://docs.pre.dev/api-reference/openapi.json). AI Gateway: https://api.pre.dev/v1, OpenAI-compatible (OpenAPI: https://docs.pre.dev/api-reference/ai-gateway.openapi.json).
> pre.dev MCP server: https://api.pre.dev/mcp. Search these docs over MCP at https://docs.pre.dev/mcp.

# Import a repository

> Understand an existing GitHub codebase and build on its conventions.

Import connects a GitHub repository to a hosted pre.dev project. For code already on your machine, you can also [use the CLI directly](/cli/existing-repos).

<Steps>
  <Step title="Choose the repository">
    Select **Import**, then choose an accessible repository or supply its URL. Connect the GitHub account that can access private repositories. Organization access depends on the permissions granted in GitHub.
  </Step>

  <Step title="Map the codebase">
    Let pre.dev analyze the code, dependencies, and structure. Use `/reverse` to refresh the architecture after significant changes. The output depends on the code and configuration available to the agent.
  </Step>

  <Step title="Configure the runtime">
    Review the installation and start commands, and fill required environment variables in **Project setup → API Keys**. An imported repository may need project-specific services or setup before its preview runs.
  </Step>

  <Step title="Request a focused change">
    Describe the desired behavior and the conventions to preserve.

    ```text theme={null}
    Add a wishlist to the existing shop. Reuse the current auth,
    database access layer, and component library. Include an empty
    state and verify that one user cannot read another user's list.
    ```
  </Step>

  <Step title="Review the changes">
    Inspect the diff and reported checks, test the preview if available, and use the project's Git workflow to merge and deploy.
  </Step>
</Steps>

For multiple connected GitHub accounts, check the account selected in **Project setup → Connections**. A project can pin one account or inherit its workspace default. See [GitHub integration](/coding-agent/projects/github-integration).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.