Skip to content

docs: 补充 --help 与主题适配说明 - #6

Merged
MisonL merged 2 commits into
mainfrom
docs/cli-help-and-theme
Oct 15, 2026
Merged

MisonL merged 2 commits into
mainfrom
docs/cli-help-and-theme

Conversation

@MisonL

@MisonL MisonL commented Oct 14, 2026 •

Copy link
Copy Markdown
Owner

目的

PR #4/#5 落地的两个用户可见变化没有同步到文档:

  • main.py 的 -h/--help 与 --smoke-test 参数、PYRAG_LIGHT/PYRAG_DARK 主题覆盖
  • 界面配色自动适配终端亮/暗主题

顺带修正 user-guide.md 的过时示例:切换模型的 google/openai 是 provider 名而非 llm_configurations 的 key(真实 key 形如 gpt-5-6-sol),并补上 PR #3 落地的「重载失败自动回滚」契约说明。

影响范围

纯文档:README.md、docs/user_guide/getting-started.md、docs/user_guide/user-guide.md。无代码、无配置影响。

🤖 Generated with Claude Code

Sourcery 摘要

更新面向用户的文档,以反映最新的 CLI、主题适配和模型切换行为。

文档:

  • 在 README 和用户指南中说明 CLI 帮助和冒烟测试选项、终端主题适配以及环境变量覆盖。
  • 更正模型切换示例,使其使用已配置的模型键,并说明模型重新加载失败时会自动回滚。
Original summary in English

Sourcery 摘要

更新用户文档,以反映最新的命令行选项、终端主题适配和模型切换行为。

文档:

  • 更新 README 和用户指南,补充 CLI 帮助、冒烟测试、终端亮暗主题自动适配及环境变量覆盖说明。
  • 修正模型切换示例,明确使用配置项键,并记录模型重载失败时自动回滚的行为。
Original summary in English

Summary by Sourcery

更新用户文档以反映最新的命令行选项、终端主题适配和模型切换行为。

Documentation:

  • 更新 README 和用户指南,补充 CLI 帮助、冒烟测试、终端亮暗主题自动适配及环境变量覆盖说明。
  • 修正模型切换示例,明确使用配置项键,并记录模型重载失败时自动回滚的行为。

- getting-started.md / user-guide.md / README.md 的运行章节补
  命令行参数(-h/--help、--smoke-test)与 PYRAG_LIGHT/PYRAG_DARK
  主题覆盖说明
- user-guide.md 的切换模型示例从过时的 google/openai(provider 名
  而非配置 key)改为 llm_configurations 的实际 key,并补重载失败
  自动回滚的说明(PR #3 落地的契约)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: a473b7e8-66d1-4347-a274-e2edf9609560
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@sourcery-ai

sourcery-ai Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
审阅者指南(小型 PR 默认折叠)

审阅者指南

本 PR 仅更新三份用户文档,使新增的命令行入口、非交互自检、终端亮暗主题适配及强制覆盖方式与实际行为一致,并修正模型切换示例、补充重载失败自动回滚契约;不涉及代码或配置变更。

文档所述命令行启动模式流程图

flowchart TD
    Start["uv run main.py"] --> Args{"命令行参数"}
    Args -->|"-h / --help"| Help["打印用法并退出"]
    Args -->|"--smoke-test"| Smoke["执行非交互启动自检"]
    Args -->|"无参数"| Menu["进入交互式主菜单"]
Loading

文档所述终端主题选择流程图

flowchart TD
    Start["程序启动"] --> Override{"强制主题环境变量"}
    Override -->|"PYRAG_LIGHT=1"| Light["使用亮色主题"]
    Override -->|"PYRAG_DARK=1"| Dark["使用暗色主题"]
    Override -->|"未指定"| Detect["检测 COLORFGBG"]
    Detect --> Theme["自动选择亮色或暗色主题"]
Loading

文件级变更

变更 详情 文件
补充命令行参数、启动行为与终端主题适配的用户文档说明。
  • 说明 -h/--help、--smoke-test 及无参数启动行为。
  • 记录基于 COLORFGBG 的亮暗主题自动检测和 PYRAG_LIGHT/PYRAG_DARK 强制覆盖方式。
README.md
docs/user_guide/getting-started.md
docs/user_guide/user-guide.md
更新模型切换和失败处理契约,纠正过时的配置示例。
  • 将模型示例从 provider 名改为 llm_configurations 中的配置 key。
  • 补充模型重载失败后自动回滚至原模型并提示的行为。
docs/user_guide/user-guide.md

提示与命令

与 Sourcery 互动

  • 触发新一轮审查: 在拉取请求中评论 @sourcery-ai review。
  • 继续讨论: 直接回复 Sourcery 的审查评论。
  • 根据审查评论创建 GitHub issue: 回复某条审查评论,请 Sourcery 根据该评论创建 issue。你也可以在审查评论中回复 @sourcery-ai issue 来创建 issue。
  • 生成拉取请求标题: 在拉取请求标题的任意位置输入 @sourcery-ai,即可随时生成标题。你也可以在拉取请求中评论 @sourcery-ai title,随时(重新)生成标题。
  • 生成拉取请求摘要: 在拉取请求正文中你希望生成摘要的位置输入 @sourcery-ai summary,即可随时在该位置生成 PR 摘要。你也可以在拉取请求中评论 @sourcery-ai summary,随时(重新)生成摘要。
  • 生成审阅者指南: 在拉取请求中评论 @sourcery-ai guide,即可随时(重新)生成审阅者指南。
  • 解决所有 Sourcery 评论: 在拉取请求中评论 @sourcery-ai resolve,即可解决所有 Sourcery 评论。如果你已处理完所有评论且不想再看到它们,这会很有用。
  • 忽略所有 Sourcery 审查: 在拉取请求中评论 @sourcery-ai dismiss,即可忽略所有现有的 Sourcery 审查。如果你想从头开始进行新一轮审查,这尤其有用——别忘了评论 @sourcery-ai review 以触发新一轮审查!

自定义你的使用体验

访问你的控制面板以:

  • 启用或禁用审查功能,例如 Sourcery 生成的拉取请求摘要、审阅者指南等。
  • 更改审查语言。
  • 添加、移除或编辑自定义审查说明。
  • 调整其他审查设置。

获取帮助

Original review guide in English
Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

本 PR 仅更新三份用户文档,使新增的命令行入口、非交互自检、终端亮暗主题适配及强制覆盖方式与实际行为一致,并修正模型切换示例、补充重载失败自动回滚契约;不涉及代码或配置变更。

Flow diagram for documented command-line startup modes

flowchart TD
    Start["uv run main.py"] --> Args{"命令行参数"}
    Args -->|"-h / --help"| Help["打印用法并退出"]
    Args -->|"--smoke-test"| Smoke["执行非交互启动自检"]
    Args -->|"无参数"| Menu["进入交互式主菜单"]
Loading

Flow diagram for documented terminal theme selection

flowchart TD
    Start["程序启动"] --> Override{"强制主题环境变量"}
    Override -->|"PYRAG_LIGHT=1"| Light["使用亮色主题"]
    Override -->|"PYRAG_DARK=1"| Dark["使用暗色主题"]
    Override -->|"未指定"| Detect["检测 COLORFGBG"]
    Detect --> Theme["自动选择亮色或暗色主题"]
Loading

File-Level Changes

Change Details Files
补充命令行参数、启动行为与终端主题适配的用户文档说明。
  • 说明 -h/--help、--smoke-test 及无参数启动行为。
  • 记录基于 COLORFGBG 的亮暗主题自动检测和 PYRAG_LIGHT/PYRAG_DARK 强制覆盖方式。
README.md
docs/user_guide/getting-started.md
docs/user_guide/user-guide.md
更新模型切换和失败处理契约,纠正过时的配置示例。
  • 将模型示例从 provider 名改为 llm_configurations 中的配置 key。
  • 补充模型重载失败后自动回滚至原模型并提示的行为。
docs/user_guide/user-guide.md

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

嘿——我发现了 2 个问题

给 AI 智能体的提示
请处理这次代码审查中的评论:

## 各条评论

### 评论 1
<location path="docs/user_guide/user-guide.md" line_range="64" />
<code_context>
     *   **混合搜索权重**: 当使用“混合检索”时,调整向量和关键词搜索结果的权重。
 *   **切换模型**:
-    *   **语言模型 (LLM)**: 动态切换当前对话使用的聊天模型(例如,从 `google` 切换到 `openai`)。切换后,程序会自动重载模型。
+    *   **语言模型 (LLM)**: 动态切换当前对话使用的聊天模型(在 `config.toml` 中 `llm_configurations` 里定义的配置项之间切换,例如从 `gpt-5-6-sol` 切到 `deepseek-v4-flash`)。切换后,程序会自动重载模型;重载失败时自动回滚到原模型并提示。
     *   **重排模型 (Rerank)**: 切换用于精排的 Rerank 模型。
 *   **查看当前完整配置**: 显示所有当前生效的聊天和模型参数。
</code_context>
<issue_to_address>
**模型示例名称对应的选项缺失**

如果用户按照随附的 `config.toml.example` 中的示例操作,模型菜单会列出 `llm_configurations` 中的键,但示例使用了未定义的 `gpt-5-6-sol`;随附配置中的 OpenAI 键是 `openai`,其模型名称是 `gpt-5.6-sol`。因此,文档中介绍的选项不会出现在菜单中,也无法选择。

请将示例中的 OpenAI 配置键改为 `openai`。
</issue_to_address>

### 评论 2
<location path="README.md" line_range="110" />
<code_context>
 uv run main.py
 ```

+命令行支持 `-h` / `--help`(查看用法)与 `--smoke-test`(非交互自检);界面配色自动适配终端亮色 / 暗色主题,可用 `PYRAG_LIGHT=1` / `PYRAG_DARK=1` 强制指定。
+
 3. 在主菜单中按需执行:
</code_context>
<issue_to_address>
**主题颜色仍有部分未改变**

用户可能会认为,主题覆盖或亮色终端检测会调整整个界面的配色。实际上,主题辅助函数只会更改提示和 questionary 指针的样式;包括启动横幅在内的其他界面颜色仍保持原样。因此,界面的适配范围没有文档所述的那么广。

请缩小文档描述的范围,说明主题适配仅适用于提示和 questionary 指针的样式,而非整个界面。

`docs/user_guide/getting-started.md:84` 和 `docs/user_guide/user-guide.md:9` 也有此问题。
</issue_to_address>

Sourcery 评估

等待批准。 请先处理 2 项发现。

阻断性问题:docs/user_guide/user-guide.md:64、README.md:110


Sourcery 对开源项目免费——如果您喜欢我们的审查结果,欢迎分享 ✨
Original comment in English

Hey - I've found 2 issues

Prompt for AI Agents
Please address the comments from this code review:

## Individual Comments

### Comment 1
<location path="docs/user_guide/user-guide.md" line_range="64" />
<code_context>
     *   **混合搜索权重**: 当使用“混合检索”时,调整向量和关键词搜索结果的权重。
 *   **切换模型**:
-    *   **语言模型 (LLM)**: 动态切换当前对话使用的聊天模型(例如,从 `google` 切换到 `openai`)。切换后,程序会自动重载模型。
+    *   **语言模型 (LLM)**: 动态切换当前对话使用的聊天模型(在 `config.toml` 中 `llm_configurations` 里定义的配置项之间切换,例如从 `gpt-5-6-sol` 切到 `deepseek-v4-flash`)。切换后,程序会自动重载模型;重载失败时自动回滚到原模型并提示。
     *   **重排模型 (Rerank)**: 切换用于精排的 Rerank 模型。
 *   **查看当前完整配置**: 显示所有当前生效的聊天和模型参数。
</code_context>
<issue_to_address>
**Model example names missing option**

When a user follows the example with the shipped `config.toml.example`, the model menu lists `llm_configurations` keys, but the example uses `gpt-5-6-sol`, which is not defined; the shipped OpenAI key is `openai` and its model name is `gpt-5.6-sol`. The documented option is therefore absent from the menu and cannot be selected.

Change the example’s OpenAI configuration key to `openai`.
</issue_to_address>

### Comment 2
<location path="README.md" line_range="110" />
<code_context>
 uv run main.py
 ```

+命令行支持 `-h` / `--help`(查看用法)与 `--smoke-test`(非交互自检);界面配色自动适配终端亮色 / 暗色主题,可用 `PYRAG_LIGHT=1` / `PYRAG_DARK=1` 强制指定。
+
 3. 在主菜单中按需执行:
</code_context>
<issue_to_address>
**Theme colors remain partly unchanged**

When a user expects a theme override or light-terminal detection to adapt the whole interface, the theme helpers change prompt and questionary pointer styles, but other interface colors, including the startup banner, retain their existing colors. The interface therefore does not adapt as broadly as the documentation promises.

Narrow the documentation to say that theme adaptation applies to prompt and questionary pointer styles, not the whole interface.

Also at `docs/user_guide/getting-started.md:84`, `docs/user_guide/user-guide.md:9`.
</issue_to_address>

Sourcery assessment

Approval pending. 2 findings to address first.

Blocking findings: docs/user_guide/user-guide.md:64, README.md:110


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment thread docs/user_guide/user-guide.md Outdated
Comment thread README.md Outdated
- 主题适配范围如实化:只覆盖提示符与选择菜单指针(rich 语义色的
  面板/表格本就自适应),不是「整个界面配色」
- 切换模型示例改用 config.toml.example 实际存在的 key(openai/
  google-pro);gpt-5-6-sol 是本机私有配置的 key,用户照文档操作
  会在菜单里找不到该选项

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sourcery assessment

Approved.

@MisonL
MisonL merged commit aa5d9a4 into main Oct 15, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant