Getting started

Install akuma and run your first mock server in under a minute.

Install

shell
npm install -g @heyakuma/akuma-cli

This installs the akuma command with the prebuilt binary for your platform (macOS, Linux, and Windows). No other toolchain required.

Create a mock server

shell
akuma init my-api

This creates a akuma.yml file with example endpoints: a status endpoint, a users list, and a single user lookup.

Start the server

shell
akuma start

The server starts at http://localhost:3000 with three endpoints ready to use.

Test it

shell
# Status endpoint (inline response)
curl http://localhost:3000/
# => {"status": "ok", "message": "Akuma server is running"}

# Users list (database-backed)
curl http://localhost:3000/users
# => [{"id": 1, "name": "Example 1", "email": "user1@example.com"}, ...]

# Single user
curl http://localhost:3000/users/1
# => {"id": 1, "name": "Example 1", "email": "user1@example.com"}

Edit your config

Open akuma.yml and add your own schemas and endpoints. Restart the server to pick up changes.

yaml
name: my-api

schemas:
  Category:
    properties:
      id: number
      name: string

  Product:
    properties:
      id: number
      name: string
      price: float
      category: Category    # relationship
      inStock: boolean

endpoints:
  - path: /categories
    method: GET
    response:
      type: array
      schema: Category

  - path: /products
    method: GET
    response:
      type: array
      schema: Product

  - path: /products/:id
    method: GET
    response:
      schema: Product

Schema names become tables by converting to snake_case and pluralizing, so this creates categories and products tables in SQLite, seeds them with example records, and ensures product categoryId values point to real categories.