Skip to content

Commit 00a1e7f

Browse files
committed
fix(output): clarify human summaries and safe input hints
1 parent 4aeb93d commit 00a1e7f

19 files changed

Lines changed: 427 additions & 95 deletions

‎README.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,8 @@ Use dedicated commands for Provider/Model management, installation, testing, and
281281

282282
The default output is concise and human-readable. Automation can use `-o json` or `-o yaml` for complete structured results. Success and error results go to stdout; diagnostics go to stderr.
283283

284+
`status` summarizes the active environment and keeps identity-mismatch and recovery warnings visible. Add `-o json` or `-o yaml` to the same command for full instance/Workspace IDs and deployment paths. A fetched capability list does not mean every operation is supported; inspect `capabilities` for individual operation states.
285+
284286
| Exit code | Meaning |
285287
|---|---|
286288
| 0 | Success |

‎README_CN.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,8 @@ Provider/Model 管理、安装、测试和其他敏感操作必须使用专用
281281

282282
默认输出便于人工阅读的简洁视图;自动化可使用 `-o json` 或 `-o yaml` 获取完整结构化结果。成功和错误结果写入 stdout,诊断信息写入 stderr。
283283

284+
`status` 默认显示当前环境摘要,仍保留身份不匹配与升级恢复警告。在同一条命令后加 `-o json` 或 `-o yaml`,可查看完整实例/Workspace ID 和部署路径。能力清单已获取不代表全部操作受支持,具体支持状态通过 `capabilities` 查看。
285+
284286
| 退出码 | 含义 |
285287
|---|---|
286288
| 0 | 成功 |

‎README_ES.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,8 @@ Usa comandos específicos para gestión de Provider/Model, instalación, pruebas
281281

282282
La salida predeterminada es concisa y legible. Usa `-o json` o `-o yaml` para automatización con resultados estructurados completos. Resultados y errores van a stdout; el diagnóstico, a stderr.
283283

284+
`status` resume el entorno activo y conserva las advertencias de identidad y recuperación. Añade `-o json` o `-o yaml` al mismo comando para ver los ID completos de instancia/Workspace y las rutas de despliegue. Obtener la lista de capacidades no implica que todas las operaciones estén disponibles; consulta sus estados con `capabilities`.
285+
284286
| Código de salida | Significado |
285287
|---|---|
286288
| 0 | Éxito |

‎README_FR.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,8 @@ Utilisez les commandes dédiées pour la gestion Provider/Model, l'installation,
281281

282282
La sortie par défaut est concise et lisible. Pour l'automatisation, `-o json` ou `-o yaml` produit des résultats structurés complets. Résultats et erreurs vont sur stdout, diagnostics sur stderr.
283283

284+
`status` résume l'environnement actif et conserve les avertissements d'identité et de récupération. Ajoutez `-o json` ou `-o yaml` à la même commande pour obtenir les identifiants complets d'instance/Workspace et les chemins de déploiement. Une liste de capacités obtenue ne signifie pas que toutes les opérations sont prises en charge ; vérifiez leurs états avec `capabilities`.
285+
284286
| Code de sortie | Signification |
285287
|---|---|
286288
| 0 | Succès |

‎README_JP.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,8 @@ Provider/Model の管理、インストール、テストなどの機密性の
281281

282282
既定の出力は読みやすい簡潔な表示です。自動化には `-o json` または `-o yaml` で完全な構造化結果を取得できます。成功・エラー結果は stdout、診断情報は stderr に出力します。
283283

284+
`status` は現在の環境を要約し、識別情報の不一致やアップグレード復旧の警告は表示します。同じコマンドに `-o json` または `-o yaml` を追加すると、完全なインスタンス/Workspace ID と配置先パスを確認できます。能力一覧の取得は全操作への対応を意味しません。各操作の対応状況は `capabilities` で確認してください。
285+
284286
| 終了コード | 意味 |
285287
|---|---|
286288
| 0 | 成功 |

‎README_KO.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,8 @@ Provider/Model 관리, 설치, 테스트 및 민감한 작업은 전용 명령
281281

282282
기본 출력은 간결하고 읽기 쉽습니다. 자동화에는 `-o json` 또는 `-o yaml`로 전체 구조화 결과를 얻습니다. 성공 및 오류 결과는 stdout, 진단은 stderr로 출력합니다.
283283

284+
`status`는 현재 환경을 요약하고 식별 정보 불일치 및 업그레이드 복구 경고를 유지합니다. 같은 명령에 `-o json` 또는 `-o yaml`을 추가하면 전체 인스턴스/Workspace ID와 배포 경로를 확인할 수 있습니다. 기능 목록을 가져왔다는 것이 모든 작업을 지원한다는 뜻은 아닙니다. 각 작업의 지원 상태는 `capabilities`로 확인하세요.
285+
284286
| 종료 코드 | 의미 |
285287
|---|---|
286288
| 0 | 성공 |

‎README_RU.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,8 @@ lbctl api post '/api/v1/knowledge/bases/<uuid>/retrieve' --file query.yaml
281281

282282
Вывод по умолчанию краток и удобен для чтения. Автоматизация использует `-o json` или `-o yaml` для полного структурированного результата. Результаты и ошибки идут в stdout, диагностика — в stderr.
283283

284+
`status` кратко показывает активное окружение, сохраняя предупреждения о несовпадении идентификаторов и необходимости восстановления. Добавьте `-o json` или `-o yaml` к той же команде для полных идентификаторов экземпляра/Workspace и путей развёртывания. Получение списка возможностей не означает поддержку всех операций; проверяйте их состояния через `capabilities`.
285+
284286
| Код выхода | Значение |
285287
|---|---|
286288
| 0 | Успех |

