11import typer
22from rich .traceback import install
33
4+ from codegen import __version__
5+
46# Import config command (still a Typer app)
57from 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
717
818install (show_locals = True )
919
@@ -14,25 +24,15 @@ def version_callback(value: bool):
1424 print (__version__ )
1525 raise typer .Exit ()
1626
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- )
2327
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" )
3130
3231# Add individual commands to the main app
3332main .command ("init" , help = "Initialize or update the Codegen folder." )(init )
3433main .command ("login" , help = "Store authentication token." )(login )
3534main .command ("logout" , help = "Clear stored authentication token." )(logout )
35+ main .command ("mcp" , help = "Start the Codegen MCP server." )(mcp )
3636main .command ("profile" , help = "Display information about the currently authenticated user." )(profile )
3737main .command ("style-debug" , help = "Debug command to visualize CLI styling (spinners, etc)." )(style_debug )
3838main .command ("update" , help = "Update Codegen to the latest or specified version" )(update )
@@ -42,9 +42,7 @@ def version_callback(value: bool):
4242
4343
4444@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" )):
4846 """Codegen CLI - Transform your code with AI."""
4947 pass
5048
0 commit comments