๐Ÿšง CLI is in active development โ€” some features are incomplete. Join the waitlist for stable release notifications.
Product

Every production question,
answered in one command.

Flux is a backend runtime that records every execution automatically. When something breaks, you don't guess. Replay the exact production traffic. Diff two executions. Bisect the commit that introduced the bug.

Functions, database, queue, and cron are built in โ€” because recording requires controlling the full stack.

Get Started โ†’CLI Reference

One core concept: the execution record.

Every request Flux handles becomes an execution record โ€” a complete snapshot of what the request did: gateway spans, function spans, database mutations, inputs, outputs, tool latencies, and async hand-offs. The commands below are different ways to query and act on that record.

inspect itย ย flux tracereplay itย ย flux incident replaycompare itย ย flux trace diffaudit itย ย flux state history

Start with the question, not the tool.

Flux CLI commands map directly to the questions developers ask when something breaks in production.

Developer QuestionCommandWhat it does
Inspect
Why did my request fail?flux why <id>Root cause, span tree, suggestions
What happened step by step?flux trace <id>Full span tree with latencies
How does my query get compiled?flux explainDry-run with policy + SQL preview
Replay
What happens if I replay this?flux incident replaySafe re-run, side-effects off
Compare
How do two requests differ?flux trace diffSpan-by-span comparison
Which commit introduced this bug?flux bug bisectBinary-searches git history
Audit
What changed in the database?flux state historyEvery row mutation, linked to request
Who set this field to this value?flux state blamePer-column last-write attribution

Every request is recorded automatically.

The Flux runtime captures a complete record of every request as it happens โ€” gateway auth, function spans, every database query, tool latencies, async job hand-offs. Whether your function runs on Deno V8 (TypeScript) or Wasmtime (Rust, Go, Java, Python, PHP, AssemblyScript) โ€” same recording, same traces.

automatic recording
# Every request produces:

  trace_requests      โ†’ span tree (gateway to db)
  state_mutations     โ†’ every row change + request link
  execution_spans     โ†’ timing, errors, tool calls

# Nothing to configure. Zero SDK changes.
# The runtime records it all.
flux trace debug 550e8400
$ flux trace debug 550e8400

  Step 1/4  gateway
  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  Input:   POST /signup  { email: "a@b.com" }
  Output:  { tenant_id: "t_123", passed: true }
  Time:    4ms

  Step 2/4  create_user
  โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€
  Input:   { email: "a@b.com" }
  Output:  { userId: "u_42" }
  Time:    81ms

  โ†“ next  โ†‘ prev  e expand  q quit

Step through any production request.

flux trace debug <id> opens an interactive terminal UI where you can navigate each span of a production request. See the exact input and output at every step โ€” what the gateway received, what the function returned, what the database wrote. All from the actual production execution.

See every change ever made to a row.

flux state history shows every INSERT, UPDATE, and DELETE on any row, linked back to the request that caused it. flux state blame shows which request owns each column's current value. Instantly answer "who or what set this field to this value?"

flux state history users --id 42
$ flux state history users --id 42

  users id=42  (7 mutations)

  2026-03-10 12:00:00  INSERT  email=a@b.com, plan=free
  2026-03-10 14:21:59  UPDATE  name: null โ†’ Alice Smith  req:a3c91ef0
  2026-03-10 14:22:01  UPDATE  plan: free โ†’ pro           req:4f9a3b2c
  2026-03-10 14:22:01  UPDATE  plan: pro โ†’ null  (rolled back)  req:550e8400

$ flux state blame users --id 42

  email    a@b.com     req:4f9a3b2c  12:00:00
  plan     free        req:550e8400  14:22:01  โœ— rolled back
flux incident replay 14:00..14:05
$ flux incident replay 14:00..14:05

  Replaying 23 requests from 14:00โ€“14:05โ€ฆ

  Side-effects: hooks off ยท events off ยท cron off
  Database writes: on ยท mutation log: on

  โœ”  req:4f9a3b2c  POST /create_user   200  81ms
  โœ”  req:a3c91ef0  GET  /list_users    200  12ms
  โœ—  req:550e8400  POST /signup        500  44ms
     โ””โ”€ Still failing: Stripe timeout

  23 replayed ยท 22 passing ยท 1 still failing

