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

# Web UI

> Browser-based interface with real-time streaming.

## Starting the Web UI

```bash theme={null}
# Default port (3000)
lukan --ui web

# Custom port
LUKAN_PORT=4321 lukan --ui web
```

## Features

* **Axum + WebSocket backend** - Real-time streaming of agent responses
* **React + Tailwind frontend** - Modern, responsive UI
* **Session management** - Via sidebar
* **Tool approval modal** - For manual permission mode
* **Sub-agent viewer** - Monitor background agents
* **Worker management panel** - Control scheduled tasks
* **Embedded terminal** - Full PTY support for shell access
* **Plugin management** - Install, start, stop, configure, and view plugin logs
* **Browser control** - Launch, navigate, screenshot, and manage tabs
* **Background processes** - Start, monitor, and kill processes
* **Memory management** - View and edit global and project memory
* **Password authentication** - Optional with JWT tokens
* **Hot-swap provider** - Switch model and provider while agents are running

## Authentication

Set a password in `config.json`:

```json theme={null}
{
  "webPassword": "your-password",
  "webTokenTTL": 24
}
```

This enables JWT-based authentication with tokens that expire after 24 hours (configurable).

## REST API

The web UI exposes a comprehensive REST API (all endpoints require authentication when password is set):

### Configuration

* `GET /api/config` - Get full configuration
* `PUT /api/config` - Save configuration
* `GET /api/config/{key}` - Get specific config value
* `PUT /api/config/{key}` - Set specific config value
* `GET /api/tools` - List available tools

### Providers & Models

* `GET /api/providers` - List all providers
* `GET /api/models` - Get available models
* `GET /api/providers/{name}/models` - Fetch models from provider API
* `PUT /api/providers/{name}/models` - Override provider models
* `PUT /api/providers/active` - Switch active provider (hot-swap)
* `POST /api/models` - Add custom model entry
* `POST /api/providers/{name}/test` - Test provider connection

### Credentials

* `GET /api/credentials` - Get stored credentials
* `PUT /api/credentials` - Save credentials

### Plugins

* `GET /api/plugins` - List installed plugins
* `GET /api/plugins/remote` - List plugins from registry
* `POST /api/plugins/install` - Install plugin from local path
* `POST /api/plugins/install-remote` - Install from registry
* `DELETE /api/plugins/{name}` - Remove plugin
* `POST /api/plugins/{name}/start` - Start plugin
* `POST /api/plugins/{name}/stop` - Stop plugin
* `POST /api/plugins/{name}/restart` - Restart plugin
* `GET /api/plugins/{name}/config` - Get plugin config
* `PUT /api/plugins/{name}/config` - Update plugin config
* `GET /api/plugins/{name}/logs` - Tail plugin logs
* `GET /api/plugins/{name}/commands` - List plugin commands
* `POST /api/plugins/{name}/commands/{cmd}` - Execute plugin command
* `GET /api/plugins/{name}/tools` - Get plugin tools
* `GET /api/plugins/{name}/auth/qr` - Get QR code for plugin auth
* `GET /api/plugins/{name}/auth/status` - Check plugin auth status

### Memory

* `GET /api/memory/global` - Get global memory
* `PUT /api/memory/global` - Save global memory
* `GET /api/memory/project` - Get project memory
* `PUT /api/memory/project` - Save project memory
* `GET /api/memory/project/active` - Check if project memory is active
* `PUT /api/memory/project/active` - Toggle project memory

### Workers

* `GET /api/workers` - List workers
* `POST /api/workers` - Create worker
* `PUT /api/workers/{id}` - Update worker
* `DELETE /api/workers/{id}` - Delete worker
* `PUT /api/workers/{id}/toggle` - Enable/disable worker
* `GET /api/workers/{id}/runs/{run_id}` - Get run result

### Browser

* `POST /api/browser/launch` - Launch browser
* `GET /api/browser/status` - Get browser status
* `POST /api/browser/navigate` - Navigate to URL
* `GET /api/browser/screenshot` - Take screenshot
* `GET /api/browser/tabs` - List open tabs
* `POST /api/browser/close` - Close browser

### Background Processes

* `GET /api/processes` - List background processes
* `POST /api/processes/background` - Start background command
* `GET /api/processes/{pid}/log` - Get process log
* `POST /api/processes/{pid}/kill` - Kill process

### Transcription

* `GET /api/transcription/status` - Check transcription plugin status
* `POST /api/transcription/transcribe` - Transcribe audio file

### Events

* `POST /api/events/consume` - Consume pending events
* `GET /api/events/history` - Get event history
* `DELETE /api/events/history` - Clear event history

### Files

* `GET /api/files?path=...` - List directory contents
* `GET /api/cwd` - Get current working directory

## WebSocket Events

The web UI communicates with the backend via WebSocket (`GET /ws`) for:

* Real-time message streaming
* Tool call requests and approvals
* Session updates
* Worker notifications (broadcast to all clients)
* Terminal I/O (base64-encoded)

## Terminal Support

The Web UI includes a full embedded terminal with PTY allocation. Terminal sessions support:

* Input/output via WebSocket messages
* Resize events
* Multiple terminal sessions
* Session lifecycle management (create, list, destroy)
