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

# Deploy

> Deploy local Polpo resources to a Cloud project

`polpo deploy` reads a local `.polpo/` configuration and reconciles its resources with a Polpo Cloud project.

## Link a project

`polpo create` creates and links a project, scaffolds `.polpo/`, and performs the initial deploy:

```bash theme={null}
npx @polpo-ai/cli create
```

To link an existing project and pull its current resources:

```bash theme={null}
npx @polpo-ai/cli link --project-id <uuid>
```

The project ID and generated 20-character slug are stored in `.polpo/polpo.json`.

## Usage

```bash theme={null}
polpo deploy [options]
```

| Flag                 | Description                                                               |
| -------------------- | ------------------------------------------------------------------------- |
| `-d, --dir <path>`   | Project directory containing `.polpo/`; defaults to the current directory |
| `-y, --yes`          | Accept prompts, including detected local LLM keys                         |
| `-f, --force`        | Resolve deploy conflicts in favor of the local resource                   |
| `--include-tasks`    | Include tasks, which are omitted by default                               |
| `--include-sessions` | Include chat sessions, which are omitted by default                       |
| `--all`              | Include both tasks and sessions                                           |

There is no run-history deploy flag. `--all` does not add run history.

## Resources

The default deploy covers resources represented by the local configuration:

* teams and agents
* Agentic Loops
* shared and agent-specific memory
* missions and playbooks
* skills and custom tools
* schedules
* vault entries
* agent avatars

Tasks and sessions require their explicit flags because they are operational data rather than normal project configuration.

## Conflict behavior

The CLI compares supported resources with their remote counterparts, skips identical data, and reports conflicts. In an interactive deploy you can choose how to resolve a conflict; `--force` chooses the local version.

Deploy is not a blanket replacement of all remote state. A missing local file does not generally delete the corresponding remote resource. Use the resource API or dashboard when an explicit remote deletion is required.

## Local LLM keys

The CLI checks the process environment and `.polpo/.env` for recognized provider credentials. During an interactive deploy it can offer to store those keys in the project's encrypted BYOK configuration. `--yes` and `--force` accept that upload automatically, so review the environment before using either flag in CI.

Recognized variables include `ANTHROPIC_API_KEY`, `OPENAI_API_KEY`, `GEMINI_API_KEY`, `XAI_API_KEY`, `GROQ_API_KEY`, `OPENROUTER_API_KEY`, `MISTRAL_API_KEY`, `CEREBRAS_API_KEY`, `MINIMAX_API_KEY`, `HF_TOKEN`, and Azure credentials.

<Note>
  `.env.local`, created by `polpo create` for `POLPO_URL` and `POLPO_API_KEY`, is separate from `.polpo/.env`, which the runtime and deploy command use for local provider credentials.
</Note>
