跳转到主要内容

命令行界面模板

针对不同使用场景的预构建项目模板。

可用模板

React 模板

集成 AG-Kit 的全栈 React 应用。
ag-kit init my-app --template react
功能特性:
  • 基于 TypeScript 的 React 18
  • Vite 构建工具
  • AG-Kit 运行时集成
  • 示例聊天界面
  • 热模块替换

小程序模板

包含 AG-Kit 组件的微信小程序。
ag-kit init my-miniprogram --template miniprogram
功能特性:
  • 微信小程序结构
  • AG-Kit UI 组件库
  • TypeScript 支持
  • 示例聊天页面
  • 微信应用程序接口集成

Node.js 模板

带有 AG-Kit 适配器的后端应用程序接口服务。
ag-kit init my-api --template node
功能特性:
  • Express.js 服务端
  • AG-Kit 适配器
  • RESTful 应用程序接口端点
  • WebSocket 支持
  • 环境配置

模板定制

自定义模板

创建您专属的项目模板:
# 创建模板目录
mkdir -p ~/.ag-kit/templates/my-template

# 添加模板文件
cp -r my-project/* ~/.ag-kit/templates/my-template/

# 使用自定义模板
ag-kit init my-project --template my-template

模板结构

template/
├── package.json
├── src/
│   ├── index.js
│   └── components/
├── public/
│   └── index.html
├── .gitignore
└── README.md

框架集成

LangGraph 模板

ag-kit init my-agent --template react --framework langgraph

LangChain 模板

ag-kit init my-agent --template react --framework langchain

Dify 模板

ag-kit init my-agent --template react --framework dify