99from dotenv import load_dotenv , find_dotenv
1010from rich .console import Console
1111from rich .table import Table
12+ from typing import Any
1213
13- from . import flow , lib , setting , query
14+ from . import flow , lib , setting
1415from .setup import sync_setup , drop_setup , flow_names_with_setup , apply_setup_changes
1516
1617# Create ServerSettings lazily upon first call, as environment variables may be loaded from files, etc.
@@ -126,7 +127,7 @@ def _load_user_app(app_target: str) -> types.ModuleType:
126127 default = None ,
127128 show_default = False ,
128129)
129- def cli (env_file : str | None ):
130+ def cli (env_file : str | None ) -> None :
130131 """
131132 CLI for Cocoindex.
132133 """
@@ -146,7 +147,7 @@ def cli(env_file: str | None):
146147
147148@cli .command ()
148149@click .argument ("app_target" , type = str , required = False )
149- def ls (app_target : str | None ):
150+ def ls (app_target : str | None ) -> None :
150151 """
151152 List all flows.
152153
@@ -198,7 +199,7 @@ def ls(app_target: str | None):
198199 "--color/--no-color" , default = True , help = "Enable or disable colored output."
199200)
200201@click .option ("--verbose" , is_flag = True , help = "Show verbose output with full details." )
201- def show (app_flow_specifier : str , color : bool , verbose : bool ):
202+ def show (app_flow_specifier : str , color : bool , verbose : bool ) -> None :
202203 """
203204 Show the flow spec and schema.
204205
@@ -235,7 +236,7 @@ def show(app_flow_specifier: str, color: bool, verbose: bool):
235236
236237@cli .command ()
237238@click .argument ("app_target" , type = str )
238- def setup (app_target : str ):
239+ def setup (app_target : str ) -> None :
239240 """
240241 Check and apply backend setup changes for flows, including the internal and target storage
241242 (to export).
@@ -273,7 +274,7 @@ def setup(app_target: str):
273274 "even if not defined in the current process."
274275 "If used, APP_TARGET and any listed flow names are ignored." ,
275276)
276- def drop (app_target : str | None , flow_name : tuple [str , ...], drop_all : bool ):
277+ def drop (app_target : str | None , flow_name : tuple [str , ...], drop_all : bool ) -> None :
277278 """
278279 Drop the backend setup for flows.
279280
@@ -354,7 +355,7 @@ def drop(app_target: str | None, flow_name: tuple[str, ...], drop_all: bool):
354355 default = False ,
355356 help = "Avoid printing anything to the standard output, e.g. statistics." ,
356357)
357- def update (app_flow_specifier : str , live : bool , quiet : bool ):
358+ def update (app_flow_specifier : str , live : bool , quiet : bool ) -> Any :
358359 """
359360 Update the index to reflect the latest data from data sources.
360361
@@ -389,7 +390,9 @@ def update(app_flow_specifier: str, live: bool, quiet: bool):
389390 default = True ,
390391 help = "Use already-cached intermediate data if available." ,
391392)
392- def evaluate (app_flow_specifier : str , output_dir : str | None , cache : bool = True ):
393+ def evaluate (
394+ app_flow_specifier : str , output_dir : str | None , cache : bool = True
395+ ) -> None :
393396 """
394397 Evaluate the flow and dump flow outputs to files.
395398
@@ -472,7 +475,7 @@ def server(
472475 cors_origin : str | None ,
473476 cors_cocoindex : bool ,
474477 cors_local : int | None ,
475- ):
478+ ) -> None :
476479 """
477480 Start a HTTP server providing REST APIs.
478481
0 commit comments