File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -15,6 +15,7 @@ Internal
1515* Add CI on macOS.
1616* Add limited CI on Windows.
1717* Add limited CI on Windows WSL.
18+ * Speed up startup by skipping LLM imports when ` MYCLI_LLM_OFF ` is set.
1819
1920
20211.73.1 (2026/05/29)
Original file line number Diff line number Diff line change @@ -117,6 +117,7 @@ Contributors:
117117 * yurenchen000
118118 * Linuxdazhao
119119 * Puneet Dixit
120+ * Liu Zhenlong
120121
121122
122123Created by:
Original file line number Diff line number Diff line change 1+ import os
2+
13from mycli .packages .special .dbcommands import (
24 list_databases ,
35 list_tables ,
4143 write_pipe_once ,
4244 write_tee ,
4345)
44- from mycli .packages .special .llm import (
45- FinishIteration ,
46- handle_llm ,
47- is_llm_command ,
48- sql_using_llm ,
49- )
46+
47+ if not os .environ .get ('MYCLI_LLM_OFF' ):
48+ from mycli .packages .special .llm import (
49+ FinishIteration ,
50+ handle_llm ,
51+ is_llm_command ,
52+ sql_using_llm ,
53+ )
54+ else :
55+
56+ class FinishIteration (Exception ): # type: ignore[no-redef]
57+ def __init__ (self , results = None ):
58+ self .results = results
59+
60+ def is_llm_command (command : str ) -> bool : # type: ignore[no-redef]
61+ return False
62+
63+ def handle_llm (* args , ** kwargs ): # type: ignore[no-redef, misc]
64+ raise FinishIteration (results = None )
65+
66+ def sql_using_llm (* args , ** kwargs ): # type: ignore[no-redef, misc]
67+ raise FinishIteration (results = None )
68+
69+
5070from mycli .packages .special .main import (
5171 CommandNotFound ,
5272 SpecialCommandAlias ,
You can’t perform that action at this time.
0 commit comments