xiantong 文档

偏好设置

~/.xiantong/preferences.json 的参考

~/.xiantong/preferences.json 的参考

偏好设置文件存储个人设置,用于自定义 xiantong 与您的互动方式。

位置#

~/.xiantong/preferences.json

结构#

{
"name": "Alex",
"timezone": "America/New_York",
"location": {
"city": "New York",
"region": "New York",
"country": "USA"
},
"notes": "I prefer concise responses",
"includeCoAuthoredBy": true,
"updatedAt": 1737451800000
}

字段#

name#

您的名字或希望被称呼的方式。

"name": "Alex"

xiantong 可能会在问候或个性化回答中使用这个名称。

timezone#

您的时区,使用 IANA 格式

"timezone": "America/New_York"

用于:

  • 准确的日期/时间参考(“今天”、“本周”)
  • 每日笔记访问
  • 任务到期日

常见值:

  • America/New_York
  • America/Los_Angeles
  • Europe/London
  • Europe/Berlin
  • Asia/Tokyo
  • Australia/Sydney

location#

您的位置,存储为带有 cityregioncountry 字段的嵌套对象:

"location": {
"city": "New York",
"region": "New York",
"country": "USA"
}

位置字段用于提供位置感知的回复,如天气、本地活动或与时间相关的信息。

updatedAt#

偏好设置最后更新时间戳(毫秒)。此项自动设置。

"updatedAt": 1737451800000

Language#

语言通过 设置 > 外观 > 语言 控制,而不是通过 preferences.json。所选语言同时应用于应用 UI 和 xiantong 的回复语言 —— 例如将外观语言更改为日语,会自动告诉 xiantong 用日语回复。

如果您的 preferences.json 仍然包含旧版本的 language 字段,它会被安全忽略。

notes#

关于您偏好的自由形式说明。

"notes": "I prefer bullet points over paragraphs. Technical background."

这些说明会包含在 xiantong 的上下文中,影响回答的风格。

includeCoAuthoredBy#

控制 xiantong 是否在 git 提交中附加 Co-Authored-By: xiantong 结尾。默认为 true

"includeCoAuthoredBy": false

将其设置为 false 可在所有 git 提交中抑制 xiantong 协作者尾注。更改将在下一个会话生效。

编辑偏好设置#

使用命令#

> /prefs

打开一个交互式编辑器以编辑偏好设置。

手动编辑#

直接编辑该文件:

nano ~/.xiantong/preferences.json

更改将在下一次对话中生效(启动新会话或重启应用)。

偏好设置的用途#

偏好设置包含在系统提示中,因此 xiantong 知道:

  • 如何称呼您
  • 您的当前时间和时区
  • 您的位置
  • xiantong 应使用哪个语言(来自外观 > 语言)
  • 是否在 git 提交中包含协作者尾注

此上下文使回复更贴切且更具个性化。

示例#

{
"name": "Jordan",
"timezone": "Europe/Berlin",
"location": {
"city": "Berlin",
"region": "Berlin",
"country": "Germany"
},
"notes": "Software engineer. Prefer code examples over descriptions. Use metric units."
}

使用这些偏好设置后,xiantong 将会:

  • 使用柏林时间进行日程参考
  • 使用外观设置中选定的语言进行回复
  • 倾向于展示代码
  • 使用公里、摄氏度等单位