1
1
import typer
2
2
from rich .traceback import install
3
3
4
+ from codegen import __version__
5
+
4
6
# Import config command (still a Typer app)
5
7
from codegen .cli .commands .config .main import config_command
6
- from codegen import __version__
8
+
9
+ # Import the actual command functions
10
+ from codegen .cli .commands .init .main import init
11
+ from codegen .cli .commands .login .main import login
12
+ from codegen .cli .commands .logout .main import logout
13
+ from codegen .cli .commands .mcp .main import mcp
14
+ from codegen .cli .commands .profile .main import profile
15
+ from codegen .cli .commands .style_debug .main import style_debug
16
+ from codegen .cli .commands .update .main import update
7
17
8
18
install (show_locals = True )
9
19
@@ -14,25 +24,15 @@ def version_callback(value: bool):
14
24
print (__version__ )
15
25
raise typer .Exit ()
16
26
17
- # Create the main Typer app
18
- main = typer .Typer (
19
- name = "codegen" ,
20
- help = "Codegen CLI - Transform your code with AI." ,
21
- rich_markup_mode = "rich"
22
- )
23
27
24
- # Import the actual command functions
25
- from codegen .cli .commands .init .main import init
26
- from codegen .cli .commands .login .main import login
27
- from codegen .cli .commands .logout .main import logout
28
- from codegen .cli .commands .profile .main import profile
29
- from codegen .cli .commands .style_debug .main import style_debug
30
- from codegen .cli .commands .update .main import update
28
+ # Create the main Typer app
29
+ main = typer .Typer (name = "codegen" , help = "Codegen CLI - Transform your code with AI." , rich_markup_mode = "rich" )
31
30
32
31
# Add individual commands to the main app
33
32
main .command ("init" , help = "Initialize or update the Codegen folder." )(init )
34
33
main .command ("login" , help = "Store authentication token." )(login )
35
34
main .command ("logout" , help = "Clear stored authentication token." )(logout )
35
+ main .command ("mcp" , help = "Start the Codegen MCP server." )(mcp )
36
36
main .command ("profile" , help = "Display information about the currently authenticated user." )(profile )
37
37
main .command ("style-debug" , help = "Debug command to visualize CLI styling (spinners, etc)." )(style_debug )
38
38
main .command ("update" , help = "Update Codegen to the latest or specified version" )(update )
@@ -42,9 +42,7 @@ def version_callback(value: bool):
42
42
43
43
44
44
@main .callback ()
45
- def main_callback (
46
- version : bool = typer .Option (False , "--version" , callback = version_callback , is_eager = True , help = "Show version and exit" )
47
- ):
45
+ def main_callback (version : bool = typer .Option (False , "--version" , callback = version_callback , is_eager = True , help = "Show version and exit" )):
48
46
"""Codegen CLI - Transform your code with AI."""
49
47
pass
50
48
0 commit comments