# Import an existing repository

A local folder becomes a platform project with repositories, pipelines and deployment, either through the agent or with ap platform projects import-local.

> Source: https://www.application-platform.com/en/docs/agent-project-import/

The import creates a project from a local folder, clones the generated repositories, overlays your files and pushes to `main`; it needs `ap login` ([CLI and agent plugin]({{< relref "cli-and-agent-plugin" >}})).

## Via the CLI

```bash
ap platform projects import-local ~/code/shop "Shop"
```

The command takes path and project name (or `--name`), clones into `~/Documents/application-platform/<organization-slug>/<project-slug>/`, copies the files without touching `.git`, `.gitlab-ci.yml` and `env/*.generated.env`, and commits and pushes every repository.

`--slug`, `--description` and `--workspace-root` set slug, description and workspace folder, `--flat-layout` uses the layout `<workspace-root>/<project-slug>` without the organization level, and `--skip-commit` skips commit and push; for several components you map subfolders with `--repositories-json`:

```bash
ap platform projects import-local ~/code/shop "Shop" \
  --repositories-json '[{"path":"homepage","name":"Marketing"},{"path":"api","name":"API"}]'
```

## Supported stacks

The import only detects stacks of the wizard; the identifiers apply to `techStack` in `--repositories-json` and the MCP tools.

| Type | Identifiers |
|---|---|
| App | `flutter`, `react-native-expo`, `nextjs`, `native-ios`, `native-android` |
| Homepage | `hugo`, `astro` |
| Backend | `nestjs`, `fastapi`, `laravel` |
| Package (only for an unambiguous package folder) | `dart-package`, `docker-image`, `npm`, `go`, `kotlin`, `pypi`, `terraform-module`, `terraform-provider`, `vscode-plugin` |

Django, Vue, Express, Symfony, Svelte, Spring and other frameworks are not in the wizard today; the agent then stops and names the missing framework.

## Via the agent

With the agent plugin installed, open the folder in Cursor, Claude Code or Codex and paste this prompt; [Bring in an existing project]({{< relref "import-existing-project" >}}) takes you from the account to this point.

{{< agent-import-prompt >}}

The `import-existing-project` skill checks `ap`, the session (`platform_whoami`) and the MCP server `application-platform`, confirms path and project name and calls `platform_projects_import_local` with `path` and `name`, optionally with `slug`, `description`, `workspaceRoot` and `repositories[]` (`path`, `name`, `repositoryName`, `type`, `techStack`). Older clients without this tool use `platform_projects_create`, `platform_watch` (subject `project`) and `platform_projects_clone`, overlay the files without `.git`, `.gitlab-ci.yml` and `env/*.generated.env`, and push to `main`.

If create, import or watch fails, that is the answer; the agent does not clone by hand, does not invent a second API and does not write secrets into commits or replies.

## Working in the workspace afterwards

From now on you work in the cloned workspace instead of the old folder; there, `AGENTS.md` and `CLAUDE.md` from `local-configuration` apply, and every application starts with `ap run-local` ([Local development]({{< relref "local-development" >}})). The first push has already started the pipelines ([Git workflow and deployment]({{< relref "git-workflow" >}})).

