Next.jsReact启动器

bixai-nextjs-agentsdk-statter-kit — Next.js 启动器模板

作者 soummyaanon

一个通过 CLI 脚手架生成 Next.js + OpenAI Agents SDK 起步项目的工具包,提供 default 与 handoffs 两套模板,并附带 API 路由、工具定义与生产指南。

看看你的网站会是什么样

浏览真实页面截图,比较内容排版与手机效果。点击下方缩略图切换,放大查看整页细节。

2 个预览视图
桌面端首页1 / 2
桌面端截图首屏预览

由服务器浏览器实际访问页面后截取。

全部页面与视图 2

截图用于了解视觉与布局,交互效果请以实际项目为准。

采集于 2026-10-14查看来源

值得关注的模板亮点

从已有项目资料中,快速了解它的特点。

01

通过 npx、pnpm dlx、yarn dlx 或 bunx 运行 CLI,交互式或带参数生成项目

02

提供 default(单 agent + calculator/weather 工具)与 handoffs(triage 路由到 math-specialist、weather-specialist)两套模板

03

同一 /api/agent 路由同时支持标准 JSON 响应与 SSE 流式响应

04

工具边界使用 Zod 校验,agent 执行层与路由处理器分离

05

生成项目内含 PRODUCTION_GUIDE.md,覆盖 auth、限流、持久会话与监控模式

06

CLI 支持 --pm、--install/--skip-install、--no-git、--no-telemetry 等选项

模板详细介绍

该仓库是 @bixai/create-agent-sdk-starter 的 CLI 工具,用于在本地快速生成一个 Next.js 16 App Router + OpenAI Agents SDK 的起步应用。README 说明生成的项目包含:app/api/agent/route.ts 路由、agents 目录下的 agent 定义、runtime/agentRunner.ts 运行时隔离层、tools 目录下基于 Zod 校验的 calculator 与 weather 工具,以及 PRODUCTION_GUIDE.md。API 路由同时支持标准 JSON 响应与 SSE 流式响应(通过 ?stream=true 查询参数切换)。CLI 支持交互式与参数式两种使用方式,可指定项目名、模板、包管理器、是否安装依赖、是否初始化 git,并可通过 --no-telemetry 关闭匿名遥测。

README 未提供生成应用的界面细节、组件实现、性能数据或部署到具体平台的步骤;previews 中的截图仅说明存在桌面与移动端预览,不代表页面功能。README 也未列出依赖清单中的具体版本号,仅说明 Node.js 需 20.9+(Next.js 16.x 的要求)。

Next.js启动器

适合你的项目吗?

适用场景

  • 需要快速搭建一个基于 OpenAI Agents SDK 的 Next.js 起步项目
  • 想对比单 agent 与多 agent handoffs 两种组织方式的原型
  • 需要在同一路由上同时试验 JSON 与 SSE 两种响应形式
  • 希望以带 Zod 校验的工具定义作为 agent 能力边界的起点

适合人群

  • 使用 Node.js 20.9+ 并熟悉 npm/pnpm/yarn/bun 之一的开发者
  • 需要 Next.js App Router 与 OpenAI Agents SDK 组合起步模板的团队
  • 希望从 CLI 脚手架开始、再按 PRODUCTION_GUIDE.md 补充生产配置的开发者

上手与定制指南

结合仓库当前版本的说明,按下面的资料检查内容、配置与运行要求。

  1. 1

    Node.js 需 20.9+,包管理器可用 npm、pnpm、yarn 或 bun

  2. 2

    运行 npx @bixai/create-agent-sdk-starter(或对应包管理器的 dlx/bunx 形式),按提示输入项目名、包管理器与是否安装依赖

  3. 3

    生成后复制 .env.local.example 为 .env.local 并填入 OPENAI_API_KEY,可选覆盖 OPENAI_MODEL 等变量

  4. 4

    用 npm run dev / pnpm dev / yarn dev / bun run dev 启动开发服务器,再通过 curl 测试 /api/agent 的 JSON 与 SSE 请求

  5. 5

    README 未提供部署到具体平台的步骤,生产相关配置需参考生成项目内的 PRODUCTION_GUIDE.md

查看仓库使用说明

授权与来源资料

使用条件与限制

免费使用 · 保留许可声明

本次收录的是公开仓库中采用 MIT 许可的免费版本;免费范围为该版本代码,不代表外部服务或第三方素材免费。

使用时需要遵守

  • 允许免费使用、修改、商用和分发该版本代码。
  • 分发代码副本或实质性部分时,保留原作者版权声明和完整 MIT 许可声明。
  • 代码按现状提供;担保与责任限制以原许可证及适用法律为准。

