AI 正在迅速转变系统管理员和开发人员与其环境交互的方式。2025 年,我们推出了命令行助手,作为红帽企业 Linux(RHEL)中的一款可选工具,它允许用户直接在终端中提问,并获得自然语言的故障排除指导。
如今,我们宣布 AI 驱动系统管理之旅的下一站,goose AI 代理已登陆 RHEL 9.8 和 RHEL 10.2 的 RHEL 扩展存储库。作为代理式 AI 基金会旗下项目,goose 是一款灵活的开源 AI 代理,可与适用于 RHEL 的新模型上下文协议(MCP)服务器(开发人员预览版)搭配使用,解锁 AI 辅助管理新用例。
标准命令行助手提供精简的只读问答体验,而 goose 引入了可扩展的 AI 代理,帮助实现上下文感知的系统故障排除。
访问红帽托管命令行助手后端的两种客户端选项
在连接红帽托管的命令行助手后端时,运行 RHEL 的管理员现在有两条客户端路径可供选择。根据具体需求,您可以选择传统、精简的问答工具,也可以选择具有高级功能的更新的可扩展工具。
1.goose 客户端(goose-redhat)
对于希望升级到更强大、更智能助手的用户,我们推出了 goose-redhat 软件包,可通过 RHEL 9.8 和 RHEL 10.2 系统上的 RHEL 扩展存储库获取。goose-redhat 软件包利用开源的 goose AI 代理,提供 MCP 支持等高级功能。 goose-redhat 软件包将 goose 配置为与红帽提供的提供的同一命令行助手后端通信。
2.命令行助手客户端(command-line-assistant)
原有的 command-line-assistant 软件包在标准 RHEL 9 和 RHEL 10 AppStream 存储库中提供。该客户端通过 c 命令调用,旨在提供低开销的只读问答体验。它允许用户提出自然语言问题、通过管道传递命令输出以提供上下文,并附加日志文件以接收快速故障排除建议和命令建议。
command-line-assistant 软件包在 RHEL 9 和 RHEL 10 系统中仍受支持并可继续使用。但请注意,我们未来不打算为该客户端添加新功能。
为您的环境选择合适的软件包
为提供部署灵活性,我们在 RHEL 扩展存储库中提供了两个不同的软件包。
1.goose-redhat 软件包:集成且优化
如果您希望获得专为红帽环境优化、开箱即用的代理体验,goose-redhat 是您的不二之选。
安装该软件包后,即可获得对红帽命令行助手后端基础架构的简化访问体验,该后端能够整合来自 RHEL 文档和红帽知识库文章的信息。此外,goose-redhat 还加强了安全防护设置,在调用工具前会提示用户手动批准。
2.goose 软件包:自带模型(BYOM)
对于希望自行提供推理基础架构的用户,可以获取独立的 goose 软件包。它可让您将 goose 连接到外部大语言模型(LLM)提供商或本地推理服务器。该软件包提供与上游 goose 类似的体验,并包含默认的上游设置。
如何开始
goose 软件包通过 RHEL 扩展存储库分发,因此您需要先在 RHEL 系统上启用该存储库(如果尚未启用)。
对于 RHEL 10:
sudo subscription-manager repos --enable=rhel-10-for-$(arch)-extensions-rpms对于 RHEL 9:
sudo subscription-manager repos --enable=rhel-9-for-$(arch)-extensions-rpms安装预配置了红帽命令行助手后端的 goose-redhat 软件包:
sudo dnf install goose-redhat安装完成后,只需打开一个新的 shell 会话,运行 goose,即可开始提问。
在以下示例中,我们询问了在 RHEL 9 主机上运行基于 RHEL 6 的容器是否受支持。 goose 使用红帽命令行助手后端回答了该问题,并提供了指向客户门户网站上源文档的链接。
$ goose
starting session | provider: rhel_cla model: RHEL-command-line-assistant
session id: 20260527_2
working directory: /home/brian
goose is running! Enter your instructions, or try asking what goose can do.
⚠️This tool uses AI technology. Do not include any personal information or other sensitive information in your input. Interactions may be used to improve Red Hat's products or services.
Context: oooooooooo 0% (0/128000 tokens)
( 0)> Is it supported to run RHEL 6 based containers on a RHEL 9 host?
Running RHEL 6 based containers on a RHEL 9 host is not supported.
Sources:
- [Red Hat Enterprise Linux Container Compatibility Matrix | Red Hat Customer Por
tal](https://access.redhat.com/support/policy/rhel-container-compatibility)
⏱️ Elapsed time: 17.16s
Always review AI-generated content prior to use.
Context: ●●oooooooo 15% (19660/128000 tokens)
( 0)> Press Enter to send, Ctrl-J for new line借助模型上下文协议(MCP)实现深度可见性
goose 解锁的最令人兴奋的功能之一,便是支持适用于 RHEL 的模型上下文协议(MCP)服务器,该服务器目前以开发人员预览版形式提供。
安装并配置适用于 RHEL 的 MCP 服务器后,goose 可直接与本地 RHEL 系统(即安装 goose 的系统)交互,也可通过 SSH 与远程 RHEL 系统交互。这使得 goose 能够提供上下文感知的建议和故障排除服务。您无需手动复制粘贴日志文件,只需让 goose 调查问题,它就会利用适用于 RHEL 的 MCP 服务器来审查相关的系统信息和日志。
有关安装和配置适用于 RHEL 的 MCP 服务器以与 goose 搭配使用的详细信息,请参阅“使用 goose-redhat 优化 RHEL 命令行助手任务”一文中的说明。
演示:对文件系统进行故障排除
为了展示 goose 与适用于 RHEL 的 MCP 服务器结合使用所带来的强大功能,我们来看一个常见的真实场景:对根文件系统几乎已满的问题进行故障排除。假设您收到警报,提示某个 RHEL 系统的根分区存储容量已达到 91%。您启动了一个 goose 会话,并输入一条简单的自然语言指令: 帮我查明根文件系统中是什么占用了这么多磁盘空间。
goose-redhat 软件包提供的默认配置会提示用户授权调用 MCP 工具,因此我们会看到一条提示,询问是否允许 goose 使用适用于 RHEL 的 MCP 服务器提供的 get_disk_usage 工具。
Context: oooooooooo 0% (0/128000 tokens)
( 0)> Help me figure out what's taking up so much disk space in the root filesyste
m on this system?
─── get_disk_usage | rhel-mcp-server ─────────────────────────────────────
🔹 Goose would like to call the above tool, do you allow?
│ ● Allow (Allow the tool call once)
│ o Always Allow
│ o Deny
│ o Cancel
└──该工具返回了文件系统利用率信息,并为 LLM 提供了根文件系统已使用 91%、占用 23.5GB 空间的上下文。 接下来,goose 会提示请求权限,以调用文件系统根目录下的 list_directories 工具。
The root filesystem `/` is at 91% utilization, with 23.5GB used. To investigate fu
rther, I need to find the largest directories within the root filesystem.
─── list_directories | rhel-mcp-server ─────────────────────────────────────
top_n: 10
order_by: size
path: /
sort: descending
🔹 Goose would like to call the above tool, do you allow?
│ ● Allow (Allow the tool call once)
│ o Always Allow
│ o Deny
│ o Cancel
└──该工具使 LLM 能够看到,/home 目录占用了 17.1 GB 空间。 接下来,goose 会提示请求权限,以调用 /home 目录下的 list_files 工具,进一步缩小排查范围,确定是什么占用了这么多空间。
The `/home` directory is consuming the most disk space on your root filesystem, with 17.1GB. The `/usr` directory is using 4.7GB, and `/var` is using 1.2GB.
Let's examine the `/home` directory further to identify the largest files within it.
─── list_files | rhel-mcp-server ─────────────────────────────────────
top_n: 10
path: /home
sort: descending
order_by: size
🔹 Goose would like to call the above tool, do you allow?
│ ● Allow (Allow the tool call once)
│ o Always Allow
│ o Deny
│ o Cancel
└──该目录下没有文件,因此 goose 会提示请求权限,以调用 /home 目录下的 list_directories 工具。
There are no files directly in `/home` that are consuming significant space. It's likely that the disk space is being used by subdirectories within `/home`. Let's list the largest directories within `/home`.
─── list_directories | rhel-mcp-server ─────────────────────────────────────
top_n: 10
sort: descending
order_by: size
path: /home
🔹 Goose would like to call the above tool, do you allow?
│ ● Allow (Allow the tool call once)
│ o Always Allow
│ o Deny
│ o Cancel
└──根据适用于 RHEL 的 MCP 服务器返回的信息,LLM 现在可以看到,/home/brian 目录占用了 17.1 GB 的空间。接下来,goose 会提示请求权限,以调用 /home/brian 目录下的 list_directories 工具。
The `/home/brian` directory is consuming 17.1GB. Let's look inside `/home/brian` to find the largest directories.
─── list_directories | rhel-mcp-server ─────────────────────────────────────
order_by: size
top_n: 10
sort: descending
path: /home/brian
🔹 Goose would like to call the above tool, do you allow?
│ ● Allow (Allow the tool call once)
│ o Always Allow
│ o Deny
│ o Cancel
└──Goose 成功锁定 /home/brian/virtual-machines 目录占用了 16.6 GB 的空间。
The `/home/brian/virtual-machines` directory is consuming 16.6GB of disk space. This is the largest contributor to the high disk usage on your root filesystem.
To free up space, you could consider the following:
* **Move or delete unused virtual machine images** within `/home/brian/virtual-machines`.
* **Investigate `/usr` (4.7GB) and `/var` (1.2GB)** for potential cleanup if clearing `/home/brian/virtual-machines` is not sufficient. Common areas in `/var` for large files include `/var/log` (logs), `/var/cache` (package manager cache), and `/var/tmp`. For `/usr`, it's usually system binaries and libraries, so direct cleanup might be limited unless there are unused packages.
* **Check `.local` (255.8MB) and `.cache` (240.7MB)** within `/home/brian`. These directories often contain user-specific application data and caches that can sometimes be cleared.
If you would like to investigate a specific directory further, please let me know.
⏱️ Elapsed time: 1m 57s
Always review AI-generated content prior to use.
Context: ●oooooooooo 8% (10842/128000 tokens)
( 0)> Press Enter to send, Ctrl-J for new line展望未来
系统管理不断演进,正迅速迈向基于 AI 的工具时代。虽然标准命令行助手仍可用于提供只读式指导,但 goose 的推出大幅拓展了借助 AI 实现 RHEL 系统管理的应用场景。 立即在您的 RHEL 系统上安装 goose,体验 AI 辅助系统管理的新一代演进功能。
关于作者
Brian Smith is a product manager at Red Hat focused on RHEL automation and management. He has been at Red Hat since 2018, previously working with public sector customers as a technical account manager (TAM).
更多此类内容
从自动 CI/CD 到自主代理式工作流:借助红帽 OpenShift 实现持续 AI
AI 时代基础架构自动化的演进:2026 年红帽全球峰会的四大关键要点
Standardizing the AI stack with PyTorch
Technically Speaking | Defining sovereign AI with open source
了解更多
- 电子书:管理云级基础架构
- 电子书:为现代企业的成功构建高效 IT 基础
- 开始试用:红帽企业 Linux