wormaworma

Quick Start

Generate your first API and try VSCode hover docs in 5 minutes

Generate your first API and experience VSCode hover docs in 5 minutes.

Step 1: Install

npm i wormajs -D
yarn add wormajs -D
pnpm add wormajs -D
bun add wormajs -D

For convenience, we recommend adding the following scripts to package.json:

{
  "scripts": {
    "worma:init": "worma init",
    "worma:gen": "worma gen"
  }
}

After that, run npm run worma:init to initialize and npm run worma:gen to generate code.

Step 2: Initialize

Run in your project root:

worma init

This creates a worma.config.js (or .cjs/.mjs/.ts) file, with the alova template and the aiDoc plugin (for AI Skill docs) configured by default:

import { defineConfig } from "wormajs";
import { alova, aiDoc, swagger } from "wormajs/plugin";

export default defineConfig({
  generator: [
    {
      output: "src/api",
      plugins: [swagger("https://api.example.com"), alova(), aiDoc()],
    },
  ],
});

If you already have an OpenAPI document URL, you can also edit .wormarc for quick configuration:

https://api.example.com/openapi.json

Step 3: Generate

worma gen

Choose a template

worma ships several predefined templates covering mainstream request libraries:

TemplateRequest libraryHighlights
alovaalova@3Functional calls, tree-shakable
alovaGlobalsalova@3Globally mounted Apis.xxx, the former @alova/wormhole template, migration-friendly
axiosaxiosThe most popular HTTP client
fetchnative fetchZero extra dependencies
kykyLightweight fetch wrapper

If none of these fit, worma supports fully custom templates using Handlebars syntax to control the structure and content of generated code freely.

Step 4: Try the VSCode extension

Install the Worma VSCode extension, or search for "worma" in the marketplace, to get:

  • Hover for API details — hover over a generated API call to see its path, parameter table, response structure, and more
  • Sidebar API explorer — browse all APIs grouped by tag in the VSCode sidebar, with search support
  • Auto-detect changes — automatically regenerate when backend APIs change
  • JS type hints — even with plain JavaScript, get full type hints and doc display

See In-Editor Docs for details.

Next steps

On this page