Flux Documentation

Debug production failures by replaying them locally.

Get running in 60 seconds

1
Install Flux CLI
$curl -fsSL fluxbase.co/install | bash
2
Start your node app
$flux serve index.ts
3
Watch live traffic
$flux tail
4
Understand a failure
$flux why <id>
5
Test your fix safely
$flux replay <id>
6
Apply fix with real IO
$flux resume <id>
🚀

Quickstart Guide

From first install to your first production replay in 5 minutes.

⬇️

Detailed Install

CLI reference, server architecture, and runtime environments.

How it works

Flux runs alongside your existing TypeScript backend. It records every incoming request — inputs, outputs, database calls, console logs — atomically. When a request fails, Flux provides a deterministic way to debug and fix it without duplicate side effects.

CommandRole
flux why <id>Explains why it failed — showing error logs and the exact IO line that crashed.
flux replay <id>Replays execution using your latest local code. DB/API calls are virtualized.
flux resume <id>Atomically commits the fix to production with real IO side effects.

Simple Implementation

Flux is non-invasive. Use Hono and flux:pg for database interactions.

import { Hono } from "npm:hono"
import pg from "flux:pg"

const app = new Hono()
const pool = new pg.Pool({ connectionString: Deno.env.get("DATABASE_URL") })

app.post("/orders", async (c) => {
  const body = await c.req.json()
  const result = await pool.query(
    "INSERT INTO orders (email) VALUES ($1) RETURNING *",
    [body.email]
  )
  return c.json(result.rows[0])
})

export default app

Every request is automatically recorded. No instrumentation required.