Documentation

Quickstart

This guide starts the local preview path: AgentHub Desktop -> Local Edge -> Runtime Adapter. It is the smallest path to verify before testing Hub, Web, or Feishu/Lark integration.

Preview scope

This page covers local development and preview. Feishu/Lark production integration, Remote/Cloud Edge, and full Web + Hub + Edge routing are still in development.

Prerequisites

Prepare:

  • Git, Go 1.25+, Node.js 20+, and pnpm.
  • The AgentHub source repository.
  • One runtime you can run locally, such as Claude Code, Codex, OpenCode, or the mock runtime.
  • Model provider credentials in your local environment when using a real runtime.

Keep model API keys in local environment variables or server-side secret storage. Do not place them in public docs, frontend code, Feishu card payloads, or browser storage.

Step 1: Clone AgentHub

powershell
git clone https://github.com/TokenDanceLab/AgentHub.git
cd AgentHub
.\scripts\setup.ps1

On macOS or Linux, follow the setup script or README in the AgentHub repository for the equivalent local dependency setup.

After cloning, confirm which subsystem you are working in:

PathRoleNeeded for this guide
app/desktopDesktop UI and main local execution entryYes
edge-serverLocal Edge for workspaces, runs, adapters, and artifactsYes
hub-serverHub API, sessions, projects, devices, audit, and remote routingOptional
app/webHub-backed Web collaboration surfaceOptional
api/OpenAPI, event vocabulary, and protocol conventionsRead

Step 2: Start Local Edge

From the AgentHub repository:

powershell
cd edge-server
go run ./cmd/agenthub-edge --addr 127.0.0.1:3210 --runner-profile agenthub-runner-mock

Use the mock runtime first if you only need to verify UI, events, and diff rendering. After the UI path is healthy, switch to a real runtime:

powershell
go run ./cmd/agenthub-edge --addr 127.0.0.1:3210 --runner-profile claude-code --agent-default claude-code
go run ./cmd/agenthub-edge --addr 127.0.0.1:3210 --runner-profile codex --agent-default codex
go run ./cmd/agenthub-edge --addr 127.0.0.1:3210 --runner-profile opencode --agent-default opencode

--runner-profile selects the compatibility runtime preset. --agent-default selects the default adapter when a run does not specify agentId. The real CLI must already be installed and authenticated in your local shell.

Run a minimal health check after startup:

powershell
curl.exe http://127.0.0.1:3210/health
curl.exe http://127.0.0.1:3210/v1/health

If one endpoint is not implemented yet, follow the current AgentHub repository README or OpenAPI, but Local Edge must expose a health check that reports process, runtime, and workspace allowlist state.

Step 3: Start Desktop

In a second terminal:

powershell
cd app\desktop
pnpm install
pnpm dev

Open the Desktop preview at:

Text
http://localhost:5173

Desktop should connect to Local Edge on 127.0.0.1:3210.

If 5173 is already occupied, the dev server may choose another port. Use the local URL printed by the terminal, and confirm that Desktop is configured with the Edge URL from the previous step. Do not confuse the UI dev-server port with the Edge port.

Step 4: Run A First Local Task

Create or select a local workspace, then ask for a small task:

Text
Review the README and suggest the smallest documentation improvement.

For the first run, prefer a low-risk read-only request. After the event stream, transcript, diff, and artifact preview are visible, move on to write tasks and approval flows.

Expected first-run evidence:

SurfaceWhat to verify
Edge healthLoopback health check succeeds and lists runtime/adapter state
Desktop connectionDesktop shows the selected Local Edge as online
TranscriptThe user task and agent response render without layout overflow
EventsRun start, message delta or text block, tool state, and terminal state are visible
ArtifactsDiff/file/preview panels stay read-only until the user approves write actions

If the mock runtime works but a real runtime fails, treat it as a local CLI or credential issue first. Do not move provider keys into the website, docs, or browser storage just to make the preview pass.

Record the first-run evidence in a small, repeatable shape:

Text
edge:     http://127.0.0.1:3210 health ok
desktop:  dev server url + connected edge url
runtime:  mock / claude-code / codex / opencode
workspace: allowlisted path, not copied into public screenshots
run:      run id, terminal status, diff/artifact presence

This evidence can live in a private PR, internal issue, or local handoff. Public website pages and public docs should keep only redacted status notes.

Known-Good Mock Run

A mock-first preview should reliably produce these public-safe signals. Exact fields follow the current AgentHub repository implementation, but the semantics should stay stable:

JSON
{
  "ok": true,
  "service": "agenthub-edge",
  "mode": "local",
  "runtimes": [
    {
      "id": "agenthub-runner-mock",
      "state": "ready"
    }
  ]
}

After creating a read-only task, the event stream should express at least these stages:

JSON
{"type":"run.started","runId":"run_123","agentId":"agenthub-runner-mock"}
{"type":"run.message.delta","runId":"run_123","payload":{"text":"Reading README"}}
{"type":"run.artifact.ready","runId":"run_123","payload":{"kind":"summary"}}
{"type":"run.completed","runId":"run_123","payload":{"status":"completed"}}

Desktop should show:

AreaKnown-good state
Edge selector127.0.0.1:3210 is online and runtime is ready
ChatUser input and mock response render without browser-blue focus boxes
Files/DiffRead-only task does not write directly; candidate diffs enter review first
Timelinerun started, message, artifact, completed are traceable in order
Theme/LanguageSwitching theme/language updates the mock UI without resetting run state

Common failures and first actions:

SymptomLikely causeFirst action
Edge health connection refusedEdge is not running or uses another portCheck the Edge terminal output for the actual listen address
Desktop shows offlineDesktop still points to an old portUpdate the Desktop Edge URL; do not change the UI dev-server port
mock works but real runtime is silentCLI install, login, quota, or adapter profile issueRun codex --version or the matching CLI self-check in the same shell
workspace deniedWorkspace is outside allowlistUse an allowlisted workspace or update local Edge policy
event order is brokenAdapter event schema or replay issueRecord run id and event id; triage adapter/schema first

Step 5: Add Hub Or Web

After the local path works:

  • Use Hub Server when you need identity sessions, projects, devices, sync, routing, and audit.
  • Use Web when you need a Hub-backed collaboration preview surface.
  • Do not make Web bypass Hub to access Local Edge or local files.
  • Treat full Web + Hub + Edge routing as an integration path that is still being completed.

Recommended order:

  1. Keep Desktop + Local Edge passing with the mock runtime.
  2. Add one real runtime adapter and confirm the same UI surfaces still work.
  3. Add Hub for session, project, device, and audit boundaries.
  4. Add Web only after Hub owns the collaboration state.
  5. Add remote routing or IM entry points only after Hub can authorize the target Edge.

This order keeps local execution, product authorization, and collaboration surfaces from being mixed into one hard-to-debug failure.

Step 6: Plan Feishu/Lark Integration

Feishu/Lark is a collaboration entry: bot events, card actions, H5/workbench entry, and TokenDance ID binding. It is not the product login system.

Before implementing or deploying Feishu/Lark flows, read Feishu/Lark Integration and Security. Production ingress, async queues, card schema, and account binding are still in development.

Next Steps

  • Read Concepts for terms and delivery status.
  • Read Architecture for Hub, Edge, Desktop, Web, and adapter boundaries.
  • Read API And Events before building clients or integration gateways.