← Back to honi.dev

Getting Started

Get a Honi agent running on Cloudflare Workers in under five minutes.

1. Install

Shell
$npm install honidev

Or use the CLI to scaffold a full project:

Shell
$npx honidev new my-agent

2. Create your first agent

TypeScript
1import { createAgent } from 'honidev'
2
3export const agent = createAgent({
4 name: 'my-agent',
5 model: 'claude-sonnet-4-20250514',
6 system: 'You are a helpful assistant.'
7})

Add the Durable Object binding to your wrangler.toml:

TOML
1name = "my-agent"
2main = "src/index.ts"
3compatibility_date = "2024-12-01"
4
5# Durable Object for agent state
6[[durable_objects.bindings]]
7name = "AGENT"
8class_name = "AgentDO"
9
10[[migrations]]
11tag = "v1"
12new_classes = ["AgentDO"]

3. Run locally

Shell
$honi dev
# or: npx wrangler dev

Your agent is now running at http://localhost:8787. Send a message:

Shell
$curl -X POST http://localhost:8787/chat \
-H "Content-Type: application/json" \
-d '{"message": "Hello!"}'

4. Deploy

Shell
$honi deploy
# or: npx wrangler deploy

Your agent is now live on Cloudflare's global edge network — over 300 locations worldwide.