1010from rich .console import Console
1111from rich .panel import Panel
1212from rich .table import Table
13+ from typing import Any
1314
1415from . import flow , lib , setting
1516from .setup import sync_setup , drop_setup , flow_names_with_setup , apply_setup_changes
@@ -127,7 +128,7 @@ def _load_user_app(app_target: str) -> types.ModuleType:
127128 default = None ,
128129 show_default = False ,
129130)
130- def cli (env_file : str | None ):
131+ def cli (env_file : str | None ) -> None :
131132 """
132133 CLI for Cocoindex.
133134 """
@@ -147,7 +148,7 @@ def cli(env_file: str | None):
147148
148149@cli .command ()
149150@click .argument ("app_target" , type = str , required = False )
150- def ls (app_target : str | None ):
151+ def ls (app_target : str | None ) -> None :
151152 """
152153 List all flows.
153154
@@ -199,7 +200,7 @@ def ls(app_target: str | None):
199200 "--color/--no-color" , default = True , help = "Enable or disable colored output."
200201)
201202@click .option ("--verbose" , is_flag = True , help = "Show verbose output with full details." )
202- def show (app_flow_specifier : str , color : bool , verbose : bool ):
203+ def show (app_flow_specifier : str , color : bool , verbose : bool ) -> None :
203204 """
204205 Show the flow spec and schema.
205206
@@ -236,7 +237,7 @@ def show(app_flow_specifier: str, color: bool, verbose: bool):
236237
237238@cli .command ()
238239@click .argument ("app_target" , type = str )
239- def setup (app_target : str ):
240+ def setup (app_target : str ) -> None :
240241 """
241242 Check and apply backend setup changes for flows, including the internal and target storage
242243 (to export).
@@ -274,7 +275,7 @@ def setup(app_target: str):
274275 "even if not defined in the current process."
275276 "If used, APP_TARGET and any listed flow names are ignored." ,
276277)
277- def drop (app_target : str | None , flow_name : tuple [str , ...], drop_all : bool ):
278+ def drop (app_target : str | None , flow_name : tuple [str , ...], drop_all : bool ) -> None :
278279 """
279280 Drop the backend setup for flows.
280281
@@ -355,7 +356,7 @@ def drop(app_target: str | None, flow_name: tuple[str, ...], drop_all: bool):
355356 default = False ,
356357 help = "Avoid printing anything to the standard output, e.g. statistics." ,
357358)
358- def update (app_flow_specifier : str , live : bool , quiet : bool ):
359+ def update (app_flow_specifier : str , live : bool , quiet : bool ) -> Any :
359360 """
360361 Update the index to reflect the latest data from data sources.
361362
@@ -390,7 +391,9 @@ def update(app_flow_specifier: str, live: bool, quiet: bool):
390391 default = True ,
391392 help = "Use already-cached intermediate data if available." ,
392393)
393- def evaluate (app_flow_specifier : str , output_dir : str | None , cache : bool = True ):
394+ def evaluate (
395+ app_flow_specifier : str , output_dir : str | None , cache : bool = True
396+ ) -> None :
394397 """
395398 Evaluate the flow and dump flow outputs to files.
396399
@@ -473,7 +476,7 @@ def server(
473476 cors_origin : str | None ,
474477 cors_cocoindex : bool ,
475478 cors_local : int | None ,
476- ):
479+ ) -> None :
477480 """
478481 Start a HTTP server providing REST APIs.
479482
0 commit comments