# appostle-installer

One-shot installer for the Appostle daemon and the agent CLIs it talks to (Claude Code, Codex, OpenCode, Copilot, Pi). Sets up the daemon on your machine and pairs it with [appostle.app](https://appostle.app), where you control your agents from the web app, mobile app, or any paired client.

```bash
npx appostle-installer
```

## What it does

1. Asks which agent CLIs you want (Claude Code, Codex, Copilot, OpenCode, Pi)
2. Installs each one (idempotent — skips anything already present)
3. Walks you through each CLI's native auth flow
4. Installs the daemon runtime (`@appostle/cli` from public npm)
5. Configures auto-start so the daemon connects to [pair.appostle.app](https://pair.appostle.app) on every boot
6. Prints a pairing link + QR — paste into [appostle.app](https://appostle.app)

## Updating an existing install

Already paired and just want a newer daemon? Run the installer with `--update`:

```bash
npx appostle-installer@latest --update
```

That skips provider selection, auth, and the pairing step. It only:
- Reinstalls `@appostle/cli@latest`
- Re-applies the OS auto-start config (which restarts the running service)

Safe to run from cron / a scheduled task for unattended upgrades.

## Re-show the pairing link

Need to pair another device or browser and don't have the link handy? Run:

```bash
npx appostle-installer@latest --pair
```

Prints a fresh QR + link for the local daemon and exits. No installs, no service changes — just the pairing artifact.

## Other flags

| Flag | Effect |
|---|---|
| `--yes`, `-y` | Skip every interactive prompt; install daemon only (no providers, no auth, no pairing print). Good for CI / Dockerfile bootstrap. |
| `--providers=a,b,c` | Pre-pick a comma-separated list of provider IDs (e.g. `claude-code,codex`) and skip the multiselect. |
| `--no-auth` | Install providers without running their auth flows. Pair with `--providers=…`. |
| `--update` | Update-only mode (above). Implies non-interactive. |
| `--pair` | Print a fresh pairing link/QR and exit. Daemon must already be installed. |

## Architecture

The daemon is the Appostle runtime (`@appostle/cli`), wired to Appostle's own relay and branded web UI.

```
Your machine                    Our infra
────────────                    ─────────
appostle daemon ──(E2EE WS)──▶ pair.appostle.app  (Cloudflare Worker relay)
                                      │
                                      ▼
browser ─────────▶ appostle.app  (web UI, served from APPOSTLE)
```

Traffic is E2E-encrypted — the relay only forwards ciphertext.

## Platform support

| OS | Auto-start | Notes |
|---|---|---|
| macOS | launchd agent at `~/Library/LaunchAgents/app.appostle.daemon.plist` | tested |
| Linux | systemd user unit at `~/.config/systemd/user/appostle.service` | run `loginctl enable-linger $USER` to keep it up when logged out |
| Windows | `.vbs` launcher in Startup folder | ⚠️ **beta — unverified**. Code path is written but hasn't been dry-run on a real Windows machine yet. Please [open an issue](https://gitlab.com/ohlord-suite/appostle-daemon-installer/-/issues) if you hit problems. No restart-on-crash; upgrade to a Windows Service later if needed. |

## Requirements

- Node.js 20+ and npm on PATH. Install from [nodejs.org](https://nodejs.org) if missing.
- A shell (bash/zsh/PowerShell).

## Development

```bash
git clone https://gitlab.com/ohlord-suite/appostle-daemon-installer.git
cd appostle-daemon-installer
npm install
npm run dev           # live-run without building
npm run typecheck
npm run build         # compile to dist/
```

## Publishing

```bash
npm publish --access public
```

Or push a `v*` tag to trigger the GitLab CI publish job.

## License

MIT — but the daemon it installs ([@appostle/cli](https://www.npmjs.com/package/@appostle/cli)) is AGPL-3.0.
