Skip to content

建立 CLI 指令規範檔(cli-spec.yaml)作為所有指令的 single source of truth #72

@kiki830621

Description

@kiki830621

Problem

目前 macdoc 所有 CLI 指令的規範散在多處:

  • 各子命令的 --help 輸出
  • CLAUDE.md 的 Development Commands 區塊
  • CONVERSIONS.md 的轉換矩陣
  • openspec/specs/ 各 spec 文件

沒有一個統一的檔案定義「macdoc 有哪些指令、每個指令的參數、輸入輸出格式」。

特別是 PDF 相關指令有多條重疊路徑(convert --to mdpdf ocrocr),使用者不清楚該用哪個。

Type

feature

Priority

P2

Expected

一個 cli-spec.yaml(或 .md)定義所有 CLI 指令的:

  • 子命令結構(command / subcommand)
  • 參數(args、options、required/optional、default values)
  • 輸入格式與輸出格式
  • 同一 source→target 有多條路徑時的差異說明
  • 依賴條件(如需要 ollama / mlx)

此檔案作為 single source of truth,未來可用於:

  • 自動生成 --help 文字
  • 自動生成 CONVERSIONS.md
  • CLI routing 邏輯參考
  • 新增 converter 時只需加一筆 entry

Impact

降低維護成本,減少文件與實作不同步的風險,讓使用者和 AI 都能快速查到完整指令清單。

Current Status

Phase: verified
Last updated: 2026-05-25 by /idd-all-chain (multi-root verify)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions