File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -194,10 +194,32 @@ def _argparser():
194
194
_add_get_workspace_project_version_parser (subparsers )
195
195
_add_run_video_inference_api_parser (subparsers )
196
196
deployment .add_deployment_parser (subparsers )
197
+ _add_whoami_parser (subparsers )
198
+
199
+ parser .add_argument ("-v" , "--version" , help = "show version info" , action = "store_true" )
200
+ parser .set_defaults (func = show_version )
197
201
198
202
return parser
199
203
200
204
205
+ def show_version (args ):
206
+ print (roboflow .__version__ )
207
+
208
+
209
+ def show_whoami (args ):
210
+ RF_WORKSPACES = get_conditional_configuration_variable ("workspaces" , default = {})
211
+ workspaces_by_url = {w ["url" ]: w for w in RF_WORKSPACES .values ()}
212
+ default_workspace_url = get_conditional_configuration_variable ("RF_WORKSPACE" , default = None )
213
+ default_workspace = workspaces_by_url .get (default_workspace_url , None )
214
+ default_workspace ['apiKey' ] = '**********'
215
+ print (json .dumps (default_workspace , indent = 2 ))
216
+
217
+
218
+ def _add_whoami_parser (subparsers ):
219
+ download_parser = subparsers .add_parser ("whoami" , help = "show current user info" )
220
+ download_parser .set_defaults (func = show_whoami )
221
+
222
+
201
223
def _add_download_parser (subparsers ):
202
224
download_parser = subparsers .add_parser (
203
225
"download" ,
You can’t perform that action at this time.
0 commit comments