Token导航 LogoToken导航TokenDH.com
研究检索external-servicegithub未标认证来源可访问许可证需确认审计提醒

orvalorval 搜索

Agent Skill

orval 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

总安装

3,585

周安装

154

GitHub Stars

5,729

下载量

1,257
CodexClaudeCursorGemini CLI

安装说明

本站只整理中文说明和来源信息,不托管安装包,也不代用户安装。

GitHub

来源数

2

许可证

unknown

最后核验

2026-05-01

来源状态

来源可访问

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:orval(orval 搜索)
来源仓库:https://github.com/orval-labs/orval
仓库路径:skills/orval
安装命令:
npx skills add https://github.com/orval-labs/orval --skill orval
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/orval-labs/orval --skill orval

简介

orval 用于查找、检索和筛选相关信息。

  • 适合在 Codex、Claude、Cursor、Gemini CLI 中根据关键词或任务场景快速定位候选结果。
  • 通过 npx skills add 命令从指定 GitHub 仓库安装并使用。
  • 安装前建议确认权限范围和维护状态,注意是否会触发联网或文件读写操作。
  • 可结合来源仓库和原始 README 进一步核验具体用法和功能边界。

SKILL.md

Orval - OpenAPI to TypeScript Code Generator

Orval generates type-safe TypeScript clients, hooks, schemas, mocks, and server handlers from OpenAPI v3/Swagger v2 specifications.

Quick Start

Installation

npm install orval -D
# or yarn add orval -D
# or pnpm add orval -D
# or bun add orval -D

Minimal Configuration

import { defineConfig } from 'orval';

export default defineConfig({
  petstore: {
    input: {
      target: './petstore.yaml',
    },
    output: {
      target: './src/api/petstore.ts',
      schemas: './src/api/model',
      client: 'react-query',
    },
  },
});

Run

npx orval
npx orval --config ./orval.config.ts
npx orval --project petstore
npx orval --watch

Choosing Your Setup

Client Selection Guide

Use CaseClienthttpClientNotes
React with server statereact-queryfetch or axiosTanStack Query hooks
Vue 3 with server statevue-queryfetch or axiosTanStack Query for Vue
Svelte with server statesvelte-queryfetch or axiosTanStack Query for Svelte
SolidJS standalone appsolid-queryfetch or axiosTanStack Query for Solid
SolidStart full-stacksolid-startnative fetchUses query()/action() primitives
Angular with signalsangular-queryangularInjectable functions, signal reactivity
Angular traditionalangularHttpClient services
React with SWRswrfetch or axiosVercel SWR hooks
Lightweight / EdgefetchZero dependencies, works everywhere
Node.js / existing Axiosaxios-functionsFactory functions (default)
Axios with DIaxiosInjectable Axios instance
Validation onlyzodZod schemas, no HTTP client
Backend API serverhonoHono handlers with Zod validation
AI agent toolsmcpModel Context Protocol servers

Mode Selection Guide

  • single — Everything in one file. Best for small APIs.
  • split — Separate files: petstore.ts, petstore.schemas.ts, petstore.msw.ts. Good for medium APIs.
  • tags — One file per OpenAPI tag + shared schemas. Organizes by domain.
  • tags-split — Folder per tag with split files. Best for large APIs. Recommended.

httpClient Option

For react-query, vue-query, svelte-query, and swr clients:

output: {
  client: 'react-query',
  httpClient: 'fetch',  // 'fetch' (default) | 'axios'
}

For angular-query:

output: {
  client: 'angular-query',
  httpClient: 'angular',  // Uses Angular HttpClient
}

Configuration Reference

Config Structure

import { defineConfig } from 'orval';

export default defineConfig({
  [projectName]: {
    input: InputOptions,
    output: OutputOptions,
    hooks: HooksOptions,
  },
});

Multiple projects can share the same config file with different input/output settings.

Input Options

input: {
  target: './spec.yaml',              // Path or URL to OpenAPI spec (required)
  override: {
    transformer: './transform.js',    // Transform spec before generation
  },
  filters: {
    mode: 'include',                  // 'include' | 'exclude'
    tags: ['pets', /health/],         // Filter by OpenAPI tags
    schemas: ['Pet', /Error/],        // Filter by schema names
  },
  parserOptions: {
    headers: [                        // Auth headers for remote spec URLs
      {
        domains: ['api.example.com'],
        headers: {
          Authorization: 'Bearer YOUR_TOKEN',
          'X-API-Key': 'your-api-key',
        },
      },
    ],
  },
}

Output Options

