# With an AI assistant

> Installing · https://spoletta.com/docs/install-ai

Have an AI coding assistant, such as Claude Code, Cursor or Codex, install Spoletta for you. Copy this prompt into it, in a terminal on the machine to install on, or one with `kubectl` for your cluster.

Prompt:

```
Install Spoletta for me. Spoletta is a self-hosted builder and engine for AI agent workflows. Its install guides are at https://spoletta.com/docs/install-docker, https://spoletta.com/docs/install-podman and https://spoletta.com/docs/install-kubernetes; follow the one I pick, and if you can't read web pages, these are its steps.

1. Ask me which way to run it: Docker (Docker Compose on this machine), Podman (podman compose on this machine) or Kubernetes (a cluster kubectl reaches).
2. Check what it needs: git and openssl; for Docker, that `docker compose version` works; for Podman, that `podman compose version` works, and on macOS or Windows that a podman machine is running; for Kubernetes, kubectl's current context, a registry the cluster pulls from, and a ReadWriteMany storage class. Tell me what is missing rather than installing system software without asking.
3. Clone https://github.com/Nucc/spoletta.git and work in it.
4. Make sure ~/.pi/agent/settings.json and ~/.pi/agent/models.json exist, and never overwrite them if they do. If not, write models.json as {} and settings.json with defaultProvider, defaultModel and enabledModels ("provider/model" ids), asking me which provider and models to offer. On Kubernetes they go in the spoletta-pi ConfigMap instead.
5. Generate MYSQL_ROOT_PASSWORD, MYSQL_PASSWORD (openssl rand -hex 16) and SECRET_KEY (openssl rand -base64 32) into a .env file next to compose.yaml, with chmod 600, or on Kubernetes into the spoletta-mysql and spoletta Secrets as the guide shows. Don't print them. Tell me to back up SECRET_KEY: the webapp won't start without the key that sealed its secrets.
6. Never ask me to paste an API key, token or password into this chat. Tell me which variables to set (such as OPENAI_API_KEY) and let me set them myself: exported in the shell compose starts from, in the spoletta-worker Secret on Kubernetes, or later in Spoletta under Settings, Model keys.
7. Start it: `docker compose up --build -d` or `podman compose up --build -d`; on Kubernetes, build and push the webapp image (context webapp/) and the worker image (context the repository's top, -f worker/Containerfile), then apply the manifests from the guide with those images.
8. Keep it reachable from this machine only, since without sign-in anyone reaching it can run anything on the worker: don't set PUBLISH_HOST or add an Ingress unless I've set up sign-in with OpenID Connect or Google. On Kubernetes, use kubectl port-forward svc/spoletta-webapp 8080:8080.
9. Check that http://localhost:8080 loads and the webapp's and worker's logs show no errors. Then tell me what you did, where the settings and secrets are, and how to stop and update it.
```

## What it will do

It asks whether to use [Docker](https://spoletta.com/docs/install-docker.md), [Podman](https://spoletta.com/docs/install-podman.md) or [Kubernetes](https://spoletta.com/docs/install-kubernetes.md) and follows that guide: it checks the tools are there, clones Spoletta, sets up the models and settings, starts it and checks that it answers.

> **Keep your keys out of the chat:** The prompt tells the assistant never to ask for API keys, tokens or passwords, since what you type in a chat may be kept with it. Set them yourself in your shell, in a Secret, or in **Settings**, **Model keys** once Spoletta runs. Should an assistant ask for one anyway, decline.

Watch what it runs, as you would anyone setting up a server for you. When it is done, back up the `SECRET_KEY` it made, then set up [sign-in](https://spoletta.com/docs/sign-in.md) before letting others reach the instance.
