Read this in other languages: English, 简体中文.
Quick Start Guide
Get up and running with HotPlex in 5 minutes.
Prerequisites
Before starting, ensure you have:
- Go 1.24 installed (recommended)
- Claude Code CLI or OpenCode CLI installed and authenticated
Install Claude Code CLI
bash
# macOS / Linux / WSL
curl -fsSL https://claude.ai/install.sh | bash
# Authenticate
claude authInstall OpenCode CLI
bash
# npm
npm install -g @opencode/opencode
# Or use Homebrew
brew install opencodeOption 1: Go SDK (Recommended)
Step 1: Install
bash
go get github.com/hrygo/hotplexStep 2: Create main.go
go
package main
import (
"context"
"fmt"
"time"
"github.com/hrygo/hotplex"
)
func main() {
// Initialize the engine
engine, err := hotplex.NewEngine(hotplex.EngineOptions{
Timeout: 5 * time.Minute,
PermissionMode: "bypassPermissions",
})
if err != nil {
panic(err)
}
defer engine.Close()
// Configure the session
cfg := &hotplex.Config{
WorkDir: "/tmp/hotplex-demo",
SessionID: "my-first-session",
}
// Execute a prompt
ctx := context.Background()
err = engine.Execute(ctx, cfg, "Write a hello world in Go",
func(eventType string, data any) error {
if eventType == "answer" {
fmt.Print(data)
}
return nil
})
if err != nil {
fmt.Printf("Error: %v\n", err)
}
}Step 3: Run
bash
go run main.goOption 2: Standalone Server
Run HotPlex as a standalone server for multi-language clients.
Step 1: Build
bash
git clone https://github.com/hrygo/hotplex.git
cd hotplex
make buildStep 2: Run
bash
PORT=8080 ./dist/hotplexdStep 3: Connect
WebSocket (any language):
ws://localhost:8080/ws/v1/agentOpenCode HTTP/SSE:
http://localhost:8080Option 3: Python SDK
Step 1: Install
bash
pip install hotplexStep 2: Create main.py
python
from hotplex import HotPlexClient, Config
with HotPlexClient(url="ws://localhost:8080/ws/v1/agent") as client:
for event in client.execute_stream(
prompt="Write a hello world in Python",
config=Config(work_dir="/tmp", session_id="py-demo")
):
if event.type == "answer":
print(event.data, end="")Step 3: Run
bash
python main.pyWhat's Next?
- Architecture Deep Dive - Learn how HotPlex works
- SDK Developer Guide - Complete SDK reference
- Examples - More code examples
- Benchmark Report - Performance data
Common Issues
"claude: command not found"
Install Claude Code CLI:
bash
curl -fsSL https://claude.ai/install.sh | bash
claude auth"Permission denied"
Make sure the work directory exists and is writable:
bash
mkdir -p /tmp/hotplex-demo"Session not found"
Sessions are identified by SessionID. Use the same ID for multi-turn conversations.