@@ -116,11 +116,20 @@ def build_connector(
116
116
117
117
@app .command ('marketplace' )
118
118
def gen_marketplace (
119
- image : Annotated [str , Option (..., help = 'Docker Image Name' )],
120
- icon : Annotated [str , Option (..., help = 'Icon Image URL' )],
119
+ image : Annotated [
120
+ str , Option (..., help = 'Docker Image Name' )
121
+ ] = 'local/connector-example' ,
122
+ icon : Annotated [
123
+ str , Option (..., help = 'Icon Image URL' )
124
+ ] = 'https://nourl.example/logo.svg' ,
121
125
path : Annotated [Path , Option (help = 'connector code path' )] = Path ('.' ),
126
+ output : Annotated [Path , Option (help = 'output marketplace json file' )] = None ,
122
127
):
123
- mpfile = path .joinpath ('marketplace.json' )
124
- with mpfile .open ('w' , encoding = 'utf-8' ) as fobj :
125
- mp = MarketplaceConnector .load_from_pyproject ('pyproject.toml' )
126
- fobj .write (mp .model_dump_json ())
128
+ mpfile = path .joinpath ('marketplace-object.json' )
129
+ mp = MarketplaceConnector .load_from_pyproject (
130
+ filename = 'pyproject.toml' , image_url = image , icon_url = icon
131
+ ).model_dump (mode = 'json' )
132
+ console .print (mp )
133
+ if output :
134
+ with mpfile .open ('w' , encoding = 'utf-8' ) as fobj :
135
+ fobj .write (mp .model_dump_json ())
0 commit comments