output: {
  target: './src/api/endpoints.ts',     // Output path (required)
  client: 'react-query',               // Client type (see table above)
  httpClient: 'fetch',                  // 'fetch' (default) | 'axios' | 'angular'
  mode: 'tags-split',                   // 'single' | 'split' | 'tags' | 'tags-split'
  schemas: './src/api/model',           // Output path for model types
  operationSchemas: './src/api/params', // Separate path for operation-derived types
  workspace: 'src/',                    // Base folder for all files
  fileExtension: '.ts',                 // Custom file extension
  namingConvention: 'camelCase',        // File naming: camelCase | PascalCase | snake_case | kebab-case
  indexFiles: true,                     // Generate index.ts barrel files
  clean: true,                          // Clean output before generating
  prettier: true,                       // Format with Prettier
  biome: true,                          // Format with Biome
  headers: true,                        // Generate header parameters
  baseUrl: '/api/v2',                   // API base URL
  // or from spec:
  // baseUrl: { getBaseUrlFromSpecification: true, index: 0, variables: { environment: 'api.dev' } },
  mock: true,                           // Generate MSW handlers (boolean or config object)
  docs: true,                           // Generate TypeDoc documentation
  // docs: { configPath: './typedoc.config.mjs' },
  allParamsOptional: true,              // Make all params optional (except path params)
  urlEncodeParameters: true,            // URL-encode path/query parameters
  optionsParamRequired: false,          // Make options parameter required
  propertySortOrder: 'Specification',   // 'Alphabetical' | 'Specification'
  tsconfig: './tsconfig.json',          // Custom tsconfig path
  override: { ... },                    // Advanced overrides (see below)
}

Multiple API Specs

export default defineConfig({
  petstoreV1: {
    input: { target: './specs/v1.yaml' },
    output: { target: 'src/api/v1', client: 'react-query' },
  },
  petstoreV2: {
    input: { target: './specs/v2.yaml' },
    output: { target: 'src/api/v2', client: 'react-query' },
  },
});

Filter Endpoints

input: {
  target: './spec.yaml',
  filters: {
    mode: 'include',
    tags: ['pets'],
  },
}

Detailed Guides

When the user's question involves a specific topic below, read the corresponding file from this skill's directory.

TopicFileLoad when user asks about...
TanStack Query / SWRtanstack-query.mdReact Query, Vue Query, Svelte Query, Solid Query, SWR, query hooks, invalidation, infinite queries, suspense, prefetch
Angularangular.mdAngular Query, Angular HttpClient, signals, inject functions, Angular services, providedIn
SolidStartsolid-start.mdSolidStart, @solidjs/router, query(), action(), createAsync, revalidate
Custom HTTP / Authcustom-http-clients.mdCustom mutator, authentication, tokens, interceptors, custom fetch/axios, baseURL, hook-based mutator
Zod Validationzod-validation.mdZod schemas, validation, runtime validation, coerce, strict, preprocess
Mocking / MSWmocking-msw.mdMSW mocks, testing, test setup, faker, Vitest, mock handlers, useExamples
Hono Serverhono.mdHono handlers, zValidator, composite routes, context types, server-side generation
Advanced Configadvanced-config.mdType generation, enums, per-operation overrides, FormData, JSDoc, params serializer, full example
Tooling / Workflowtooling-workflow.mdProgrammatic API, transformers, hooks, NDJSON streaming, MCP, afterAllFilesWrite

OpenAPI Specification Best Practices

  1. Use unique operationId for every operation — Orval uses these for function and hook names
  2. Define reusable schemas in components/schemas — reduces duplication in generated types
  3. Use tags to group operations — works with tags and tags-split modes
  4. Define response types for all operations — enables full type safety
  5. Mark required fields — affects optional/required in generated TypeScript interfaces
  6. Use x-enumNames for numeric enums — generates readable const names
  7. Provide example values — used by mock generation when useExamples: true
  8. Use application/x-ndjson content type for streaming endpoints — enables typed NDJSON generation

CLI Reference

orval                                    # Generate using auto-discovered config
orval --config ./api/orval.config.ts     # Specify config file
orval --project petstore                 # Run specific project(s)
orval --watch                            # Watch mode
orval --watch ./src                      # Watch specific directory
orval --clean                            # Clean generated files
orval --prettier                         # Format with Prettier
orval --biome                            # Format with Biome
orval --tsconfig ./src/tsconfig.json     # Custom tsconfig path
orval --mode split                       # Override output mode
orval --client react-query               # Override client
orval --mock                             # Override mock generation
orval --input ./spec.yaml --output ./api.ts  # Direct generation

Resources

适合场景

01

用户想查找某类 Agent Skill 时

02

需要根据任务场景推荐可安装能力包时

03

需要对比不同来源的安装命令和来源信息时

能力概览

能力 1

按任务关键词查找相关 Skills

能力 2

展示可复制的安装命令

能力 3

保留来源站点、仓库和原始说明,方便继续核验

能力 4

展示第三方安全扫描或审计结果

安装后应在对应宿主中按原始 README 的触发条件使用;具体调用方式请以来源页面和 README 为准。

平台分布

Codex

34.87%
按下载量换算438

Claude

32.38%
按下载量换算407

Cursor

18.25%
按下载量换算229

Gemini CLI

9.45%
按下载量换算119

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

可疑

权限和风险

external-service

该 Skill 可能调用第三方服务、云服务或外部模型 API,使用前需要确认账号、额度、数据发送范围和服务条款。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在 warning/failed 结果,不能写成本站确认安全。当前只有一个来源,正式发布前建议补源仓库或其他目录站核验。

来源信息

继续浏览同类 Skills