@@ -54,13 +54,26 @@ def ls(show_all: bool):
5454@cli .command ()
5555@click .argument ("flow_name" , type = str , required = False )
5656@click .option ("--color/--no-color" , default = True )
57- def show (flow_name : str | None , color : bool ):
57+ @click .option (
58+ "--schema" , is_flag = True , show_default = True , default = False ,
59+ help = "Also show the schema of the flow." )
60+ def show (flow_name : str | None , color : bool , schema : bool ):
5861 """
5962 Show the flow spec in a readable format with colored output.
63+ Optionally display the schema if --schema is provided.
6064 """
61- fl = _flow_by_name (flow_name )
65+ from rich .table import Table
66+ flow = _flow_by_name (flow_name )
6267 console = Console (no_color = not color )
63- console .print (fl ._render_text ())
68+ console .print (flow ._render_text ())
69+ if schema :
70+ table = Table (title = f"Schema for Flow: { flow .name } " , show_header = True , header_style = "bold magenta" )
71+ table .add_column ("Field" , style = "cyan" )
72+ table .add_column ("Type" , style = "green" )
73+ table .add_column ("Attributes" , style = "yellow" )
74+ for field_name , field_type , attr_str in flow ._render_schema ():
75+ table .add_row (field_name , field_type , attr_str )
76+ console .print (table )
6477
6578@cli .command ()
6679def setup ():
0 commit comments