xiantong 文档

配置文件

~/.xiantong/config.json 参考

~/.xiantong/config.json 的参考

主配置文件存储工作区列表、LLM 连接和应用范围的默认值。

位置#

~/.xiantong/config.json

结构#

{
"llmConnections": [
{
"slug": "anthropic-api",
"name": "Anthropic (API Key)",
"providerType": "anthropic",
"authType": "api_key",
"defaultModel": "claude-sonnet-4-6",
"createdAt": 1737451800000
}
],
"defaultLlmConnection": "anthropic-api",
"workspaces": [
{
"id": "ws-abc123",
"name": "Personal Notes",
"rootPath": "/path/to/workspace",
"createdAt": 1737451800000
}
],
"activeWorkspaceId": "ws-abc123",
"activeSessionId": "260121-swift-falcon",
"notificationsEnabled": true,
"colorTheme": "default"
}

字段#

llmConnections#

LLM 连接配置的数组。每个连接表示一个提供者设置(Anthropic、Codex/OpenAI、OpenRouter 等)。有关模式详细信息和示例,请参阅 LLM Connections

defaultLlmConnection#

用于新会话的默认 LLM 连接的 slug(除非被工作区覆盖)。如果省略,使用 llmConnections 中的第一个连接。

workspaces#

配置的工作区数组。每个工作区代表一个目录或项目上下文。

{
"id": "ws-abc123",
"name": "Personal Notes",
"rootPath": "/Users/alex/projects/notes",
"createdAt": 1737451800000,
"lastAccessedAt": 1737538200000
}
字段必填描述
id工作区的唯一标识符
name你指定的显示名称
rootPath工作区目录的文件系统路径
createdAt工作区创建时的 Unix 时间戳(毫秒)
lastAccessedAt最近访问的 Unix 时间戳(毫秒),用于排序
iconUrl工作区的自定义图标 URL
mcpUrl工作区的主 MCP 服务器 URL
mcpAuthTypeMCP 的认证类型:workspace_oauthworkspace_bearerpublic

activeWorkspaceId#

当前处于活动状态的工作区 ID;如果没有选定工作区则为 null。这决定了 xiantong 启动时使用哪个工作区上下文。

activeSessionId#

在活动工作区中当前活动会话的 ID;如果没有选定会话则为 null

notificationsEnabled#

启用或禁用任务完成事件的桌面通知。默认值:true

colorTheme#

所选预设主题的 ID(例如 draculanord)。默认值:default

要设置每个工作区的默认值,请在每个工作区配置中使用 defaults.colorTheme。参见工作区

dismissedUpdateVersion#

用户已忽略的更新版本字符串。应用程序将不会再次提示更新到该版本。

pendingUpdate#

包含准备在下次启动时自动安装的更新信息的对象:

{
"version": "0.3.0",
"installerPath": "/path/to/installer",
"sha256": "abc123..."
}

示例配置#

对于现代多提供者设置,请使用 llmConnectionsdefaultLlmConnection。示例:

{
"llmConnections": [
{
"slug": "anthropic-api",
"name": "Anthropic (API Key)",
"providerType": "anthropic",
"authType": "api_key",
"defaultModel": "claude-sonnet-4-6",
"createdAt": 1737451800000
},
{
"slug": "codex",
"name": "OpenAI (Codex)",
"providerType": "openai",
"authType": "oauth",
"defaultModel": "codex-mini-latest",
"createdAt": 1737451800000
}
],
"defaultLlmConnection": "anthropic-api",
"workspaces": [...],
"activeWorkspaceId": "ws-personal"
}

修改配置#

大多数设置可以通过应用程序更改:

设置更改方式
API 连接设置 → API 连接
模型在状态栏点击模型名称
工作区使用侧边栏中的工作区下拉菜单

如需高级更改,请在 xiantong 未运行时直接编辑文件。

在手动编辑前备份配置文件。无效的 JSON 会阻止 xiantong 启动。