Back to feed

withastro/flue

withastro/flue
2.1k
+461/day
99
TypeScript

The sandbox agent framework.

From the README

Experimental — Flue is under active development. APIs may change.

Looking for v0.0.x? See here.

Flue

Flue is The Agent Harness Framework. If you know how to use Claude Code (or OpenCode, Codex, Gemini, etc)... then you already know the basics of how to build agents with Flue.

Flue is a TypeScript framework for building the next generation of agents, designed around a built-in agent harness. It's like Claude Code, but 100% headless and programmable. There's no baked-in assumption like requiring a human operator to function. No TUI. No GUI. Just TypeScript.

But using Flue feels like using Claude Code. The agents you build act autonomously to solve problems and complete tasks. They require very little code to run — most of the "logic" lives in Markdown: skills, context, and AGENTS.md.

Flue isn't another AI SDK. It's a proper runtime-agnostic framework — think Astro or Next.js, but for agents. Write once, build, and deploy your agents anywhere (Node.js, Cloudflare, GitHub Actions, GitLab CI/CD, etc).

Packages

| Package | Description | | ----------------------------------------- | ------------------------------------------ | | @flue/sdk | Core SDK: build system, sessions, tools | | @flue/cli | CLI for building and running agents | | @flue/connectors | Third-party connectors for sandboxes, etc. |

Examples

Quickstart

The simplest agent — no container, no tools, just a prompt and a typed result.

Unless you opt-in to initializing a full container sandbox, Flue will default to a virtual sandbox for every agent, powered by just-bash. A virtual sandbox is going to be dramatically faster, cheaper, and more scalable than running a full container for every agent, which makes it perfect for building high-traffic/high-scale agents.

// .flue/agents/hello-world.ts
import type { FlueContext } from '@flue/sdk/client';
import * as v from 'valibot';

// Every agent needs a trigger. This agent is invoked as an API endpoint, via HTTP.
export const triggers = { webhook: true };

// The agent handler. Where the orchestration of the agent lives.
export default async function ({ init, payload }: FlueContext) {
  // `agent` -- Your initialized agent runtime including sandbox, tools, skills, etc.
  const agent = await init({ model: 'anthropic/claude-sonnet-4-6' });
  const session = await agent.session();

  // prompt() sends a message in the session, triggering action.
  const result = await session.prompt(`Translate this to ${payload.language}: "${payload.text}"`, {
    // Pass a result schema to get typed, schema-validated data back from your agent.
    result: v.object({
      translation: v.string(),
      confidence: v.picklist(['low', 'medium', 'high']),
    }),
  });

  return result;
}

Support Agent

A support agent can also run in a virtu