‎README_TW.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,8 @@ Provider/Model 管理、安裝、測試與其他敏感操作使用專用命令
281281

282282
預設為便於閱讀的精簡輸出;自動化可用 `-o json` 或 `-o yaml` 取得完整結構化結果。成功與錯誤結果寫入 stdout,診斷資訊寫入 stderr。
283283

284+
`status` 預設顯示目前環境摘要,仍保留身分不符與升級復原警告。在同一條命令後加上 `-o json` 或 `-o yaml`,可查看完整實例/Workspace ID 與部署路徑。取得能力清單不代表所有操作均受支援,請以 `capabilities` 查看各操作的支援狀態。
285+
284286
| 結束代碼 | 意義 |
285287
|---|---|
286288
| 0 | 成功 |

‎README_VI.md‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,8 @@ Dùng lệnh chuyên biệt cho Provider/Model, cài đặt, kiểm thử và th
281281

282282
Đầu ra mặc định ngắn gọn, dễ đọc. Tự động hóa dùng `-o json` hoặc `-o yaml` để lấy kết quả có cấu trúc đầy đủ. Kết quả thành công và lỗi ghi vào stdout, chẩn đoán vào stderr.
283283

284+
`status` tóm tắt môi trường hiện tại và vẫn hiển thị cảnh báo sai danh tính hoặc cần khôi phục nâng cấp. Thêm `-o json` hoặc `-o yaml` vào cùng lệnh để xem đầy đủ ID instance/Workspace và đường dẫn triển khai. Lấy được danh sách khả năng không có nghĩa mọi thao tác đều được hỗ trợ; kiểm tra trạng thái từng thao tác bằng `capabilities`.
285+
284286
| Mã thoát | Ý nghĩa |
285287
|---|---|
286288
| 0 | Thành công |

‎internal/command/command.go‎

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ func Execute(ctx context.Context, args []string, deps Dependencies) int {
7575
selectOutput(executed, flags)
7676
var typed *result.Error
7777
if !errors.As(err, &typed) {
78-
err = result.New("input", "参数无效;请运行 lbctl --help 查看用法")
78+
err = commandInputError(executed)
7979
}
8080
return emit(deps, flags, app.Result{}, err)
8181
}
@@ -117,9 +117,7 @@ func newRoot(deps Dependencies, flags *globalFlags, service *app.Service) *cobra
117117
}
118118
root.SetOut(deps.Out)
119119
root.SetErr(deps.Err)
120-
root.SetFlagErrorFunc(func(*cobra.Command, error) error {
121-
return result.New("input", "参数无效;请运行 lbctl --help 查看用法")
122-
})
120+
root.SetFlagErrorFunc(commandFlagError)
123121
persistent := root.PersistentFlags()
124122
persistent.StringVar(&flags.config, "config", "", "配置文件路径")
125123
persistent.StringVar(&flags.context, "context", "", "使用指定 context")
@@ -172,6 +170,7 @@ func newRoot(deps Dependencies, flags *globalFlags, service *app.Service) *cobra
172170
root.AddCommand(newPluginCommand(service, deps, flags))
173171
root.AddCommand(newSkillCommand(service, deps, flags))
174172
root.AddCommand(newMCPServerCommand(service, deps, flags))
173+
configureHumanHelp(root)
175174
return root
176175
}
177176

@@ -1013,6 +1012,9 @@ func validateWaitFlags(dryRun, wait bool, pollInterval, waitTimeout time.Duratio
10131012
}
10141013

10151014
func loadRequestBody(ctx context.Context, file string, apiKeyStdin bool, stdin io.Reader) (map[string]any, error) {
1015+
if strings.TrimSpace(file) == "" {
1016+
return nil, result.New("input", "缺少必需选项 --file;使用 --file <文件> 或 --file -,通过 --help 查看用法")
1017+
}
10161018
if err := requestbody.ValidateSources(file, apiKeyStdin); err != nil {
10171019
return nil, err
10181020
}
@@ -1184,7 +1186,7 @@ func newContextCheck(service *app.Service, deps Dependencies, flags *globalFlags
11841186

11851187
func newStatusCommand(service *app.Service, deps Dependencies, flags *globalFlags) *cobra.Command {
11861188
return &cobra.Command{
1187-
Use: "status", Short: "查看 Active Environment 状态", Args: cobra.NoArgs,
1189+
Use: "status", Short: "查看当前环境状态", Args: cobra.NoArgs,
11881190
RunE: func(cmd *cobra.Command, _ []string) error {
11891191
return emitCall(deps, flags, func() (app.Result, error) {
11901192
return service.Status(cmd.Context(), app.CheckOptions{
@@ -1199,7 +1201,7 @@ func newStatusCommand(service *app.Service, deps Dependencies, flags *globalFlag
11991201

12001202
func newDoctorCommand(service *app.Service, deps Dependencies, flags *globalFlags) *cobra.Command {
12011203
return &cobra.Command{
1202-
Use: "doctor", Short: "诊断 Active Environment", Args: cobra.NoArgs,
1204+
Use: "doctor", Short: "诊断当前环境", Args: cobra.NoArgs,
12031205
RunE: func(cmd *cobra.Command, _ []string) error {
12041206
return emitCall(deps, flags, func() (app.Result, error) {
12051207
return service.Doctor(cmd.Context(), app.CheckOptions{

0 commit comments

Comments
 (0)