额外费用与待核对事项

  • 演示图片、字体、图标及其他第三方素材需按各自许可核对,不能仅凭代码的 MIT 许可判断。
  • 域名、托管、数据库、支付或 AI 等外部服务可能另外收费。
  • 生成项目后需将 .env.local.example 复制为 .env.local 并填入自己的 OPENAI_API_KEY 才能调用 OpenAI Agents SDK。
  • 必须提供有效的 OPENAI_API_KEY(sk-...)作为环境变量,否则无法使用 agent 功能。
  • 运行环境要求 Node.js 20.9+(Next.js 16.x 的要求),低于该版本无法使用。
  • CLI 默认收集匿名使用遥测,需通过 --no-telemetry 或设置 BIXAI_TELEMETRY=0 / DO_NOT_TRACK=1 才能关闭。
  • 生产环境的 auth、限流、持久会话与监控需自行参考生成项目内的 PRODUCTION_GUIDE.md 实现,脚手架本身不包含这些生产配置。
查看原文依据

Permission is hereby granted, free of charge

许可证原文

cp .env.local.example .env.local # add your OPENAI_API_KEY

README 原文

OPENAI_API_KEY=sk-...

README 原文

- **Node.js `20.9+`** — required by Next.js 16.x

README 原文

| `--no-telemetry` | Disable anonymous usage telemetry (also via `BIXAI_TELEMETRY=0` or `DO_NOT_TRACK=1`). |

README 原文

See `PRODUCTION_GUIDE.md` in the generated project for auth, rate limiting, persistent sessions, and monitoring.

README 原文
https://github.com/soummyaanon/bixai-nextjs-agentsdk-statter-kit/blob/main/LICENSEhttps://github.com/soummyaanon/bixai-nextjs-agentsdk-statter-kit/blob/main/README.md

DeepSeek 根据仓库许可证和 README 整理 ·2026-10-14。结果仅覆盖已读取资料,依赖、图片、字体及后续条款变更以各自原文为准。

项目核对记录与介绍依据

模板资料

来源平台
GitHub
资料与维护参考分
资料较完整 · 83 / 100
技术栈
Next.js · React
网站类型
启动器
这个分数如何计算

本站按许可资料(最高30分)、演示链接(12分)、预览图(10分)、Star数(15分)、记录的维护时间(15分)、描述完整度(8分)、功能记录(5分)和分类资料(5分)计算。它不是代码、安全或性能测试,也不是 Google 评分;有链接不代表已实测可用。

这个项目需要核对什么

记录的仓库更新时间
2026-10-13
截图检查日期
2026-10-14

已收录演示链接。请用你的内容与屏幕尺寸检查;有演示不代表表单、认证或支付已经可用。

目录记录的主要技术栈是 Next.js。请通过依赖清单和锁文件核对实际版本与托管要求。这些说明基于收录资料,不代表代码审计或部署实测。

查看具体选型方法 →

介绍的制作与核对状态

介绍由 AI 辅助整理目录与仓库资料。仓库作者不等于这篇介绍的审核者。

审核声明: codex-user-requested-batch-review-20261015 · 2026-10-15

查看当时使用的来源资料

SHA-256: 46a9402672365b27664d4e5b014777a9fbe3204b1d27cfe4d39810af1930866a

2026-10-14T15:52:58.994Z

来源文件 / 仓库
# @bixai/Agent SDK Statter Kit

