成人免费xxxxx在线视频软件_久久精品久久久_亚洲国产精品久久久_天天色天天色_亚洲人成一区_欧美一级欧美三级在线观看

使用 ChatGPT AI 從英文文本生成 Linux 命令

系統 Linux 人工智能
我使用的工具叫做 Shell Genie。它是一個命令行工具,可讓你以普通的英語與終端進行交互。

即使是專家級的 Linux 用戶也不記得所有的 Linux 命令和它們的選項。這對我們人類來說是不可能的。

但是機器呢?尤其是人工智能驅動的機器?

想象一下,如果你可以“命令”你的終端“顯示過去 12 小時內修改過的所有小于 100 MB 的文件”。當然,你可以使用 Linux 命令“命令”它,但是用普通的英語進行交互呢?

由于人工智能的進步,這實際上是可能的。下面是自動生成 Linux 命令以顯示當前目錄中所有小于 10 KB 的文件的示例。

Shell Genie AI assistent in Linux terminal

Shell Genie AI assistent in Linux terminal

我使用的工具叫做 Shell Genie。它是一個命令行工具,可讓你以普通的英語與終端進行交互。

它可以生成命令、運行命令(如果需要),還可以向你解釋生成的命令。

Shell Genie explain commands

Shell Genie explain commands

Shell-Genie 的特點

  • 將普通英語轉換為 Linux 命令。
  • 提供了一個需要 openAI 的 API 密鑰的 openAI gpt3 后端,和一個可以免費使用的 free-genie 后端。
  • 提示一個選項以運行你要求的命令。
  • 解釋生成的命令。

安裝 Shell Genie

Shell-genie 在任何發行版的默認倉庫中都不可用。你可以使用 pipx 安裝它。

要安裝它,你需要安裝 Python 3.10+ 和 Pip。你可以參考我們關于 如何在 Ubuntu 和其他 Linux 發行版中安裝 pip 的文章。

安裝 pip 后,使用以下命令安裝 pipx

python3 -m pip install --user pipx
python3 -m pipx ensurepath

An SVG animation showing pipx Installation steps

An SVG animation showing pipx Installation steps

現在,重啟終端并運行以下命令安裝 shell-genie:

pipx install shell-genie

這可能顯示錯誤或需要依賴項。

A dependency installation to install the shell-geie properly

A dependency installation to install the shell-geie properly

運行提示的命令來安裝所需的依賴。在我的例子中:

sudo apt install python3.10-venv

之后,再次運行 shell-genie 安裝命令,就可以安裝了。

The steps showing the installation of shell-genie

The steps showing the installation of shell-genie

安裝完成后,運行以下命令:

shell-genie init

這將要求你選擇后端,openAI 或 free-genie。如果你有 openAI API,你可以選擇它或繼續使用 free-genie。

?? free-genie 后端可能并不總是工作,因為它是由開發者托管的,他警告說可能會出現中斷。

然后它將請求允許報告反饋。用 y/n 來決定。

Run shell-genie init commad to set up the shell-genie properly

Run shell-genie init commad to set up the shell-genie properly

現在就可以使用了。

使用 Shell-genie

?? 如果你要進行實驗,請盡量不要使用帶有 sudo 或刪除文件的命令。不要將你的機器交到機器手中。

如上所述,shell-genie 提供了兩種工作模式:

  • 從普通的英語獲取命令
  • 獲取命令解釋

從普通英語中獲取 Linux 命令

你可以使用 shell-genie 的 ask 選項從普通的英語中獲取命令。例如:

shell-genie ask "Display only the folders of this directory"

這將顯示正確的命令,并提示我們是否運行該命令。

The working of shell-genie, that will print the required command from the provided plain text description. Also propt the user to execute the same or not

The working of shell-genie, that will print the required command from the provided plain text description. Also propt the user to execute the same or not

獲取帶解釋的 Linux 命令

你可以使用 shell genie 來解釋你要運行的一些命令。

shell-genie ask "display all files smaller than 10kb in here" --explain

上面的命令首先會顯示需要的命令并進行解釋,然后提示用戶是否執行。

The explain mode in shell-genie, where it will explain the command that was asked in the form of plain english and then prompts the user to execute it or not

The explain mode in shell-genie, where it will explain the command that was asked in the form of plain english and then prompts the user to execute it or not

總結

有像 Explain Shell 這樣的工具(試圖)解釋 Linux 命令。但是這個 Shell genie 通過從普通的英語生成命令將它提升到一個新的水平。

當然,不能一味依賴人工智能。如果你對 Linux 命令有一定的了解,可以使用 Shell Genie 生成適合你的命令。你不必為手冊頁或各種網站而苦惱。

它可以幫助你在終端中更快地做事,也可以減少你的知識儲備。為什么? 因為你越依賴它,你自己學的就越少。

(題圖:MJ/chatgpt commands linux cli illustration in high resolution, very detailed, 8k)

責任編輯:龐桂玉 來源: Linux中國
相關推薦

2018-03-27 13:33:48

百度

2023-02-06 10:12:04

人工智能文本生成工具

2022-11-21 17:44:03

機器學習文本生成器自然語言

2023-02-28 11:19:35

CHATGPT人工智能

2024-09-30 09:04:20

2023-08-04 17:33:27

Meta音頻AI

2023-03-15 10:37:21

OpenAIChatGPT

2022-12-14 14:09:47

AIChatGPT筆記

2018-04-08 09:02:00

CGIHTML動態網站

2023-05-29 12:13:58

模型AI

2024-05-29 10:31:52

2022-08-03 13:52:22

AI建筑師

2023-02-20 16:29:45

開發AI

2023-03-07 13:50:54

2023-06-19 07:08:22

結構化數據ChatGPT

2023-08-07 10:17:20

AI域名ChatGPT

2025-01-26 09:30:00

AI模型框架

2023-05-22 10:53:53

2021-02-01 10:11:04

工具代碼開發
點贊
收藏

51CTO技術棧公眾號

主站蜘蛛池模板: 七七婷婷婷婷精品国产 | 久久久精品在线 | 国产精品99久久久精品免费观看 | 中文字幕视频在线看 | 91精品国产综合久久久久久 | 欧美日韩精品免费 | 在线男人天堂 | 天天天天天天天干 | 亚洲免费婷婷 | 奇米av | 免费观看一区二区三区毛片 | 久久成人国产 | 狠狠操狠狠操 | 国产精品视频 | 久久新视频 | 亚洲精品一级 | 欧美激情 亚洲 | 亚洲国产精品99久久久久久久久 | 色婷婷一区 | 亚洲精品一二区 | 国产一区二区三区www | 高清亚洲 | 久久免费小视频 | 超碰精品在线观看 | 黄网站免费在线看 | 91精品久久| 欧美成人一区二免费视频软件 | 免费观看一级特黄欧美大片 | 在线成人免费视频 | 日韩欧美三区 | 久久久精品一区二区三区 | 久久久亚洲一区 | 久久国产成人精品国产成人亚洲 | 日韩精品成人av | 免费看片国产 | 免费观看黄色片视频 | 天天av网| 久久国产精品一区二区三区 | 日日综合 | 91精品国产综合久久婷婷香蕉 | 欧美视频第三页 |