名称: BuilderIO/ai-shell 地址: https://github.com/BuilderIO/ai-shell fork: 132 star: 3k 开发语言: TypeScript 简介: A CLI that converts natural language to shell commands.
ai-shell 是一个命令行 AI 助手,可以将自然语言转为 shell 命令,提高命令行编程效率。
在使用时,只需要使用自然语言描述命令内容,ai-shell 就可以自动写出相应的 shell 命令,如下面的 gif 演示的那样
安装
1. 安装 ai-shell
ai-shell 依赖 Node.js is ,要求在其版本在V14之上。
npm install -g @builder.io/ai-shell
ai-shell config set OPENAI_KEY=your token>
1. 语法
ai prompt>
假如我们想要列出来所有的日志文件,那么我们可以像下面这样写
ai list all log files
◇ Your script:
│
│ find . -name "*.log"
│
◇ Explanation:
│
│ 1. Searches for all files with the extension ".log" in the current directory and any subdirectories.
│
◆ Run this script?
│ ● ✅ Yes (Lets go!)
│ ○ ? Revise
│ ○ ❌ Cancel
└
ai 'what is my ip address'
ai -s list all log files
ai-shell config set SILENT_MODE=true
ai-shell 同样提供了一个 GUI 的配置界面,只需要执行下面的命令
ai config ui
就可以看到一个简易的 GUI 的配置界面了
◆ Set config:
│ ○ OpenAI Key
│ ○ Silent Mode
│ ● Model (gpt-3.5-turbo)
│ ○ Cancel
└
END