Test your fix against the exact incident.

flux incident replay re-executes all requests from a time window against your current code. Outbound side-effects are disabled โ€” no emails, no webhooks, no Slack. Database writes and mutation logs run normally. After your commit, replay the incident to confirm the fix before deploying.

Find the commit that introduced the bug.

flux bug bisect binary-searches your git history comparing trace behaviour before and after each commit. It automatically identifies the first commit where a given request started failing. Like git bisect, but for production behaviour rather than a test suite.

flux bug bisect
$ flux bug bisect --request 550e8400

  Bisecting 42 commits (2026-03-01..2026-03-10)โ€ฆ

  Testing abc123โ€ฆ  โœ” passes
  Testing fde789โ€ฆ  โœ” passes
  Testing def456โ€ฆ  โœ— fails

  FIRST BAD COMMIT
  def456  "feat: add retry logic to stripe.charge"
  2026-03-08 by alice@example.com

  โ†’ Compare before/after:
     flux trace diff abc123:550e8400 def456:550e8400

Start with one function. Not a rewrite.

Flux is a runtime โ€” your code runs inside it. That's what makes replay and mutation logging possible. But you don't adopt a runtime all at once. Here's the path:

1

Try it locally (5 minutes)

flux init โ†’ flux dev โ†’ curl. You have execution traces before you finish reading the quickstart. No infra changes. Nothing deployed.

2

Move one endpoint (30 minutes)

Pick a new or low-risk endpoint. Wrap it in defineFunction(). Deploy Flux on :4000 behind your existing proxy. Everything else stays on your current stack.

3

Compare debugging speed

Next time that endpoint fails in production, run flux why. Compare the experience to your Datadog/Sentry/grep workflow. The difference sells itself.

4

Migrate gradually

Move more endpoints when you see the value. Flux and your existing stack run side-by-side behind the same proxy. No big-bang cutover.

Side-by-side deployment

nginx.conf (route by route)
upstream existing_api {
  server 127.0.0.1:3000;  # Express / FastAPI / Rails
}
upstream flux_api {
  server 127.0.0.1:4000;  # Flux
}

server {
  listen 443 ssl;

  # New endpoints โ†’ Flux
  location /api/signup  { proxy_pass http://flux_api; }
  location /api/orders  { proxy_pass http://flux_api; }

  # Everything else โ†’ existing stack
  location /api/        { proxy_pass http://existing_api; }
}

Full recording. Negligible overhead.

Recording is built into the runtime at the Rust level โ€” not added as middleware on top. Spans flow through in-memory channels. Mutation logs piggyback on the same Postgres transaction as your data.

<0.1ms
Gateway routing
DB route table cached in memory, invalidated via LISTEN/NOTIFY
<0.4ms
Recording overhead per request
Span creation + mutation log INSERT inside the same transaction
~10ยตs
WASM instantiation (cached)
Cranelift AOT compiles modules once, LRU cache of 256 entries
0ms
V8 warm start
Deno isolates stay warm between requests. Cold start ~5ms on first deploy.
why it's fast
// All in the same process:

  Gateway  โ”€โ”€ in-memory dispatch โ”€โ”€  Runtime
     โ”‚                                  โ”‚
     โ”‚    no HTTP hops                   โ”‚
     โ”‚    no serialization               โ”‚
     โ”‚    no service mesh                โ”‚
     โ”‚                                  โ”‚
  Data Engine โ”€โ”€ same Postgres txn โ”€โ”€  Queue

// Mutation log = 1 extra INSERT
// in the SAME transaction as your write.
// No extra round-trip. No eventual consistency.

Ready to debug production like it's local?

Everything on this page is available when you run flux dev. No cloud account, no configuration, no SDK changes.

Get Started โ†’How It WorksGitHub