商业产业 Hacker News Agent 2026-08-17T09:11 正文 ok 95 words

🔶 Pi 编程 Agent:Linux 上的配置文件夹位置不当

英文标题:🔶 Pi coding agent: config folder is out of place on Linux

用户反馈称,Pi 在 Linux 上将配置文件夹直接置于用户 `$HOME` 目录下,容易造成主目录杂乱。该用户建议 Pi 遵循 XDG Base Directory Spec,优先读取 `PI_CONFIG_DIR`,其次读取 `XDG_CONFIG_HOME`。若两者均未设置,则应按操作系统使用默认前缀,其中 Linux/BSD 应使用 `$HOME/.config`。最终的完整配置路径应为 `<prefix>/pi`,这将使 Pi 更符合现代 Linux 工具的配置管理惯例。
打开原文相关 6 · 机会 1
media2.5 KB media2.5 KB media2.7 KB

中文

你好!
(感谢你们在编程 Agent 方面所做的出色工作和发布的文章,非常鼓舞人心)

我在 Linux 上使用 pi,注意到其配置文件夹直接位于用户的 $HOME 目录中。
在 Linux 上,现代工具应遵循 XDG Base Directory Spec,以避免让主目录根路径变得杂乱。

该规范的简要说明基本如下:

生成配置目录前缀时,应首先检查 PI_CONFIG_DIR,然后检查 XDG_CONFIG_HOME。如果两者都未设置,则使用操作系统默认值:

  • Windows:%APPDATA%
  • macOS:$HOME
  • Linux/BSD:$HOME/.config

完整的配置目录路径则应为 <prefix>/pi。

English / 原文

Hi there!
(thank you for the great work and articles on coding agents, very inspiring)

I'm using pi on Linux, and noticed that the config folder is located directly within the user's $HOME directory.
On Linux, modern tools should follow the XDG Base Directory Spec to avoid cluttering the home root.

The TL;DR of that spec is basically:

To generate the config directory prefix, check for PI_CONFIG_DIR first, then XDG_CONFIG_HOME. If neither is set, use the OS default:

  • Windows: %APPDATA%
  • macOS: $HOME
  • Linux/BSD: $HOME/.config

The full config directory path would then be <prefix>/pi.