npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

katax-cli

v1.0.0

Published

CLI tool to generate Express APIs with TypeScript and katax-core validation

Readme

Katax CLI

npm version License: MIT

🚀 CLI tool to generate Express REST APIs with TypeScript and katax-core validation.

✨ Features

  • 🎯 Quick API Setup - Initialize Express + TypeScript projects in seconds
  • Built-in Validation - Integrates katax-core for type-safe schema validation
  • 🔧 Code Generation - Generate endpoints, CRUD operations, and routes
  • 📦 Database Support - PostgreSQL, MySQL, MongoDB, or none
  • 🔐 JWT Authentication - Optional JWT auth scaffolding
  • 📝 TypeScript First - Full type safety and IntelliSense support
  • 🎨 Interactive CLI - Beautiful prompts and feedback

📦 Installation

# Global installation
npm install -g @katax/cli

# Or use with npx (no installation needed)
npx @katax/cli init my-api

🚀 Quick Start

1. Create a New API Project

katax init my-api

This will:

  • Create project structure
  • Setup TypeScript + Express
  • Install dependencies
  • Configure katax-core validation
  • Add database connection (optional)
  • Setup JWT authentication (optional)

2. Add an Endpoint

cd my-api
katax add endpoint users

Interactive prompts will guide you through:

  • HTTP method (GET, POST, PUT, DELETE)
  • Route path
  • Request fields and validation rules
  • Async validators (unique checks, etc.)

npm version License: MIT

🚀 CLI tool to generate Express REST APIs with TypeScript and katax-core validation.

  • 🔧 Code Generation - Generate endpoints, CRUD operations, and routes
  • 📦 Database Support - PostgreSQL, MySQL, MongoDB, or none
  • 🔐 JWT Authentication - Optional JWT auth scaffolding
  • 📝 TypeScript First - Full type safety and IntelliSense support
  • 🎨 Interactive CLI - Beautiful prompts and feedback

📦 Installation

# Global installation
npm install -g katax-cli

# Or use with npx (no installation needed)
npx katax-cli init my-api

🚀 Quick Start

1. Create a New API Project

katax init my-api

This will:

  • Create project structure
  • Setup TypeScript + Express
  • Install dependencies
  • Configure katax-core validation
  • Add database connection (optional)
  • Setup JWT authentication (optional)

2. Add an Endpoint

cd my-api
katax add endpoint users

Interactive prompts will guide you through:

  • HTTP method (GET, POST, PUT, DELETE)
  • Route path
  • Request fields and validation rules
  • Async validators (unique checks, etc.)

This generates:

  • users.validator.ts - katax-core validation schemas
  • users.controller.ts - Business logic
  • users.routes.ts - Express routes
  • Updates main router automatically

3. Generate CRUD Resource

katax generate crud products

Creates a complete CRUD API with 5 endpoints:

  • GET /api/products - List all
  • GET /api/products/:id - Get one
  • POST /api/products - Create

katax init [project-name]

Initialize a new Express API project.

Options:

  • -f, --force - Overwrite existing directory katax init my-awesome-api

### `katax add endpoint <name>`

Add a new endpoint with validation.

**Options:**
- `-m, --method <method>` - HTTP method (GET, POST, PUT, DELETE)

**Example:**
```bash
katax add endpoint users -m POST -p /api/users

katax generate crud <resource-name>

Generate a complete CRUD resource.

Options:

  • --no-auth - Skip authentication middleware

Example:

katax generate crud products

katax info

Show current project structure and routes.

Aliases: status, ls

Example:

katax info

🎯 Generated Code Example

When you run katax add endpoint users, it generates:

users.validator.ts:

import { k, kataxInfer } from 'katax-core';

export const usersSchema = k.object({
  username: k.string()
    .minLength(3, 'Username must be at least 3 characters')
    .maxLength(50, 'Username cannot exceed 50 characters'),
  email: k.string().email('Must be a valid email'),
  age: k.number().min(0, 'Age must be positive').optional()
});

export type UsersData = kataxInfer<typeof usersSchema>;

export async function validateUsers(data: unknown) {
  return await usersSchema.safeParse(data);
}

users.controller.ts:

import { UsersData } from './users.validator.js';
import { ControllerResult, createSuccessResult } from '../../shared/api.utils.js';

export async function createUsers(data: UsersData): Promise<ControllerResult<any>> {
  try {
    // Your business logic here
    const newUser = { id: 1, ...data, createdAt: new Date() };
    return createSuccessResult('User created successfully', newUser, undefined, 201);
  } catch (error) {
    // Error handling
  }
}

users.routes.ts:

import { Router } from 'express';
import { createUsers } from './users.controller.js';
# Katax CLI

[![npm version](https://img.shields.io/npm/v/katax-cli.svg)](https://www.npmjs.com/package/katax-cli)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)

Katax CLI — generate Express REST APIs with TypeScript and katax-core validation.

## Features

- Quick project scaffolding (Express + TypeScript)
- katax-core integration for type-safe validation
- Generate endpoints, CRUD resources and routes
- Optional DB scaffolding (Postgres / MySQL / MongoDB)
- Optional JWT authentication

## Installation

```bash
# global
npm install -g katax-cli

# or run with npx
npx katax-cli init my-api

Usage

  • katax init <name> — initialize a new API project
  • katax add endpoint <name> — add endpoint with validation
  • katax generate crud <resource> — scaffold full CRUD
  • katax info — show project structure and routes

Development

Run development server:

npm run dev

Build and publish:

npm run build
npm publish

Example generated files

  • users.validator.ts — katax-core schema
  • users.controller.ts — business logic
  • users.routes.ts — express routes

Links

  • Repository: https://github.com/LOPIN6FARRIER/katax-cli
  • katax-core: https://github.com/LOPIN6FARRIER/katax-core

MIT © Vinicio Esparza