# @kong-link/server (Kong Link)

Paseo agent daemon — runs coding agents (Claude Code, Codex, Copilot, etc.) and exposes a WebSocket API.

## Install from npm

```bash
npm install -g @kong-link/server
```

Beta channel:

```bash
npm install -g @kong-link/server@beta
```

## Run (port 6769)

```bash
kong-link
```

Or start in the background:

```bash
kong-link start --background
```

## Manage from system tray (recommended)

Like Tailscale — icon in the taskbar notification area:

```bash
kong-link tray
```

Right-click the **KL** icon for Start / Stop / Restart, device info, Tailscale IP, and health check.

Start server + tray together:

```bash
kong-link start --tray
```

## Manage and check status (CLI)

```bash
kong-link status          # human-readable status
kong-link status --json   # machine-readable JSON
kong-link stop
kong-link restart
kong-link logs --tail 100
```

Web manager UI (Start / Stop / logs / Tailscale info):

```bash
kong-link ui
kong-link ui --open       # also open in browser
```

Default manager URL: `http://127.0.0.1:6770`

This starts the daemon on **`0.0.0.0:6769`** (reachable on LAN / Tailscale). Override with:

```bash
PASEO_LISTEN=127.0.0.1:6769 kong-link
```

Run in background (no terminal attached):

```bash
kong-link --background
```

Health check: `http://127.0.0.1:6769/api/health`

WebSocket: `ws://127.0.0.1:6769/ws`

## Configuration

Runtime state: `~/.paseo/` (override with `PASEO_HOME`).

Config file: `~/.paseo/config.json` — see [Paseo configuration](https://paseo.sh/docs/configuration).

## Publish (maintainers)

From the monorepo root, publish the server stack in dependency order:

```bash
npm run release:check
npm run release:publish:beta   # or release:publish for latest
```

Packages: `@kong-link/highlight`, `@kong-link/relay`, `@kong-link/protocol`, `@kong-link/client`, `@kong-link/server`, `@kong-link/cli`.

Dry-run server tarball only:

```bash
npm run build:server-deps && npm pack --dry-run --workspace=@kong-link/server
```

## Development

```bash
npm run dev:server
```

Default dev port is **6767**. Kong Link npm installs use **6769** via the `kong-link` bin.
