搜索插件、代码仓与 APP 分类

插件详情v0.2.2

nenuphar_cli

由 Very Good CLI 创建的用于 Dart Frog 的 OpenAPI 生成 CLI。

AndroidiOSWebmacOSWindowsLinux
近 30 天下载
58
喜欢数
29
Pub 分数
130

安装插件

flutter pub add nenuphar_cli

插件介绍

基于插件公开信息、社区数据与项目使用情况整理的选型参考。

Nenuphar CLI 是一个命令行工具,用于从 API 定义生成 OpenAPI 规范和 Dart 代码,专为与 Dart Frog 集成而设计。由 Very Good CLI 开发,它通过基于 OpenAPI 模式的自动化创建类型安全的客户端代码,简化了后端到前端的开发流程。该工具支持 Android、iOS、Web、macOS、Windows 和 Linux 多个平台,非常适合全栈 Dart 应用程序。它通过减少手动编写样板代码并确保 API 合同与实现之间的一致性,提升了开发效率。

适合场景

  • 从 OpenAPI 规范生成客户端代码
  • 自动化API契约同步
  • 将 OpenAPI 集成到 Dart Frog 项目中
  • 简化全栈 Dart 开发
  • 在Flutter应用中启用类型安全的API调用

主要特点

  • OpenAPI 规范生成
  • Dart 客户端代码生成
  • 无缝 Dart Frog 集成
  • 多平台支持
  • 用于自动化的命令行界面
  • 支持 REST API 合同

适合对象

  • Dart Frog 开发者
  • 全栈 Dart 团队
  • 以 API 为先的开发工作流程
  • 使用 OpenAPI 规范的团队
  • 寻求自动化客户端生成的开发者

使用建议

  • 需要以 OpenAPI 规范作为输入
  • 仅限 Dart Frog 生态系统
  • 依赖外部 OpenAPI 模式质量
  • 可能需要为复杂 API 进行配置
  • 不适用于非 Dart Frog 项目

原始 README

以下为关联源码仓库的 README 原文快照,最新内容请访问源码仓库。

Nenuphar - Your OpenAPI generator CLI

nenuphar logo generated using Microsoft Designer

style: very good analysis License: MIT

Nenuphar is a CLI application to generate Swagger UI OpenAPI definition files for your Dart Frog Server.

https://github.com/PiotrFLEURY/nenuphar_cli/assets/25879276/1590e803-7888-4fa0-8555-2f29f2035bd1


Dart Frog

Dart Frog is a minimalistic backend framework for Dart.

Create a new Dart Frog project

To create a new Dart Frog backend project, run the following command:

dart pub global activate dart_frog_cli
dart_frog create <project name>

Nenuphar CLI

Installation

dart pub global activate nenuphar_cli

Initialize your project

First you need to initialize your project by running the following command in the root of your project:

nenuphar init

This will create new file public/index.html. This file will be served statically by your Dart Frog server to expose your Swagger UI documentation.

Generate openapi definition file

Nenuphar scans your Dart Frog project to generate an OpenAPI definition file. Each route will generate the CRUD operations documentation for the exposed resource.

First create a Dart Frog route:

dart_frog new route "/todos"

Then generate the OpenAPI definition file

nenuphar gen

The openapi specification will be written in the public/openapi.json file. This file is loaded by the public/index.html file to display the documentation.

Start your Dart Frog server

You're now ready to start your Dart Frog server

dart_frog dev

Visit http://localhost:8080/index.html to see your documentation.

open http://localhost:8080/index.html

Enjoy 🎉

Thanks for using Nenuphar!

Detailed documentation

Please visit https://piotrfleury.github.io/nenuphar_cli/ for detailed documentation.

Generated by the Very Good CLI 🤖


所属分类

依赖

依赖清单 6 项

源码仓库

使用此插件的项目

暂无相关数据。