@aigne/doc-smith 0.7.0 → 0.7.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.aigne/doc-smith/config.yaml +70 -0
- package/.aigne/doc-smith/output/structure-plan.json +152 -0
- package/.aigne/doc-smith/preferences.yml +31 -0
- package/.aigne/doc-smith/upload-cache.yaml +288 -0
- package/.github/workflows/ci.yml +6 -1
- package/CHANGELOG.md +14 -0
- package/README.md +33 -15
- package/agents/check-detail.mjs +3 -1
- package/agents/input-generator.mjs +10 -20
- package/codecov.yml +7 -0
- package/docs/_sidebar.md +17 -0
- package/docs/advanced-how-it-works.md +104 -0
- package/docs/advanced-how-it-works.zh.md +104 -0
- package/docs/advanced-quality-assurance.md +64 -0
- package/docs/advanced-quality-assurance.zh.md +64 -0
- package/docs/advanced.md +28 -0
- package/docs/advanced.zh.md +28 -0
- package/docs/changelog.md +272 -0
- package/docs/changelog.zh.md +272 -0
- package/docs/cli-reference.md +185 -0
- package/docs/cli-reference.zh.md +185 -0
- package/docs/configuration-interactive-setup.md +82 -0
- package/docs/configuration-interactive-setup.zh.md +82 -0
- package/docs/configuration-language-support.md +64 -0
- package/docs/configuration-language-support.zh.md +64 -0
- package/docs/configuration-llm-setup.md +90 -0
- package/docs/configuration-llm-setup.zh.md +90 -0
- package/docs/configuration-preferences.md +122 -0
- package/docs/configuration-preferences.zh.md +123 -0
- package/docs/configuration.md +173 -0
- package/docs/configuration.zh.md +173 -0
- package/docs/features-generate-documentation.md +82 -0
- package/docs/features-generate-documentation.zh.md +82 -0
- package/docs/features-publish-your-docs.md +98 -0
- package/docs/features-publish-your-docs.zh.md +98 -0
- package/docs/features-translate-documentation.md +83 -0
- package/docs/features-translate-documentation.zh.md +83 -0
- package/docs/features-update-and-refine.md +86 -0
- package/docs/features-update-and-refine.zh.md +86 -0
- package/docs/features.md +56 -0
- package/docs/features.zh.md +56 -0
- package/docs/getting-started.md +74 -0
- package/docs/getting-started.zh.md +74 -0
- package/docs/overview.md +48 -0
- package/docs/overview.zh.md +48 -0
- package/media.md +19 -0
- package/package.json +1 -1
- package/prompts/content-detail-generator.md +1 -0
- package/utils/markdown-checker.mjs +1 -1
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
labels: ["Reference"]
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# LLM Setup
|
|
6
|
+
|
|
7
|
+
AIGNE DocSmith leverages Large Language Models (LLMs) to generate high-quality documentation. You can configure DocSmith to use different AI models through two primary methods: the recommended AIGNE Hub service or by providing your own custom API keys.
|
|
8
|
+
|
|
9
|
+
This guide will walk you through both options.
|
|
10
|
+
|
|
11
|
+
## Using AIGNE Hub (Recommended)
|
|
12
|
+
|
|
13
|
+
The most straightforward way to use LLMs with DocSmith is through AIGNE Hub. This approach offers significant advantages:
|
|
14
|
+
|
|
15
|
+
- **No API Key Required:** You don't need to sign up for separate AI services or manage your own API keys.
|
|
16
|
+
- **Easy Model Switching:** You can switch between different state-of-the-art models from providers like Google, Anthropic, and OpenAI with a simple command-line flag.
|
|
17
|
+
|
|
18
|
+
To specify a model, use the `--model` flag with the `generate` command. DocSmith will handle the API requests through the AIGNE Hub.
|
|
19
|
+
|
|
20
|
+
### Examples
|
|
21
|
+
|
|
22
|
+
Here are some examples of how to generate documentation using different models available via AIGNE Hub:
|
|
23
|
+
|
|
24
|
+
**Using Google's Gemini 1.5 Flash:**
|
|
25
|
+
```bash
|
|
26
|
+
aigne doc generate --model google:gemini-2.5-flash
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**Using Anthropic's Claude 3.5 Sonnet:**
|
|
30
|
+
```bash
|
|
31
|
+
aigne doc generate --model claude:claude-3-5-sonnet
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**Using OpenAI's GPT-4o:**
|
|
35
|
+
```bash
|
|
36
|
+
aigne doc generate --model openai:gpt-4o
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## Configuring Custom API Keys
|
|
40
|
+
|
|
41
|
+
If you prefer to use your own API keys for providers like OpenAI or Anthropic, you can configure them using the interactive setup wizard.
|
|
42
|
+
|
|
43
|
+
Run the `init` command to launch the wizard, which will guide you through setting up your LLM provider and credentials, among other project settings.
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# Launch the interactive configuration wizard
|
|
47
|
+
aigne doc init
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
This process ensures your keys are stored correctly for all subsequent documentation generation and update tasks.
|
|
51
|
+
|
|
52
|
+
## How It Works
|
|
53
|
+
|
|
54
|
+
The following diagram illustrates how DocSmith processes requests with different LLM configurations.
|
|
55
|
+
|
|
56
|
+
```d2
|
|
57
|
+
direction: down
|
|
58
|
+
|
|
59
|
+
User: {
|
|
60
|
+
shape: person
|
|
61
|
+
label: "Developer"
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
CLI: "`aigne doc generate`"
|
|
65
|
+
|
|
66
|
+
DocSmith: {
|
|
67
|
+
shape: package
|
|
68
|
+
"Configuration Check": {
|
|
69
|
+
"AIGNE Hub (Default)": "No API Key Needed"
|
|
70
|
+
"Custom Provider": "User API Key Found"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
LLM_Providers: {
|
|
75
|
+
label: "LLM Providers"
|
|
76
|
+
shape: cloud
|
|
77
|
+
"AIGNE Hub": "Manages access to multiple models"
|
|
78
|
+
"Direct API (e.g., OpenAI)": "Uses custom key"
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
User -> CLI: "Runs command"
|
|
82
|
+
CLI -> DocSmith: "Initiates process"
|
|
83
|
+
DocSmith."Configuration Check"."AIGNE Hub (Default)" -> LLM_Providers."AIGNE Hub" : "Routes request via Hub"
|
|
84
|
+
DocSmith."Configuration Check"."Custom Provider" -> LLM_Providers."Direct API (e.g., OpenAI)" : "Routes request with user's key"
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
With your LLM provider configured, you are ready to customize language settings for your documentation. Learn more in the [Language Support](./configuration-language-support.md) guide.
|
|
@@ -0,0 +1,90 @@
|
|
|
1
|
+
---
|
|
2
|
+
labels: ["Reference"]
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# LLM 设置
|
|
6
|
+
|
|
7
|
+
AIGNE DocSmith 利用大型语言模型 (LLMs) 生成高质量的文档。你可以通过两种主要方法配置 DocSmith 以使用不同的 AI 模型:推荐的 AIGNE Hub 服务,或提供你自己的自定义 API 密钥。
|
|
8
|
+
|
|
9
|
+
本指南将引导你了解这两种选项。
|
|
10
|
+
|
|
11
|
+
## 使用 AIGNE Hub (推荐)
|
|
12
|
+
|
|
13
|
+
通过 AIGNE Hub 是将 DocSmith 与 LLMs 结合使用的最直接方法。该方法具有以下显著优势:
|
|
14
|
+
|
|
15
|
+
- **无需 API 密钥:** 你无需注册单独的 AI 服务或管理自己的 API 密钥。
|
|
16
|
+
- **轻松切换模型:** 你可以通过一个简单的命令行标志,在 Google、Anthropic 和 OpenAI 等提供商提供的不同顶尖模型之间进行切换。
|
|
17
|
+
|
|
18
|
+
要指定模型,请在 `generate` 命令中使用 `--model` 标志。DocSmith 将通过 AIGNE Hub 处理 API 请求。
|
|
19
|
+
|
|
20
|
+
### 示例
|
|
21
|
+
|
|
22
|
+
以下示例展示了如何通过 AIGNE Hub 使用不同的模型生成文档:
|
|
23
|
+
|
|
24
|
+
**使用 Google 的 Gemini 1.5 Flash:**
|
|
25
|
+
```bash
|
|
26
|
+
aigne doc generate --model google:gemini-2.5-flash
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
**使用 Anthropic 的 Claude 3.5 Sonnet:**
|
|
30
|
+
```bash
|
|
31
|
+
aigne doc generate --model claude:claude-3-5-sonnet
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**使用 OpenAI 的 GPT-4o:**
|
|
35
|
+
```bash
|
|
36
|
+
aigne doc generate --model openai:gpt-4o
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
## 配置自定义 API 密钥
|
|
40
|
+
|
|
41
|
+
如果你希望为 OpenAI 或 Anthropic 等提供商使用自己的 API 密钥,可以通过交互式设置向导进行配置。
|
|
42
|
+
|
|
43
|
+
运行 `init` 命令启动向导,它将指导你完成 LLM 提供商、凭据以及其他项目设置。
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# 启动交互式配置向导
|
|
47
|
+
aigne doc init
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
该过程可确保你的密钥被正确存储,以便用于所有后续的文档生成和更新任务。
|
|
51
|
+
|
|
52
|
+
## 工作原理
|
|
53
|
+
|
|
54
|
+
下图说明了 DocSmith 在不同 LLM 配置下处理请求的流程。
|
|
55
|
+
|
|
56
|
+
```d2
|
|
57
|
+
direction: down
|
|
58
|
+
|
|
59
|
+
User: {
|
|
60
|
+
shape: person
|
|
61
|
+
label: "开发者"
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
CLI: "`aigne doc generate`"
|
|
65
|
+
|
|
66
|
+
DocSmith: {
|
|
67
|
+
shape: package
|
|
68
|
+
"配置检查": {
|
|
69
|
+
"AIGNE Hub (默认)": "无需 API 密钥"
|
|
70
|
+
"自定义提供商": "找到用户 API 密钥"
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
LLM_Providers: {
|
|
75
|
+
label: "LLM 提供商"
|
|
76
|
+
shape: cloud
|
|
77
|
+
"AIGNE Hub": "管理对多个模型的访问"
|
|
78
|
+
"直接 API (例如 OpenAI)": "使用自定义密钥"
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
User -> CLI: "运行命令"
|
|
82
|
+
CLI -> DocSmith: "启动流程"
|
|
83
|
+
DocSmith."配置检查"."AIGNE Hub (默认)" -> LLM_Providers."AIGNE Hub" : "通过 Hub 路由请求"
|
|
84
|
+
DocSmith."配置检查"."自定义提供商" -> LLM_Providers."直接 API (例如 OpenAI)" : "使用用户密钥路由请求"
|
|
85
|
+
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
---
|
|
89
|
+
|
|
90
|
+
配置好 LLM 提供商后,你就可以为文档自定义语言设置了。请在 [语言支持](./configuration-language-support.md) 指南中了解更多信息。
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
---
|
|
2
|
+
labels: ["Reference"]
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Managing Preferences
|
|
6
|
+
|
|
7
|
+
DocSmith is designed to learn from your feedback. When you refine documents and provide corrections, the system can convert that feedback into persistent, reusable rules called "preferences". This ensures that your stylistic choices, structural conventions, and specific instructions are remembered and applied consistently in future operations.
|
|
8
|
+
|
|
9
|
+
All preferences are stored in a human-readable YAML file located at `.aigne/doc-smith/preferences.yml` in your project root. While you can view this file, it's recommended to manage your preferences using the dedicated `aigne doc prefs` command-line interface.
|
|
10
|
+
|
|
11
|
+
## How Preferences Are Created
|
|
12
|
+
|
|
13
|
+
Preferences are automatically generated during the feedback cycle of commands like `aigne doc refine`. The process works as follows:
|
|
14
|
+
|
|
15
|
+
```d2
|
|
16
|
+
direction: right
|
|
17
|
+
|
|
18
|
+
User: {
|
|
19
|
+
shape: person
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
Refine: "`aigne doc refine` command"
|
|
23
|
+
|
|
24
|
+
FeedbackRefiner: "Feedback→Rule Converter"
|
|
25
|
+
|
|
26
|
+
PreferencesFile: "preferences.yml" {
|
|
27
|
+
shape: document
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
User -> Refine: "Provide feedback, e.g., 'Don't translate variable names'"
|
|
31
|
+
Refine -> FeedbackRefiner: "Sends feedback for analysis"
|
|
32
|
+
FeedbackRefiner -> PreferencesFile: "Saves new, reusable rule" {
|
|
33
|
+
style.animated: true
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
1. **Feedback Input**: You provide natural language feedback during a refinement session.
|
|
39
|
+
2. **Rule Generation**: An internal agent analyzes your feedback to determine if it represents a reusable policy rather than a one-time fix.
|
|
40
|
+
3. **Rule Creation**: If deemed reusable, it creates a structured rule with a specific scope (e.g., `document`, `translation`), a unique ID, and the instruction itself.
|
|
41
|
+
4. **Persistence**: The new rule is saved to the `preferences.yml` file, making it active for future tasks.
|
|
42
|
+
|
|
43
|
+
## Managing Preferences via CLI
|
|
44
|
+
|
|
45
|
+
The `aigne doc prefs` command is your primary tool for viewing and managing all saved preferences.
|
|
46
|
+
|
|
47
|
+
### List All Preferences
|
|
48
|
+
|
|
49
|
+
To see a formatted list of all your preferences, use the `--list` flag.
|
|
50
|
+
|
|
51
|
+
```bash
|
|
52
|
+
aigne doc prefs --list
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
The output provides a clear overview of each rule:
|
|
56
|
+
|
|
57
|
+
```text
|
|
58
|
+
# User Preferences
|
|
59
|
+
|
|
60
|
+
**Format explanation:**
|
|
61
|
+
- 🟢 = Active preference, ⚪ = Inactive preference
|
|
62
|
+
- [scope] = Preference scope (global, structure, document, translation)
|
|
63
|
+
- ID = Unique preference identifier
|
|
64
|
+
- Paths = Specific file paths (if applicable)
|
|
65
|
+
|
|
66
|
+
🟢 [translation] pref_1a2b3c4d
|
|
67
|
+
Keep code and identifiers unchanged during translation, must not translate them.
|
|
68
|
+
|
|
69
|
+
⚪ [structure] pref_5e6f7g8h | Paths: overview.md, tutorials.md
|
|
70
|
+
Add 'Next Steps' section at the end of overview and tutorial documents with 2-3 links within the repository.
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
- **Status (🟢 / ⚪)**: Shows whether a rule is currently active or inactive.
|
|
74
|
+
- **Scope**: Indicates where the rule applies (e.g., `translation`, `structure`).
|
|
75
|
+
- **ID**: A unique identifier used to manage the rule.
|
|
76
|
+
- **Paths**: If a rule is limited to specific files, they will be listed here.
|
|
77
|
+
|
|
78
|
+
### Toggle Preference Status
|
|
79
|
+
|
|
80
|
+
You can activate or deactivate preferences using the `--toggle` flag. This is useful for temporarily disabling a rule without deleting it permanently.
|
|
81
|
+
|
|
82
|
+
**Interactive Mode**
|
|
83
|
+
|
|
84
|
+
If you run the command without specifying an ID, an interactive prompt will appear, allowing you to select multiple rules to toggle.
|
|
85
|
+
|
|
86
|
+
```bash
|
|
87
|
+
aigne doc prefs --toggle
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
**By ID**
|
|
91
|
+
|
|
92
|
+
To toggle specific rules, provide their IDs using the `--id` option.
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
aigne doc prefs --toggle --id pref_5e6f7g8h
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
### Remove Preferences
|
|
99
|
+
|
|
100
|
+
To permanently delete one or more preferences, use the `--remove` flag.
|
|
101
|
+
|
|
102
|
+
**Interactive Mode**
|
|
103
|
+
|
|
104
|
+
Running the command without an ID will launch an interactive selection prompt.
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
aigne doc prefs --remove
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
**By ID**
|
|
111
|
+
|
|
112
|
+
To remove a specific rule, pass its ID.
|
|
113
|
+
|
|
114
|
+
```bash
|
|
115
|
+
aigne doc prefs --remove --id pref_1a2b3c4d
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
This action is irreversible, so use it with care.
|
|
119
|
+
|
|
120
|
+
---
|
|
121
|
+
|
|
122
|
+
By managing your preferences, you can fine-tune DocSmith's behavior over time, making the documentation process increasingly automated and aligned with your project's specific needs. To see how feedback is provided, you can learn more in the [Update and Refine](./features-update-and-refine.md) guide.
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
---
|
|
2
|
+
labels: ["Reference"]
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# 管理偏好
|
|
6
|
+
|
|
7
|
+
DocSmith 旨在通过您的反馈进行学习。当您优化文档并提供更正时,系统可以将这些反馈转化为称为“偏好”的持久、可重用的规则。这确保了您的风格选择、结构约定和具体指令在未来的操作中能够被记住并一致地应用。
|
|
8
|
+
|
|
9
|
+
所有偏好都存储在项目根目录下名为 `.aigne/doc-smith/preferences.yml` 的人类可读 YAML 文件中。虽然您可以查看此文件,但建议使用专用的 `aigne doc prefs` 命令行界面来管理您的偏好。
|
|
10
|
+
|
|
11
|
+
## 偏好是如何创建的
|
|
12
|
+
|
|
13
|
+
偏好在 `aigne doc refine` 等命令的反馈周期中自动生成。其过程如下:
|
|
14
|
+
|
|
15
|
+
```d2
|
|
16
|
+
direction: right
|
|
17
|
+
|
|
18
|
+
User: {
|
|
19
|
+
shape: person
|
|
20
|
+
label: "用户"
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
Refine: "`aigne doc refine` 命令"
|
|
24
|
+
|
|
25
|
+
FeedbackRefiner: "反馈→规则转换器"
|
|
26
|
+
|
|
27
|
+
PreferencesFile: "preferences.yml" {
|
|
28
|
+
shape: document
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
User -> Refine: "提供反馈,例如‘不要翻译变量名’"
|
|
32
|
+
Refine -> FeedbackRefiner: "发送反馈进行分析"
|
|
33
|
+
FeedbackRefiner -> PreferencesFile: "保存新的可重用规则" {
|
|
34
|
+
style.animated: true
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
```
|
|
38
|
+
|
|
39
|
+
1. **反馈输入**:您在优化会话期间提供自然语言反馈。
|
|
40
|
+
2. **规则生成**:一个内部 Agent 会分析您的反馈,以确定它代表的是可重用策略还是一次性修复。
|
|
41
|
+
3. **规则创建**:如果被认为是可重用的,它会创建一个结构化规则,包含特定的作用域(例如,`document`、`translation`)、唯一的 ID 以及指令本身。
|
|
42
|
+
4. **持久化**:新规则被保存到 `preferences.yml` 文件中,使其在未来的任务中生效。
|
|
43
|
+
|
|
44
|
+
## 通过 CLI 管理偏好
|
|
45
|
+
|
|
46
|
+
`aigne doc prefs` 命令是您查看和管理所有已保存偏好的主要工具。
|
|
47
|
+
|
|
48
|
+
### 列出所有偏好
|
|
49
|
+
|
|
50
|
+
要查看所有偏好的格式化列表,请使用 `--list` 标志。
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
aigne doc prefs --list
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
输出清晰地展示了每个规则的概览:
|
|
57
|
+
|
|
58
|
+
```text
|
|
59
|
+
# 用户偏好
|
|
60
|
+
|
|
61
|
+
**格式说明:**
|
|
62
|
+
- 🟢 = 活动偏好, ⚪ = 非活动偏好
|
|
63
|
+
- [scope] = 偏好作用域 (global, structure, document, translation)
|
|
64
|
+
- ID = 唯一偏好标识符
|
|
65
|
+
- Paths = 特定文件路径 (如果适用)
|
|
66
|
+
|
|
67
|
+
🟢 [translation] pref_1a2b3c4d
|
|
68
|
+
在翻译期间保持代码和标识符不变,不得翻译它们。
|
|
69
|
+
|
|
70
|
+
⚪ [structure] pref_5e6f7g8h | 路径:overview.md, tutorials.md
|
|
71
|
+
在概述和教程文档末尾添加“后续步骤”部分,并附上 2-3 个仓库内的链接。
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
- **状态 (🟢 / ⚪)**:显示规则当前是活动还是非活动状态。
|
|
75
|
+
- **作用域**:指明规则的应用范围(例如,`translation`、`structure`)。
|
|
76
|
+
- **ID**:用于管理规则的唯一标识符。
|
|
77
|
+
- **路径**:如果规则仅限于特定文件,这些文件将在此处列出。
|
|
78
|
+
|
|
79
|
+
### 切换偏好状态
|
|
80
|
+
|
|
81
|
+
您可以使用 `--toggle` 标志来激活或停用偏好。这在临时禁用某个规则而不想永久删除它时非常有用。
|
|
82
|
+
|
|
83
|
+
**交互模式**
|
|
84
|
+
|
|
85
|
+
如果您在运行命令时未指定 ID,将会出现一个交互式提示,允许您选择多个规则进行切换。
|
|
86
|
+
|
|
87
|
+
```bash
|
|
88
|
+
aigne doc prefs --toggle
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
**按 ID 操作**
|
|
92
|
+
|
|
93
|
+
要切换特定规则的状态,请使用 `--id` 选项提供其 ID。
|
|
94
|
+
|
|
95
|
+
```bash
|
|
96
|
+
aigne doc prefs --toggle --id pref_5e6f7g8h
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
### 删除偏好
|
|
100
|
+
|
|
101
|
+
要永久删除一个或多个偏好,请使用 `--remove` 标志。
|
|
102
|
+
|
|
103
|
+
**交互模式**
|
|
104
|
+
|
|
105
|
+
在不带 ID 的情况下运行该命令将启动一个交互式选择提示。
|
|
106
|
+
|
|
107
|
+
```bash
|
|
108
|
+
aigne doc prefs --remove
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**按 ID 操作**
|
|
112
|
+
|
|
113
|
+
要删除特定规则,请传递其 ID。
|
|
114
|
+
|
|
115
|
+
```bash
|
|
116
|
+
aigne doc prefs --remove --id pref_1a2b3c4d
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
此操作不可逆,请谨慎使用。
|
|
120
|
+
|
|
121
|
+
---
|
|
122
|
+
|
|
123
|
+
通过管理您的偏好,您可以随着时间的推移微调 DocSmith 的行为,使文档处理过程越来越自动化,并与您项目的特定需求保持一致。要了解如何提供反馈,您可以在 [更新与优化](./features-update-and-refine.md) 指南中了解更多信息。
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
---
|
|
2
|
+
labels: ["Reference"]
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
# Configuration Guide
|
|
6
|
+
|
|
7
|
+
AIGNE DocSmith's behavior is controlled by a single, powerful configuration file: `config.yaml`. This file, located in the `.aigne/doc-smith` directory of your project, allows you to customize every aspect of the documentation generation process—from the intended audience and style to language support and file structure.
|
|
8
|
+
|
|
9
|
+
This guide provides a detailed reference for all available settings. While you can edit this file manually at any time, we recommend using the [Interactive Setup](./configuration-interactive-setup.md) wizard for your initial configuration.
|
|
10
|
+
|
|
11
|
+
## Configuration Overview
|
|
12
|
+
|
|
13
|
+
DocSmith offers a flexible configuration system to match your project's unique needs. You can define the goals of your documentation, specify your audience, set up AI models, and manage multiple languages. Explore the key areas of configuration below.
|
|
14
|
+
|
|
15
|
+
<x-cards data-columns="2">
|
|
16
|
+
<x-card data-title="Interactive Setup" data-href="/configuration/interactive-setup" data-icon="lucide:wand-2">
|
|
17
|
+
Learn how to use the `aigne doc init` command to run a guided wizard that creates your initial configuration file effortlessly.
|
|
18
|
+
</x-card>
|
|
19
|
+
<x-card data-title="LLM Setup" data-href="/configuration/llm-setup" data-icon="lucide:brain-circuit">
|
|
20
|
+
Configure different Large Language Models, including using the integrated AIGNE Hub for key-free access to popular models.
|
|
21
|
+
</x-card>
|
|
22
|
+
<x-card data-title="Language Support" data-href="/configuration/language-support" data-icon="lucide:languages">
|
|
23
|
+
Set your primary documentation language and choose from over 12 supported languages for automatic translation.
|
|
24
|
+
</x-card>
|
|
25
|
+
<x-card data-title="Managing Preferences" data-href="/configuration/preferences" data-icon="lucide:sliders-horizontal">
|
|
26
|
+
Understand how DocSmith learns from your feedback to create persistent rules and how to manage them.
|
|
27
|
+
</x-card>
|
|
28
|
+
</x-cards>
|
|
29
|
+
|
|
30
|
+
## Parameter Reference
|
|
31
|
+
|
|
32
|
+
The `config.yaml` file contains several key sections that define how your documentation is generated. Below is a comprehensive breakdown of each parameter.
|
|
33
|
+
|
|
34
|
+
### Project Information
|
|
35
|
+
|
|
36
|
+
These settings are used for display purposes when you publish your documentation.
|
|
37
|
+
|
|
38
|
+
```yaml
|
|
39
|
+
# Project information for documentation publishing
|
|
40
|
+
projectName: AIGNE DocSmith
|
|
41
|
+
projectDesc: An AI-driven documentation generation tool.
|
|
42
|
+
projectLogo: https://docsmith.aigne.io/image-bin/uploads/def424c20bbdb3c77483894fe0e22819.png
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
- `projectName`: The name of your project.
|
|
46
|
+
- `projectDesc`: A short description of your project.
|
|
47
|
+
- `projectLogo`: A URL to your project's logo.
|
|
48
|
+
|
|
49
|
+
### Documentation Style
|
|
50
|
+
|
|
51
|
+
These parameters define the purpose, audience, and overall tone of your documentation.
|
|
52
|
+
|
|
53
|
+
#### `documentPurpose`
|
|
54
|
+
|
|
55
|
+
Defines the primary goal for your readers. You can select multiple purposes.
|
|
56
|
+
|
|
57
|
+
| Key | Name | Description |
|
|
58
|
+
|---|---|---|
|
|
59
|
+
| `getStarted` | Get started quickly | Help new users go from zero to working in <30 minutes. |
|
|
60
|
+
| `completeTasks` | Complete specific tasks | Guide users through common workflows and use cases. |
|
|
61
|
+
| `findAnswers` | Find answers fast | Provide searchable reference for all features and APIs. |
|
|
62
|
+
| `understandSystem` | Understand the system | Explain how it works, why design decisions were made. |
|
|
63
|
+
| `solveProblems` | Troubleshoot common issues | Help users troubleshoot and fix issues. |
|
|
64
|
+
| `mixedPurpose` | Serve multiple purposes | Comprehensive documentation covering multiple needs. |
|
|
65
|
+
|
|
66
|
+
**Example:**
|
|
67
|
+
```yaml
|
|
68
|
+
documentPurpose:
|
|
69
|
+
- getStarted
|
|
70
|
+
- findAnswers
|
|
71
|
+
```
|
|
72
|
+
|
|
73
|
+
#### `targetAudienceTypes`
|
|
74
|
+
|
|
75
|
+
Specifies the primary audience for the documentation.
|
|
76
|
+
|
|
77
|
+
| Key | Name | Description |
|
|
78
|
+
|---|---|---|
|
|
79
|
+
| `endUsers` | End users (non-technical) | People who use the product but don't code. |
|
|
80
|
+
| `developers` | Developers integrating your product/API | Engineers adding this to their projects. |
|
|
81
|
+
| `devops` | DevOps / SRE / Infrastructure teams | Teams deploying, monitoring, maintaining systems. |
|
|
82
|
+
| `decisionMakers` | Technical decision makers | Architects, leads evaluating or planning implementation. |
|
|
83
|
+
| `supportTeams` | Support teams | People helping others use the product. |
|
|
84
|
+
| `mixedTechnical` | Mixed technical audience | Developers, DevOps, and technical users. |
|
|
85
|
+
|
|
86
|
+
**Example:**
|
|
87
|
+
```yaml
|
|
88
|
+
targetAudienceTypes:
|
|
89
|
+
- developers
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
#### `readerKnowledgeLevel`
|
|
93
|
+
|
|
94
|
+
Describes the typical starting knowledge level of your readers.
|
|
95
|
+
|
|
96
|
+
| Key | Name | Description |
|
|
97
|
+
|---|---|---|
|
|
98
|
+
| `completeBeginners` | Is a total beginner, starting from scratch | New to this domain/technology entirely. |
|
|
99
|
+
| `domainFamiliar` | Has used similar tools before | Knows the problem space, new to this specific solution. |
|
|
100
|
+
| `experiencedUsers` | Is an expert trying to do something specific | Regular users needing reference/advanced topics. |
|
|
101
|
+
| `emergencyTroubleshooting` | Emergency/troubleshooting | Something's broken, need to fix it quickly. |
|
|
102
|
+
| `exploringEvaluating` | Is evaluating this tool against others | Trying to understand if this fits their needs. |
|
|
103
|
+
|
|
104
|
+
**Example:**
|
|
105
|
+
```yaml
|
|
106
|
+
readerKnowledgeLevel: completeBeginners
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
#### `documentationDepth`
|
|
110
|
+
|
|
111
|
+
Controls how comprehensive the documentation should be.
|
|
112
|
+
|
|
113
|
+
| Key | Name | Description |
|
|
114
|
+
|---|---|---|
|
|
115
|
+
| `essentialOnly` | Essential only | Cover the 80% use cases, keep it concise. |
|
|
116
|
+
| `balancedCoverage` | Balanced coverage | Good depth with practical examples [RECOMMENDED]. |
|
|
117
|
+
| `comprehensive` | Comprehensive | Cover all features, edge cases, and advanced scenarios. |
|
|
118
|
+
| `aiDecide` | Let AI decide | Analyze code complexity and suggest appropriate depth. |
|
|
119
|
+
|
|
120
|
+
**Example:**
|
|
121
|
+
```yaml
|
|
122
|
+
documentationDepth: balancedCoverage
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### Custom Rules & Descriptions
|
|
126
|
+
|
|
127
|
+
These fields allow for more specific instructions to the AI.
|
|
128
|
+
|
|
129
|
+
- `rules`: A multi-line string where you can define specific rules and requirements for generation, such as "Always include a 'Prerequisites' section in tutorials."
|
|
130
|
+
- `targetAudience`: A multi-line string to describe your target audience in more detail than the presets allow.
|
|
131
|
+
|
|
132
|
+
**Example:**
|
|
133
|
+
```yaml
|
|
134
|
+
rules: |
|
|
135
|
+
- All code examples must be complete and copy-paste ready.
|
|
136
|
+
- Avoid using technical jargon without explaining it first.
|
|
137
|
+
targetAudience: |
|
|
138
|
+
Our audience consists of front-end developers who are familiar with JavaScript but may be new to backend concepts. They value clear, practical examples.
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
### Language and Path Settings
|
|
142
|
+
|
|
143
|
+
These parameters configure the languages and file locations for your documentation.
|
|
144
|
+
|
|
145
|
+
- `locale`: The primary language for the documentation (e.g., `en`, `zh`).
|
|
146
|
+
- `translateLanguages`: A list of language codes to translate the documentation into.
|
|
147
|
+
- `glossary`: Path to a Markdown file containing project-specific terms to ensure consistent translations.
|
|
148
|
+
- `docsDir`: The directory where the generated documentation will be saved.
|
|
149
|
+
- `sourcesPath`: A list of source code paths or glob patterns for the AI to analyze.
|
|
150
|
+
|
|
151
|
+
**Example:**
|
|
152
|
+
```yaml
|
|
153
|
+
# Language settings
|
|
154
|
+
locale: en
|
|
155
|
+
translateLanguages:
|
|
156
|
+
- zh
|
|
157
|
+
- ja
|
|
158
|
+
|
|
159
|
+
# Glossary for consistent terminology
|
|
160
|
+
glossary: "@glossary.md"
|
|
161
|
+
|
|
162
|
+
# Directory and source path configurations
|
|
163
|
+
docsDir: .aigne/doc-smith/docs # Directory to save generated documentation
|
|
164
|
+
sourcesPath: # Source code paths to analyze
|
|
165
|
+
- ./src
|
|
166
|
+
- ./README.md
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
---
|
|
170
|
+
|
|
171
|
+
With your `config.yaml` file tailored to your project, you're ready to create your documentation. The next step is to run the generation command.
|
|
172
|
+
|
|
173
|
+
➡️ **Next:** Learn how to [Generate Documentation](./features-generate-documentation.md).
|