无意中注意到腾讯云发布了用命令行交互的智能编程助手CodeBuddy code CLI,尝试一下它的效果如何。我把生成的代码文件放在了Gitee仓库上。
#CodeBuddy Code #AI CLI #无界生成力
在powershell输入一条命令安装
npm install -g @tencent-ai/codebuddy-code
再新建或者打开一个文件夹,codebuddy会把生成的文件放到当前目录下面。然后启动
codebuddy
第一次启动需要选登录方式,我选择微信登录,默认设置不做改动。然后就出现下面这样的输入界面
在这里就可以向模型提问或者输入指令,需要换行的话可以按Ctrl
+ Enter
键。
我以前只使用过像通义灵码和Marscode这些辅助代码完成的插件,而codebuddy CLI可以自动创建出代码文件而且会自己组织目录结构,这样的工具还是第一次使用,感觉很新颖。
尝试让codebuddy生成一个网页小游戏。这个小游戏的大概规则是:
然后往codebuddy CLI的输入框里输入下面的指令:
please create a web application called 'Wax Block Puzzle Game'
The core enjoyment of this wax block puzzle game lies in precise control and strategic planning. Players must reach the
endpoint while keeping the wax block as intact as possible. Below is the detailed design plan:
1. Wax Block Properties
1.1 Initially shaped as a rectangle or circle with a specific surface area.
1.2 Maintains its overall form during movement.
1.3 Upon contact with walls, the touching surface melts, reducing the block’s area.
1.4 Game over if the area decreases to zero.
2. Level Design
2.1 Enclosed spaces with walls serving as boundaries and obstacles.
2.2 Fixed starting and endpoint positions.
2.3 Difficulty adjustable through wall complexity (e.g., narrow passages, intricate layouts).
3. Control Scheme
3.1 Movement via keyboard arrow keys or WASD.
4. Scoring System
4.1 Initial area set as the baseline score (e.g., 100 points).
4.2 Points deducted proportionally to area lost from wall contacts.
4.3 Final score = remaining area upon reaching the endpoint.
然后codebuddy就会生成一个to-do list,一步步完成工作。每次产生一份文件(比如.html,.css文件)之前会展示文件内容预览并询问是否保存,在保存之前可以给出指令让它做修改
最后还会做一个总结,展示它创建了哪些文件,用户该怎样启动它生成的程序
跑一下上面生成出来的程序吧。用浏览器打开上面的index.html
文件,游戏画面如下。
从这次的试用来看,CodeBuddy code CLI是一款功能十分强大的工具。不过命令行交互肯定是没有IDE或者插件的图形化交互来的直观,同时现在官网给的文档还是太简略了些,希望官方能尽快完善。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。