Nile

TypeScript-first, service and actions oriented backend framework for building modern, fast, safe and AI-ready backends with simplest developer experience possible.

You define actions, group them into services, and get a predictable API with validation, error handling, and schema export, no route definitions, no controllers, no middleware chains and rest api conventions to care about, just your business logic.

And it's all AI agent-ready out of the box, progressively discoverable and tool calling ready with validation.

Quick Start

npx @nilejs/cli new my-app

or with bunx: bunx @nilejs/cli new my-app

How It Works

Define Your Action

// tasks/create.ts
import { Ok } from "slang-ts";
import z from "zod";
import { createAction, type Action } from "@nilejs/nile";

const createTaskSchema = z.object({
  title: z.string().min(1, "Title is required"),
  status: z.enum(["pending", "in-progress", "done"]).default("pending"),
});

const createTaskHandler = (data: Record<string, unknown>) => {
  const task = { id: crypto.randomUUID(), ...data };
  return Ok({ task });
};

export const createTaskAction: Action = createAction({
  name: "create",
  description: "Create a new task",
  handler: createTaskHandler,
  validation: createTaskSchema,
});

Invoke It

# Invoke the action via POST
curl -X POST http://localhost:8000/api/services \
  -H "Content-Type: application/json" \
  -d '{
    "intent": "execute",
    "service": "tasks",
    "action": "create",
    "payload": { "title": "Ship Nile", "status": "in-progress" }
  }'

Why Nile?

Pure Developer Ergonomics

Stop debating HTTP verbs and routing controllers. Define your domain, write simple actions, and Nile handles the rest. The path of least resistance for shipping features.

Functional Safety

Say goodbye to unhandled exceptions crashing your server. Nile enforces a strict Result pattern—your control flow becomes infinitely predictable.

Native AI Agent Integration

LLMs understand JSON Schemas, not REST semantics. Every Nile action exports its exact parameters out-of-the-box—your API is instantly ready for AI tool-calling.

Type Safety Without Boundaries

Get full-stack type inference without coupling frontend and backend in a monorepo. Nile dynamically serves schemas over the wire for any language, anywhere.

Built For

Fast-Moving Teams

Focus on business logic, not framework fighting. Nile gets out of your way so you can ship features at the speed of thought.

AI Agent Backends

Build services that AI agents can discover and consume natively. Perfect for tool-calling, autonomous workflows, and LLM integrations.

Enterprise Services

The strict Result pattern and hooks system make Nile ideal for complex business logic where predictability matters more than HTTP purity.

Modern Stacks

Built on Hono. Works with Bun, Node.js, and Deno. Type-safe from end to end with Zod and TypeScript.