Commit 5e1ae06f authored by Jan Reimes's avatar Jan Reimes
Browse files

fix(cli): remove hardcoded defaults from help strings, Typer auto-renders [default: X]

parent 0b21f4bb
Loading
Loading
Loading
Loading
+36 −3
Original line number Diff line number Diff line
@@ -22,7 +22,7 @@ CacheDirOption = Annotated[

# Summarize
SummarizeDocumentArgument = Annotated[str, typer.Argument(help="Document ID to summarize")]
SummarizeWordsOption = Annotated[int, typer.Option("--words", "-w", help="Target/Maximum word count (default: 200)")]
SummarizeWordsOption = Annotated[int, typer.Option("--words", "-w", help="Target/Maximum word count")]
SummarizeForceOption = Annotated[bool, typer.Option("--force", "-f", help="Force reconversion even if cached")]

# Convert
@@ -38,7 +38,7 @@ WorkspaceNameArgument = Annotated[str, typer.Argument(help="Workspace name")]
WorkspaceNameOption = Annotated[str | None, typer.Option("--workspace", "-w", help="Workspace name")]
WorkspaceActivateOption = Annotated[
    bool,
    typer.Option("--activate/--no-activate", help="Activate workspace after creation (default: activate)"),
    typer.Option("--activate/--no-activate", help="Activate workspace after creation"),
]
WorkspaceAutoBuildOption = Annotated[
    bool,
@@ -60,6 +60,13 @@ ConvertMdOption = Annotated[
        envvar="TDC_AI_CONVERT_MD",
    ),
]
WorkspaceEmbedOption = Annotated[
    bool,
    typer.Option(
        "--embed",
        help="Insert extracted documents into LightRAG knowledge graph (implies --convert-md)",
    ),
]
WorkspaceReleaseOption = Annotated[
    str | None,
    typer.Option(
@@ -71,7 +78,7 @@ WorkspaceLimitOption = Annotated[int | None, typer.Option("--limit", help="Maxim
WorkspaceIncludeInactiveOption = Annotated[bool, typer.Option("--include-inactive", help="Include inactive members")]
WorkspaceProcessForceOption = Annotated[bool, typer.Option("--force", help="Force reprocessing of all members")]
WorkspaceProcessVlmOption = Annotated[
    bool | None,
    bool,
    typer.Option(
        "--vlm/--no-vlm",
        help="Enable VLM picture description and formula enrichment",
@@ -86,6 +93,32 @@ WorkspacePreserveArtifactsOption = Annotated[
    ),
]

# Accelerator options for Docling extraction
AcceleratorDeviceOption = Annotated[
    str,
    typer.Option(
        "--device",
        help="Compute device for document extraction: auto, cpu, cuda, mps, xpu, or cuda:N",
        envvar="TDC_AI_DEVICE",
    ),
]
AcceleratorThreadsOption = Annotated[
    int,
    typer.Option(
        "--threads",
        help="Number of threads for CPU-bound extraction operations",
        envvar="TDC_AI_NUM_THREADS",
    ),
]
AcceleratorBatchSizeOption = Annotated[
    int,
    typer.Option(
        "--batch-size",
        help="Batch size for OCR, layout, and table structure. Higher values benefit GPU",
        envvar="TDC_AI_BATCH_SIZE",
    ),
]

# Filter options for workspace add-members
StartDateOption = Annotated[
    str | None,
+6 −5
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ ReleaseOption = Annotated[
    typer.Option(
        "--release",
        help=(
            "Spec release selector. Values: 'latest' (default), 'all', or explicit version. "
            "Spec release selector. Values: 'latest', 'all', or explicit version. "
            "Version formats: 18.0.0, 18.1 (=18.1.x), 18 (=18.x.y). "
            "Prefixes supported: v18, v18.1, v18.1.2, Rel-18, rel18 (case-insensitive)."
        ),
@@ -152,7 +152,7 @@ NoProgressOption = Annotated[

# Options - AI
SummarizeDocumentArgument = Annotated[str, typer.Argument(help="Document ID to summarize")]
SummarizeWordsOption = Annotated[int, typer.Option("--words", "-w", help="Target/Maximum word count (default: 200)")]
SummarizeWordsOption = Annotated[int, typer.Option("--words", "-w", help="Target/Maximum word count")]
SummarizeForceOption = Annotated[
    bool,
    typer.Option("--force", "-f", help="Force reconversion even if cached"),
@@ -172,7 +172,7 @@ ConvertForceOption = Annotated[
QueryArgument = Annotated[str | None, typer.Argument(help="Semantic search query")]
WorkspaceNameOption = Annotated[str | None, typer.Option("--workspace", "-w", help="Workspace name")]
EmbeddingTopKOption = Annotated[int, typer.Option("--top-k", "-k", help="Number of embedding results to return")]
QueryMaxWordsOption = Annotated[int, typer.Option("--words", help="Maximum word count for LLM answer (default: 300)")]
QueryMaxWordsOption = Annotated[int, typer.Option("--words", help="Maximum word count for LLM answer")]

_ = Annotated[str | None, typer.Option("--tdoc-id", "-t", help="TDoc ID to process")]
EmbeddingBackendOption = Annotated[
@@ -202,8 +202,9 @@ WorkspaceAutoBuildOption = Annotated[
WorkspaceActivateOption = Annotated[
    bool,
    typer.Option(
        True,
        "--activate/--no-activate",
        help="Activate workspace after creation (default: activate)",
        help="Activate workspace after creation",
        envvar="TDC_AI_WORKSPACE_ACTIVATE",
    ),
]
@@ -226,5 +227,5 @@ WorkspaceProcessForceOption = Annotated[bool, typer.Option("--force", help="Forc

WorkspacePreserveArtifactsOption = Annotated[
    bool,
    typer.Option("--preserve-artifacts/--no-preserve-artifacts", help="Preserve artifacts (default: yes)"),
    typer.Option("--preserve-artifacts/--no-preserve-artifacts", help="Preserve artifacts"),
]