Hibana Logo Hibana

Cloudflare Workers × Ruby

Hibana ignites your Ruby apps at the edge

Hibana is a CLI + runtime that makes Ruby feel at home on Cloudflare Workers. It ships a Hono / Sinatra style DSL, Cloudflare bindings, templates, and a static asset pipeline. Run npm create hibana@latest <project-name> locally to start in seconds, then use npx wrangler deploy when you are ready to ship.

Ruby-friendly DSL

Define routes with a Hono / Sinatra-like DSL. Helpers such as c.text, c.json, and c.render keep handlers clear and expressive.

get "/" do |c|
  c.text("Hello Hibana!")
end

Cloudflare bindings

Workers KV / D1 / R2 / Workers AI clients ship out of the box, so Ruby code can talk to every binding with plain objects.

get "/d1" do |c|
  db = c.env(:DB)
  result = db.prepare("SELECT * FROM posts")
              .bind
              .first
  c.json(result)
end

Workers AI ready

Call Workers AI directly from Ruby. Describe prompts and payloads with hashes, then send them straight to the model.

get "/ai-demo" do |c|
  ai = c.env(:AI)
  result = ai.run(
    model: "@cf/meta/llama-3.1-8b",
    payload: { prompt: "Hello from Hibana" },
  )
  c.json(result)
end

Seamless asset pipeline

ERB templates and static files are turned into manifests and streamed to Workers. Run npm run build:generated before dev/build/deploy and you are done.

<h1>My name is <%= name %></h1>
<p>Nickname is <%= nickname %></p>