npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

koishi-plugin-talkcode

v1.0.2

Published

AI应用生成平台 Koishi 插件

Readme

koishi-plugin-talkcode

AI应用生成平台 Koishi 插件 - 通过聊天对话生成代码并部署应用

简介

这个插件集成了"出口成码 AI应用生成平台",允许用户通过 Koishi 机器人对话来:

  • 生成应用程序代码(支持 Node.js 和 Python Flask)
  • 自动部署到远程服务器
  • 管理和监控项目状态

安装

# 在 Koishi 根目录下执行
npm install koishi-plugin-talkcode

配置

在 Koishi 配置文件中添加插件:

plugins:
  talkcode:
    # API服务地址(必填)
    apiUrl: http://localhost:3000
    # 默认编程语言(可选,默认: nodejs)
    defaultLanguage: nodejs
    # 生成超时时间(可选,默认: 300秒)
    timeout: 300

使用方法

基础命令

1. 生成代码

生成代码 一个简单的待办事项应用

# 指定语言
生成代码 一个博客系统 -l python

# 指定项目名称
生成代码 一个博客系统 -n myblog

2. 查看项目状态

# 查看指定项目
查看状态 1

# 查看所有项目
查看状态

3. 部署项目

部署项目 1

4. 查看部署日志

查看日志 1

5. 查看项目文件

查看文件 1

6. 重新生成文件

# 重新生成所有文件
重新生成 1

# 重新生成指定文件
重新生成 1 app.js

7. 删除项目

删除项目 1

8. 配置管理

# 查看所有配置
配置管理

# 查看单个配置
配置管理 openai_model

# 更新配置
配置管理 openai_model gpt-4

使用示例

示例1:生成一个简单的Node.js应用

用户: 生成代码 一个简单的计算器应用
机器人: 🚀 正在生成代码,请稍候...
机器人: ✅ 项目创建成功!
机器人: 📦 项目ID: 1
机器人: 📝 项目名称: 项目_1234567890
机器人: 💻 语言: nodejs
机器人: 🔗 访问地址: 待部署
机器人: 📊 状态: 🔄 生成中
机器人:
机器人: 💡 提示: 使用 "部署项目 1" 部署项目
机器人: 💡 提示: 使用 "查看状态 1" 查看生成进度

示例2:生成并部署Python Flask应用

用户: 生成代码 一个简单的Flask博客 -l python -n myblog
机器人: 🚀 正在生成代码,请稍候...
机器人: ✅ 项目创建成功!

用户: 部署项目 1
机器人: 🚀 正在部署项目,请稍候...
机器人: ✅ 部署已启动!

用户: 查看状态 1
机器人: 📦 项目信息
机器人: ─────────────────
机器人: 🆔 ID: 1
机器人: 📝 名称: myblog
机器人: 📄 描述: 一个简单的Flask博客
机器人: 💻 语言: python
机器人: 📊 状态: 🌐 已部署
机器人: 🔌 端口: 10001
机器人: 🌐 域名: app1.cloudstudio.site
机器人: ─────────────────

示例3:查看和修改配置

用户: 配置管理
机器人: ⚙️ 当前配置:
机器人:
机器人: 🔑 openai_base_url: https://api.openai.com/v1
机器人:    OpenAI API基础URL
机器人:
机器人: 🔑 openai_model: claude-4.5-sonnet
机器人:    OpenAI模型名称
机器人:
机器人: 🔑 port_start: 10001
机器人:    端口分配起始值

用户: 配置管理 port_start 20000
机器人: ✅ 配置已更新: port_start = 20000

功能特性

  • ✅ 支持多种编程语言(Node.js、Python Flask)
  • ✅ AI自动生成完整应用代码
  • ✅ 自动部署到远程服务器
  • ✅ 实时查看生成和部署进度
  • ✅ 项目管理(创建、查看、删除)
  • ✅ 文件管理(查看、重新生成)
  • ✅ 日志查看
  • ✅ 配置管理
  • ✅ 数据库持久化项目记录

技术架构

  • 前端: Koishi 机器人插件
  • 后端: AI应用生成平台 API
  • 数据库: Koishi 数据库(存储项目记录)
  • 通信: REST API

配置项说明

| 配置项 | 类型 | 默认值 | 说明 | |--------|------|--------|------| | apiUrl | string | http://localhost:3000 | AI应用生成平台的API地址 | | defaultLanguage | nodejs|python | nodejs | 默认编程语言 | | timeout | number | 300 | 生成超时时间(秒) |

注意事项

  1. 确保 AI应用生成平台服务已启动并可访问
  2. 首次使用前需要在平台配置 OpenAI API 密钥
  3. 如果需要部署功能,需要在平台配置服务器 SSH 信息
  4. 生成大型项目可能需要较长时间,请耐心等待

故障排除

连接失败

如果提示连接失败,请检查:

  1. AI应用生成平台服务是否正常运行
  2. apiUrl 配置是否正确
  3. 网络连接是否正常

生成超时

如果生成超时,可以:

  1. 增加配置中的 timeout 值
  2. 使用更简短的描述
  3. 检查 OpenAI API 是否正常

部署失败

如果部署失败,请检查:

  1. 服务器 SSH 配置是否正确
  2. 服务器是否有足够的资源
  3. 使用 查看日志 <id> 查看详细日志

许可证

MIT

贡献

欢迎提交 Issue 和 Pull Request!