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.
npx @nilejs/cli new my-appor with bunx: bunx @nilejs/cli new my-app
// 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 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" }
}'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.
Say goodbye to unhandled exceptions crashing your server. Nile enforces a strict Result pattern—your control flow becomes infinitely predictable.
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.
Get full-stack type inference without coupling frontend and backend in a monorepo. Nile dynamically serves schemas over the wire for any language, anywhere.
Focus on business logic, not framework fighting. Nile gets out of your way so you can ship features at the speed of thought.
Build services that AI agents can discover and consume natively. Perfect for tool-calling, autonomous workflows, and LLM integrations.
The strict Result pattern and hooks system make Nile ideal for complex business logic where predictability matters more than HTTP purity.
Built on Hono. Works with Bun, Node.js, and Deno. Type-safe from end to end with Zod and TypeScript.