Your first hug, in sixty seconds.
One command installs hug, the tool for making templates — the pages people answer on. A single file: nothing else to install to run it.
curl -fsSL https://get.gethugs.ai/hug/install.sh | shmacOS on Apple silicon, and Linux (arm64, x64). It adds ~/.hugs/bin to your PATH; open a new terminal, then run hug --help.
Your first template
Scaffold it, try it as you edit, and build the one file you install in getHugs. Templates are npm projects, so you’ll want Node 24.
hug new my-approvalcd my-approval && npm installhug dev # try it in the browser as you edithug build # → dist/my-approval.hug — install it in getHugs@gethugs/template-kit
What a template is asked and what a valid answer is — typed with Zod and checked on both sides — plus the runtime and UI kit its page is written against. Plain web components or React.
npm install @gethugs/template-kitimport { define_hug } from '@gethugs/template-kit/define';
import { z } from 'zod';
export default define_hug({
name: 'expense-check',
title: 'Check an expense',
params: z.object({ merchant: z.string(), amount: z.number() }),
values: z.object({
ok: z.boolean(),
note: z.string().max(500).optional(),
}),
});@gethugs/client
Hugging, in one call. ask() opens the Hug, waits for the answer — across timeouts, retries and restarts, without asking twice — and hands it back, typed. Node, Bun, Deno and edge runtimes.
npm install @gethugs/clientimport { HugsClient } from '@gethugs/client';
const hugs = HugsClient.from_env(); // reads HUGS_URL, HUGS_KEY, …
const r = await hugs.ask({
key: 'invoice-1042-approval', // same key → same Hug
template: 'tpl_approval',
title: 'Approve invoice 1042',
params: { prompt: 'Approve **$12,400** from Acme?' },
channels: ['finance'],
expires_in_min: 1440,
});
r.value.decision; // 'approve' | 'reject'The HTTP API
JSON over HTTPS, one POST per action. Your source’s key, your workspace, and an Idempotency-Key so a retry finds the same Hug. Then wait for the answer with hugs/wait.
curl https://api.gethugs.ai/v1/hugs/create \
-H "Authorization: Bearer $HUGS_KEY" \
-H "Content-Type: application/json" \
-H "Idempotency-Key: invoice-1042-approval" \
-d '{ "workspace_id": "ws_…", "template": "tpl_approval",
"title": "Approve invoice 1042",
"params": { "prompt": "Approve **$12,400**?" },
"channels": ["finance"], "expires_in_min": 1440 }'