Intro
For AI agents
beUI exposes a static, agent-friendly surface. Coding agents (Cursor, Claude, GPT, custom MCP) can list components, fetch source with all deps, and drop files into the user's project with one HTTP call.
Endpoints
- Open
/llms.txtllms.txtMarkdown index in llmstxt.org format.
- Open
/rRegistry indexJSON catalogue of every component.
/r/{slug}Component detailJSON with files, deps, source.
/r/{slug}/rawRaw sourcePlain text .tsx ready to drop in.
Agent flow
Four calls, then install. Components are self-contained and own their files.
TSXagent.ts
// 1. Discover what exists
const idx = await fetch('https://beui.saura3h.xyz/r').then((r) => r.json());
// 2. Fetch a component
const entry = await fetch(`https://beui.saura3h.xyz/r/${slug}`).then((r) => r.json());
// 3. Write files into the user's project
for (const file of entry.files) {
await writeFile(file.path, file.content);
}
// 4. Install external deps
await runShell(['bun', 'add', ...entry.dependencies]);Entry shape
Internal helpers (e.g. @/lib/utils) ship inline as type: util so the agent does not have to chase imports.
TSXr/swap.json
{
"slug": "swap",
"name": "Multi-chain Swap",
"description": "Cross-chain swap widget with chain + token selectors, animated flip and quote.",
"category": "motion",
"page_url": "https://beui.saura3h.xyz/components/motion/swap",
"detail_url": "https://beui.saura3h.xyz/r/swap",
"raw_url": "https://beui.saura3h.xyz/r/swap/raw",
"dependencies": ["motion", "lucide-react", "react"],
"internal": ["@/lib/utils"],
"files": [
{ "path": "components/motion/swap.tsx", "type": "component", "content": "..." },
{ "path": "components/previews/motion/swap.preview.tsx", "type": "preview", "content": "..." },
{ "path": "lib/utils.ts", "type": "util", "content": "..." }
]
}Caching
All routes are pre-rendered at build, served with cache-control: public, max-age=300, s-maxage=3600.