*nix 系統的自然語言 shell 介面。
Orphic 是一個 CLI 工具,它使用 GPT 將複雜的任務轉換為要在系統上執行的 shell 指令。它擅長處理相對簡單但需要複雜且晦澀的命令才能完成的任務。
$ orphic delete all installers or tars from ~/Downloads that are more than a week old
find ~/Downloads -name '*.tar.*' -mtime +7 -delete; find ~/Downloads -name '*.dmg' -mtime +7 -delete
Execute? [Y/n] Y
注意:Orphic 預設為安全模式,除非指定非安全模式,否則不會在未經確認的情況下自動執行命令。
cargo install 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
$
有時奧菲斯會起作用。有時則不然。 GPT 不一致,而且我使用的提示還有很多不足之處。如果將任務格式化為命令而不是問題(「列出目前開啟的連接埠」而不是「目前開啟的連接埠」),結果似乎會更好。經常出現的錯誤是 GPT 將嘗試使用不同作業系統/發行版的命令或軟體包,或嘗試使用您目前未安裝的工具。如果您認為該任務需要特定於作業系統的工具,一個快速解決方法是指定您的作業系統,但我正在努力讓 Orphic 更加了解哪些命令可以使用,哪些命令不能使用。
歡迎拉請求。如果您使用 Orphic 並獲得良好/有趣的輸出,請將其發送給我。同樣,如果你得到的輸出非常糟糕,也請將其發送給我或提出問題。這個系統是非常實驗性的,我仍在嘗試找出在提示和配置方面什麼有效,什麼無效。
麻省理工學院
版權所有 (c) 威爾·薩維奇,2023