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-commands-cao

v1.0.0

Published

[<ruby>**THE FUCK**<rp>(</rp><rt>纠正命令</rt><rp>)</rp></ruby>](https://i0.hdslb.com/bfs/openplatform/85c82bad2b27c6f18dac0d12fdcd4b53a81edd26.png) 当你输错命令时,只需触发 `fuck` 指令,就能帮你找到并执行正确的命令。

Downloads

217

Readme

koishi-plugin-commands-cao

npm

通过 fuck 命令纠正你输入的错误命令,并自动执行正确的命令。

  • 模仿命令行工具 thefuck 的功能,让你的 Koishi 机器人更加智能和便捷。

特性

  • 自动纠错: 自动识别并纠正用户输入的错误命令。
  • 多种纠错方式: 支持回复消息纠错和最近一次命令纠错。
  • 相似度匹配: 查找与错误命令相似的命令,并提供选择。
  • 参数保留: 纠正命令时,保留原始命令的参数。
  • 灵活配置: 提供多种配置选项,以满足不同需求。

使用方法

当你输入一个错误的命令后,可以使用 fuck 命令来尝试纠正你的错误并执行正确的命令。

插件会优先尝试纠正你回复的消息,如果没有回复消息,则会尝试纠正你最近一次输入的命令。

示例:

1. 回复消息进行纠正:

点我查看效果图

  1. 用户输入:hekp -H(错误的命令)
  2. 用户回复这条消息,并输入:fuck
  3. 插件会自动执行:help -H

2. 使用最近一次命令进行纠正:

点我查看效果图

  1. 用户输入:hekp -H(错误的命令)
  2. 然后输入:fuck
  3. 插件会自动执行:help -H

如果有多个相似的命令,可以使用:

点我查看效果图

  • fuck - 执行最匹配的命令
  • fuck fuck - 执行第二匹配的命令
  • fuck fuck fuck - 执行第三匹配的命令
  • 以此类推...

配置项

| 属性 | 类型 | 默认值 | 描述 | | ------------------------- | ------- | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------- | | commandName | string | "fuck" | 指令名称。可以自定义 fuck 命令的名称。 | | maxHistoryLength | number | 3 | 记录每个用户的(最近)历史消息数量。 | | similarityThreshold | number | 0.4 | 命令相似度阈值,超过此值才会被认为是相似命令。 | | chineseCommandThreshold | number | 0.3 | 中文命令相似度阈值,针对中文命令设置更宽松的匹配标准。 | | commandInfo | boolean | false | 返回即将执行的指令内容提示,与 -i 选项效果一致。⇒点我查看效果 | | loggerinfo | boolean | false | 日志调试:一般输出。提 issue 时请使用此功能。 | | loggeruserinputinfo | boolean | false | 日志输出用户输入。 |

指令选项

  • -i, --info: 输出纠正的指令。
  • -l, --list: 输出所有匹配指令。

注意事项

  • 插件会记录用户的历史消息,用于纠错。请注意保护用户隐私。
  • 相似度阈值会影响纠错的准确性。请根据实际情况调整。
  • 日志调试选项会输出大量信息,仅在调试时启用。

贡献

欢迎提交 issue 和 pull request!

License

MIT