← 返回命令列表

Linux command

uigen 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Scaffold a new uigen project

npx @uigen-dev/cli init

Example

npx @uigen-dev/cli serve [openapi.yaml]

Example

npx @uigen-dev/cli serve [openapi.yaml] --proxy-base [http://localhost:8000]

Bundle for production

npx @uigen-dev/cli build --spec [openapi.yaml]

Example

npx @uigen-dev/cli serve --spec [api/openapi.yaml]

说明

uigen is an OpenAPI-to-UI compiler. It reads an OpenAPI 3.x specification, parses it into a framework-agnostic Intermediate Representation containing resources, operations, schemas, authentication flows, and pagination strategies, and renders a complete React frontend at runtime. There is no code-generation step — the rendered UI is recomputed each time the server starts (or on hot reload), so changes to the spec are reflected immediately. Out of the box uigen produces table views with sorting, filtering, and pagination; create and edit forms with validation derived from JSON schemas; detail views with cross-resource links; charts; file uploads; and authentication flows for OAuth 2.0, Bearer tokens, and API keys. Theme customization and AI-native "agent skills" let downstream tools (e.g. Claude Code) extend the generated app without touching generated source files.

参数

init
Scaffold a new project including configuration files, agent skills, and an example OpenAPI spec.
serve _spec_
Start a development server rendering the UI from _spec_ at runtime. Defaults to http://localhost:4400.
build _spec_
Produce a production bundle of the rendered UI for static or server-side hosting.
--spec _file_
Alternative way to specify the OpenAPI file when the subcommand expects no positional argument.
--proxy-base _url_
Forward API calls made by the rendered UI to a backend at _url_ (useful in local development).
--port _n_
Override the default development-server port (4400).

FAQ

What is the uigen command used for?

uigen is an OpenAPI-to-UI compiler. It reads an OpenAPI 3.x specification, parses it into a framework-agnostic Intermediate Representation containing resources, operations, schemas, authentication flows, and pagination strategies, and renders a complete React frontend at runtime. There is no code-generation step — the rendered UI is recomputed each time the server starts (or on hot reload), so changes to the spec are reflected immediately. Out of the box uigen produces table views with sorting, filtering, and pagination; create and edit forms with validation derived from JSON schemas; detail views with cross-resource links; charts; file uploads; and authentication flows for OAuth 2.0, Bearer tokens, and API keys. Theme customization and AI-native "agent skills" let downstream tools (e.g. Claude Code) extend the generated app without touching generated source files.

How do I run a basic uigen example?

Run `npx @uigen-dev/cli init` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does init do in uigen?

Scaffold a new project including configuration files, agent skills, and an example OpenAPI spec.