Orphic*nix 系统的自然语言 shell 接口

联合创作 · 2023-09-26 06:43

Orphic 使用 GPT 将复杂的任务翻译成 shell 命令以在系统上执行。

注意:Orphic 默认为安全模式,除非指定不安全模式,否则不会自动执行未经确认的命令。

安装

  • 确保你的系统有 rust 和 cargo。
  • cargo install orphic
  • Orphic 需要OPENAI_API_KEY设置环境变量。可以在这里生成一个。

用法

Orphic 旨在提供与任何其他 CLI 工具一样的使用体验。

$ orphic sort ~/Downloads into folders based on media type

$ orphic how strong is my network connection

$ orphic what version kernel am i running

$ orphic show me the name and size of all files larger than 8MB in ~/Downloads/

$ orphic <do task that would otherwise require complex commands that you don't know off the top of your head>

-u或者--unsafe将在没有用户验证的情况下执行命令。

-4或者--gpt4将尝试使用 GPT-4 而不是 GPT-3.5-Turbo。请注意,这仅在你的 OpenAI 帐户有权访问该模型时才有效。

-i--interpret将用自然语言描述任务的输出(注意这通常很慢)。

 

$ orphic -u -i how much disk space is available
You have 16GB available out of a total of 113GB on your main hard 
drive, which is mounted on the root directory. 
Other partitions and file systems are also listed with their 
respective usage percentages and mount points.

-d或者--debug将显示原始 GPT 文本以及常规输出,即使在不安全模式下也是如此。

$ orphic -u -d count the lines of rust code in this directory excluding /target/.
{"command": "find . -name target -prune -o -name '*.rs' -type f -print0 | xargs -0 wc -l"}
61 ./src/prompts.rs
     219 ./src/main.rs
     280 total
 

-r或者--repl将在 REPL 环境中启动 Orphic。

$ orphic -u -r
orphic> when did i last login
wtmp begins Sat Mar 18 14:55
orphic> quit
$

 

 

浏览 3
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报
评论
图片
表情
推荐
点赞
评论
收藏
分享

手机扫一扫分享

编辑
举报