alova-wormhole-usage

devtools usage for alova. Use this skill whenever the user mentions alova openapi configuration, @alova/wormhole, API code generation, OpenAPI/Swagger with alova integration, alova devtools, or the alova VSCode extension. Trigger even for questions like "how do I use OpenAPI with alova" or "how do I generate API code with alova".

Safety Notice

This listing is imported from skills.sh public index metadata. Review upstream SKILL.md and repository scripts before running.

Copy this and send it to your AI assistant to learn

Install skill "alova-wormhole-usage" with this command: npx skills add alovajs/skills/alovajs-skills-alova-wormhole-usage

alova banner

Alova OpenAPI Integration

For client-side usage, see alova-client skill. For server-side (Node/Bun/Deno), see alova-server skill.

Alova integrates with OpenAPI/Swagger specs via @alova/wormhole to auto-generate API request functions and TypeScript types.

Workflow

Install → Create alova.config → Run alova gen → Customize alova instance → Use generated APIs

Alova Configuration

Configuration File

Supported formats:

  • alova.config.cjs: CommonJS configuration file
  • alova.config.js: ESModule configuration file
  • alova.config.ts: TypeScript configuration file

Use the alova init command to quickly create a configuration template.

import { defineConfig } from '@alova/wormhole';

export default defineConfig({
  // API generation settings array
  generator: [
    {
      // OpenAPI file URL or local path
      input: 'http://localhost:3000/openapi.json',

      // Output path
      output: 'src/api',

      // Platform type (swagger)
      platform: 'swagger',

      // Plugin configuration
      plugins: [],

      // Response data media type (default: application/json)
      responseMediaType: 'application/json',

      // Request body media type (default: application/json)
      bodyMediaType: 'application/json',

      // API version (default: auto)
      version: 'auto',

      // Code type: auto/ts/typescript/module/commonjs
      type: 'auto',

      // Global API export name (default: Apis)
      global: 'Apis',

      // Global mount object (default: globalThis)
      globalHost: 'globalThis',

      // Filter/transform API interface functions
      handleApi: (apiDescriptor) => apiDescriptor,
    },
  ],

  // Auto-update configuration
  autoUpdate: true, // or { launchEditor: true, interval: 5 * 60 * 1000 }
});

The defineConfig can also accept a sync or async function to allow for more dynamic configuration.

Preset Wormhole Plugins

PluginDescriptionDocumentation
renameRename API functions and parameter names, supports camelCase/snake_caseDocs
tagModifierModify API tag namesDocs
payloadModifierAdd/remove/modify API parameter typesDocs
filterApiFilter APIs by URL and tag matchingDocs
apifoxAuto-import Apifox projectsDocs
importTypeExclude types that need customizationDocs

Usage Example:

import { rename, tagModifier } from '@alova/wormhole/plugin';

export default defineConfig({
  generator: [
    {
      plugins: [
        rename({ style: 'camelCase' }),
        tagModifier({ ... })
      ]
    }
  ]
});

The handleApi Hook

Used to customize API configuration. Called before each API is generated. Can modify parameter names, types, or return types.

Note: The apiDescriptor parameter contains information for each API in the OpenAPI file. For details, refer to OpenAPI Spec Operation Object.

Rename function (snake_case → camelCase):

handleApi: (apiDescriptor) => {
  apiDescriptor.operationId = apiDescriptor.operationId.replace(/_([a-z])/g, (match, group) =>
    group.toUpperCase()
  );
  return apiDescriptor;
};

Modify Tags:

handleApi: (apiDescriptor) => {
  if (apiDescriptor.url.includes('/user')) {
    apiDescriptor.tags = ['userTag'];
  }
  return apiDescriptor;
};

Filter APIs:

handleApi: (apiDescriptor) => {
  // Return falsy value to filter this API
  if (!apiDescriptor.path.startsWith('/user')) {
    return;
  }
  return apiDescriptor;
};

Modify response data type generation:

handleApi: (apiDescriptor) => {
  apiDescriptor.responses = apiDescriptor.responses?.properties?.data;
  return apiDescriptor;
};

Prefer using Wormhole plugins over handleApi for modifying generated data. Plugins simplify the logic and execute in configuration order.

Features & Reference Docs

FeatureReference
Installation & setupreferences/INSTALLATION
CLI usage (alova gen, alova init)references/CLI
Programmatic API (generate, readConfig)references/PROGRAMMATIC-API
Customizing the alova instance (index.ts)references/ALOVA-INSTANCE
Troubleshootingreferences/TROUBLESHOOTING

Source Transparency

This detail page is rendered from real SKILL.md content. Trust labels are metadata-based hints, not a safety guarantee.

Related Skills

Related by shared tags or category signals.

Coding

alova-client-usage

No summary provided by upstream source.

Repository SourceNeeds Review
Coding

Self Updater

⭐ OPEN SOURCE! GitHub: github.com/GhostDragon124/openclaw-self-updater ⭐ ONLY skill with Cron-aware + Idle detection! Auto-updates OpenClaw core & skills, an...

Registry SourceRecently Updated
1171Profile unavailable
Coding

ClawHub CLI Assistant

Use the ClawHub CLI to publish, inspect, version, update, sync, and troubleshoot OpenClaw skills from the terminal.

Registry SourceRecently Updated
1.9K2Profile unavailable
Coding

SkillTree Learning Progress Tracker

Track learning across topics like an RPG skill tree. Prerequisites, milestones, suggested next steps. Gamified learning path.

Registry SourceRecently Updated
900Profile unavailable