r
rute
CLI-first API docs

Docs that stay with the code.

rute reads your rute.yaml and linked Zod schemas, then turns them into terminal docs and a static HTML export. No OpenAPI ceremony. No duplicated contracts. No drift.

Built for TypeScript API projects that already use Zod as the source of truth.

Installation instructions for humans and agents: docs/installation.md

terminal
$ rute USERS GET /users/:id POST /users Detail GET /users/:id Get a user by ID Params id string uuid Response 200 id string uuid email string email role enum "admin" | "user" | "guest" $ rute export

Why rute

Most API teams already have the contract in code. The problem is keeping it visible. rute keeps the docs next to the schemas you already maintain and gives the terminal first-class treatment.

1
Zod-native Pulls types, validations, defaults, nullable fields, enums, unions, records, and intersections from real schemas.
2
Terminal first Browse routes, inspect schemas, test requests, and copy curl commands without leaving the repo.
3
Publish when needed Export a static site for public docs when the API needs a browser-friendly surface.

What it solves

Swagger solves publication. rute solves co-location. It is for teams that want a lightweight way to browse and share API documentation without introducing a second documentation system.

A
Route metadata lives in a small rute.yaml, not a large generated spec.
B
Schema references point straight at TypeScript exports, so the docs follow the code.
C
Anyone who clones the repo can run rute and understand the API immediately.

How it works

Small config, linked schemas, fast feedback.

01

Describe routes

Add a rute.yaml at the repo root and map each route to the Zod schemas it uses.

02

Browse in the terminal

Use rute, rute list, and rute show to inspect routes, types, and validations.

03

Export when needed

Run rute export to generate a static HTML site for teammates, reviewers, or public API consumers.

Core commands

The basics cover browsing, validation, and export.

rute

Open the interactive browser

Browse endpoint groups, inspect schema trees, and test routes directly from the TUI.

rute list

Scan the surface area

Print a compact list of routes, methods, and descriptions for quick orientation.

rute show /users/:id

Inspect one endpoint deeply

Render params, query, body, and response schemas as readable trees in the terminal.

rute validate

Check schema links

Confirm that every referenced TypeScript file and exported schema still resolves.

rute export

Generate static docs

Build a self-contained HTML site from the same route metadata and schema definitions.

rute publish

Push published docs

Publish exported documentation to GitHub Pages when you want a public-facing copy.

Quick start

A minimal rute.yaml is enough to get useful docs.

title: My API
version: 1.0.0
baseUrl: https://api.example.com

endpoints:
  - path: /users/:id
    method: GET
    description: Get a user by ID
    params:
      schema: ./schemas/user.ts#UserParamsSchema
    response:
      200:
        schema: ./schemas/user.ts#UserResponseSchema
      404:
        schema: ./schemas/errors.ts#NotFoundSchema

  - path: /users
    method: POST
    description: Create a new user
    body:
      schema: ./schemas/user.ts#CreateUserSchema
    response:
      201:
        schema: ./schemas/user.ts#UserResponseSchema