[![npm](https://img.shields.io/npm/v/@bixai/create-agent-sdk-starter)](https://www.npmjs.com/package/@bixai/create-agent-sdk-starter)
[![license](https://img.shields.io/npm/l/@bixai/create-agent-sdk-starter)](LICENSE)
[![node](https://img.shields.io/node/v/@bixai/create-agent-sdk-starter)](https://nodejs.org)
[![AweOSS Score](https://api.aweoss.dev/badge/soummyaanon/bixai-nextjs-agentsdk-statter-kit.svg?style=plastic&type=score)](https://aweoss.dev/projects/soummyaanon-bixai-nextjs-agentsdk-statter-kit)

CLI to scaffold a production-ready **Next.js + OpenAI Agents SDK** starter app in seconds.

If this helps you ship agent apps faster, consider giving it a ⭐ [star on GitHub](https://github.com/soummyaanon/bixai-nextjs-agentsdk-statter-kit)!

---

## What you get

- **Next.js 16 App Router** — baseline project, no cruft
- **OpenAI Agents SDK** — integrated and configured out of the box
- **Tool-first architecture** — typed tool boundaries with Zod validation
- **Dual transport** — standard JSON responses and SSE streaming on the same route
- **Live agent indicator** — the UI shows which agent is active, including across handoffs
- **Runtime isolation** — agent execution layer is separate from route handlers
- **Multiple templates** — `default` (single agent + tools) and `handoffs` (triage → specialists)
- **Production guide** — auth, rate limiting, persistent sessions, and monitoring patterns included

---

## Requirements

- **Node.js `20.9+`** — required by Next.js 16.x
- Any of: `npm`, `pnpm`, `yarn`, or `bun`

---

## Quick start

```bash
npx @bixai/create-agent-sdk-starter
# Prompts for:
#   - project name  (e.g. my-agent-app)
#   - package manager  (npm / pnpm / yarn / bun)
#   - install dependencies now  (Y/n)
cd my-agent-app
cp .env.local.example .env.local   # add your OPENAI_API_KEY
npm run dev
```

## Create a new app

```bash
# npm
npx @bixai/create-agent-sdk-starter

# pnpm
pnpm dlx @bixai/create-agent-sdk-starter

# yarn
yarn dlx @bixai/create-agent-sdk-starter

# bun
bunx @bixai/create-agent-sdk-starter
```

**Skip the prompt** by passing the project name directly:

```bash
npx @bixai/create-agent-sdk-starter my-app
```

**Install globally** and reuse:

```bash
npm install -g @bixai/create-agent-sdk-starter
create-agent-sdk-starter
```

---

## CLI reference

```
create-agent-sdk-starter [project-name] [options]
```

| Option | Description |
|---|---|
| `project-name` | Target directory name. Prompts interactively if omitted. |
| `-t, --template <name>` | Template to scaffold: `default` or `handoffs`. Default: `default`. |
| `-y, --yes` | Skip prompts and use sensible defaults (pnpm, install, git init). |
| `--pm <manager>` | Package manager: `pnpm`, `npm`, `yarn`, or `bun`. |
| `--install` / `--skip-install` | Force install or skip install of dependencies. |
| `--no-git` | Skip the initial `git init` + commit. |
| `--no-telemetry` | Disable anonymous usage telemetry (also via `BIXAI_TELEMETRY=0` or `DO_NOT_TRACK=1`). |
| `-V, --version` | Print the CLI version. |

**Templates**

| Template | What it ships |
|---|---|
| `default` | Single-agent starter — `mainAgent` plus calculator and weather tools. |
| `handoffs` | Multi-agent starter — `triageAgent` routes to `math-specialist` and `weather-specialist` via the SDK's `handoffs` feature. |

**Examples**

```bash
# Scripted, no prompts, npm, skip install
npx @bixai/create-agent-sdk-starter my-app -y --pm npm --skip-install

# Multi-agent handoffs template
npx @bixai/create-agent-sdk-starter my-handoffs-app --template handoffs -y
```

- Fails early if the target directory already exists
- Interactive mode (no flags, no project name) prompts for package manager and install
- `-y` defaults to pnpm + install + git init
- Automatically renames `gitignore` → `.gitignore` post-copy
- Drops lockfiles that don't match the chosen package manager
- Initializes a git repo with an initial commit unless `--no-git` is passed

---

## Generated structure

**`default` template**

```
my-agent-app/
  app/
    api/agent/route.ts
    _components/
  agents/main.agent.ts
  runtime/agentRunner.ts
  tools/calculator.tool.ts
  tools/weather.tool.ts
  PRODUCTION_GUIDE.md
  package.json
```

**`handoffs` template**

```
my-agent-app/
  app/
    api/agent/route.ts
    _components/
  agents/triage.agent.ts      # orchestrator (no tools)
  agents/math.agent.ts        # specialist (calculator)
  agents/weather.agent.ts     # specialist (weather)
  agents/main.agent.ts        # re-exports triage as mainAgent
  runtime/agentRunner.ts
  tools/calculator.tool.ts
  tools/weather.tool.ts
  PRODUCTION_GUIDE.md
  package.json
```

---

## Configure

Copy `.env.local.example` to `.env.local` and add your key:

```bash
OPENAI_API_KEY=sk-...

# Optional overrides
# OPENAI_MODEL=gpt-4o-mini
# AGENTS_TRACING_DISABLED=true
# AGENTS_TRACE_INCLUDE_SENSITIVE_DATA=false
# AGENT_LOCAL_SESSION_TTL_MS=1800000
# AGENT_MAX_LOCAL_SESSIONS=200
```

Then start the dev server:

```bash
npm run dev        # npm
pnpm dev           # pnpm
yarn dev           # yarn
bun run dev        # bun
```

---

## Test the API

**Standard (JSON) request:**

```bash
curl -X POST http://localhost:3000/api/agent \
  -H "content-type: application/json" \
  -d '{"message":"What is 42 multiplied by 13?"}'
```

**Streaming (SSE) request:**

```bash
curl -N -X POST "http://localhost:3000/api/agent?stream=true" \
  -H "content-type: application/json" \
  -d '{"message":"Explain binary search in 5 lines"}'
```

See `PRODUCTION_GUIDE.md` in the generated project for auth, rate limiting, persistent sessions, and monitoring.

---

## Troubleshooting

**`npx` fails on older Node** — Upgrade to Node.js `20.9+` and retry.

**npm README is stale** — npm renders the README bundled at publish time. Updates require a new package version.

**macOS `EPERM` under `~/.npm`** — Fix permissions:

```bash
sudo chown -R "$(id -u)":"$(id -g)" ~/.npm
```

---

## License

[MIT](LICENSE)

---

## Author

**[Soumyaranjan Panda](https://github.com/soummyaanon)** — [@soummyaanon](https://github.com/soummyaanon)
反馈内容错误

看看同类模板

对比同技术栈与用途的模板,找到更适合的视觉与内容结构。