sima-cli 0.0.15__py3-none-any.whl → 0.0.16__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
sima_cli/__version__.py CHANGED
@@ -1,2 +1,2 @@
1
1
  # sima_cli/__version__.py
2
- __version__ = "0.0.15"
2
+ __version__ = "0.0.16"
sima_cli/cli.py CHANGED
@@ -5,6 +5,7 @@ from sima_cli.update.updater import perform_update
5
5
  from sima_cli.model_zoo.model import list_models, download_model, describe_model
6
6
  from sima_cli.utils.config_loader import internal_resource_exists
7
7
  from sima_cli.mla.meminfo import monitor_simaai_mem_chart
8
+ from sima_cli.__version__ import __version__
8
9
 
9
10
  # Entry point for the CLI tool using Click's command group decorator
10
11
  @click.group()
@@ -50,6 +51,14 @@ def login(ctx):
50
51
  internal = ctx.obj.get("internal", False)
51
52
  perform_login.login("internal" if internal else "external")
52
53
 
54
+ # ----------------------
55
+ # Version Command
56
+ # ----------------------
57
+ @main.command(name="version")
58
+ def version_cmd():
59
+ """Show the version of the CLI tool."""
60
+ click.echo(f"SiMa CLI version: {__version__}")
61
+
53
62
  # ----------------------
54
63
  # Download Command
55
64
  # ----------------------
@@ -88,14 +97,18 @@ def download(ctx, url, dest):
88
97
  @main.command(name="update")
89
98
  @click.argument('version_or_url')
90
99
  @click.option('--ip', help="Target device IP address for remote firmware update.")
91
-
100
+ @click.option(
101
+ '-y', '--yes',
102
+ is_flag=True,
103
+ help="Skip confirmation after firmware file is downloaded."
104
+ )
92
105
  @click.option(
93
106
  '--passwd',
94
107
  default='edgeai',
95
108
  help="Optional SSH password for remote board (default is 'edgeai')."
96
109
  )
97
110
  @click.pass_context
98
- def update(ctx, version_or_url, ip, passwd):
111
+ def update(ctx, version_or_url, ip, yes, passwd):
99
112
  """
100
113
  Run system update across different environments.
101
114
  Downloads and applies firmware updates for PCIe host or SiMa board.
@@ -104,10 +117,10 @@ def update(ctx, version_or_url, ip, passwd):
104
117
  """
105
118
  internal = ctx.obj.get("internal", False)
106
119
  if not internal:
107
- click.echo(f"external environment is not supported yet..")
120
+ click.echo("External environment is not supported yet.")
108
121
  exit(0)
109
-
110
- perform_update(version_or_url, ip, internal, passwd=passwd)
122
+
123
+ perform_update(version_or_url, ip, internal, passwd=passwd, auto_confirm=yes)
111
124
 
112
125
  # ----------------------
113
126
  # Model Zoo Subcommands
@@ -326,8 +326,7 @@ def _update_remote(extracted_paths: List[str], ip: str, board: str, passwd: str,
326
326
 
327
327
  return script_path
328
328
 
329
-
330
- def perform_update(version_or_url: str, ip: str = None, internal: bool = False, passwd: str = "edgeai"):
329
+ def perform_update(version_or_url: str, ip: str = None, internal: bool = False, passwd: str = "edgeai", auto_confirm: bool = False):
331
330
  r"""
332
331
  Update the system based on environment and input.
333
332
 
@@ -339,8 +338,9 @@ def perform_update(version_or_url: str, ip: str = None, internal: bool = False,
339
338
  Args:
340
339
  version_or_url (str): Version string or direct URL.
341
340
  ip (str): Optional remote target IP.
342
- board (str): Board type, must be 'davinci' or 'modalix'.
343
- passwd : non-default password in case user has changed the password of the board user `sima`
341
+ internal (bool): If True, enable internal-only behaviors (e.g., Artifactory access).
342
+ passwd (str): Password for the board user (default: "edgeai").
343
+ auto_confirm (bool): If True, auto-confirm firmware update without prompting.
344
344
  """
345
345
  try:
346
346
  board = ''
@@ -360,6 +360,13 @@ def perform_update(version_or_url: str, ip: str = None, internal: bool = False,
360
360
  version_or_url = _pick_from_available_versions(board, version_or_url, internal)
361
361
 
362
362
  extracted_paths = _download_image(version_or_url, board, internal)
363
+
364
+ if not auto_confirm:
365
+ click.confirm(
366
+ "⚠️ Firmware image is ready. Do you want to proceed with the update?",
367
+ abort=True
368
+ )
369
+
363
370
  click.echo("⚠️ DO NOT INTERRUPT THE UPDATE PROCESS...")
364
371
 
365
372
  if len(extracted_paths) > 0:
@@ -367,7 +374,7 @@ def perform_update(version_or_url: str, ip: str = None, internal: bool = False,
367
374
  # Always update the remote device first then update the host driver, otherwise the host would
368
375
  # not be able to connect to the board
369
376
  click.echo("👉 Updating PCIe host driver and downloading firmware...")
370
- script_path = _update_remote(extracted_paths, ip, board, passwd, reboot_and_wait = False)
377
+ script_path = _update_remote(extracted_paths, ip, board, passwd, reboot_and_wait=False)
371
378
  _update_host(script_path, board, ip, passwd)
372
379
  elif env_type == "board":
373
380
  _update_board(extracted_paths, board, passwd)
@@ -375,12 +382,11 @@ def perform_update(version_or_url: str, ip: str = None, internal: bool = False,
375
382
  click.echo("👉 Updating firmware from within the Palette SDK...: Not implemented yet")
376
383
  elif ip:
377
384
  click.echo(f"👉 Updating firmware on remote board at {ip}...")
378
- _update_remote(extracted_paths, ip, board, passwd, reboot_and_wait = True)
385
+ _update_remote(extracted_paths, ip, board, passwd, reboot_and_wait=True)
379
386
  else:
380
387
  click.echo("❌ Unknown environment. Use --ip to specify target device.")
381
388
  else:
382
389
  click.echo("❌ Unable to retrieve target board information")
383
390
 
384
391
  except Exception as e:
385
- click.echo(f"❌ Update failed {e}")
386
-
392
+ click.echo(f"❌ Update failed: {e}")
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: sima-cli
3
- Version: 0.0.15
3
+ Version: 0.0.16
4
4
  Summary: CLI tool for SiMa Developer Portal to download models, firmware, and apps.
5
5
  Home-page: https://developer.sima.ai/
6
6
  Author: SiMa.ai
@@ -23,6 +23,7 @@ Requires-Dist: pyyaml
23
23
  Requires-Dist: paramiko
24
24
  Requires-Dist: plotext
25
25
  Requires-Dist: rich
26
+ Requires-Dist: InquirerPy
26
27
  Dynamic: author
27
28
  Dynamic: license-file
28
29
  Dynamic: requires-python
@@ -1,7 +1,7 @@
1
1
  sima_cli/__init__.py,sha256=Nb2jSg9-CX1XvSc1c21U9qQ3atINxphuNkNfmR-9P3o,332
2
2
  sima_cli/__main__.py,sha256=ehzD6AZ7zGytC2gLSvaJatxeD0jJdaEvNJvwYeGsWOg,69
3
- sima_cli/__version__.py,sha256=rZ8VyuhqgF22Ho9wHPc5IESWFORxhypVEyKqL_-8IvU,49
4
- sima_cli/cli.py,sha256=yd4ClOInhKAFA2ffMX1lUPRvWVziMZLHToSTAr_eyAA,6894
3
+ sima_cli/__version__.py,sha256=vAhp43Edr6wuTaEENyL0LyBoxrulPSTR3yIbNNY1qQQ,49
4
+ sima_cli/cli.py,sha256=E-zFtDbArh5o3hHsgB7hxyqE-f3brZ9xyGI-aP_s3IA,7290
5
5
  sima_cli/app_zoo/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
6
6
  sima_cli/app_zoo/app.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
7
7
  sima_cli/auth/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -18,14 +18,14 @@ sima_cli/update/__init__.py,sha256=0P-z-rSaev40IhfJXytK3AFWv2_sdQU4Ry6ei2sEus0,6
18
18
  sima_cli/update/local.py,sha256=jiGrwuU2Z1HV_RT1_dYuI_Ish-f818AvCEk7sAM3l94,3032
19
19
  sima_cli/update/query.py,sha256=eOTC2ZAWbFFf_0h8D-MO1HrIsQYRc7fu5OyeFNEAv48,2168
20
20
  sima_cli/update/remote.py,sha256=ePlnvlGHrASMMjYGM9w-6hMeDMgGiJu_BlHLamU1YtI,8420
21
- sima_cli/update/updater.py,sha256=GtYOyhZj_Xk99iI-Zj4hGywAnitkah2MuMoE9NEa9V0,15228
21
+ sima_cli/update/updater.py,sha256=8NcXl_bWcjOo3ucl7WgShSLTbTga8cWpxJeUR5tnj2E,15546
22
22
  sima_cli/utils/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
23
23
  sima_cli/utils/artifactory.py,sha256=6YyVpzVm8ATy7NEwT9nkWx-wptkXrvG7Wl_zDT6jmLs,2390
24
24
  sima_cli/utils/config.py,sha256=wE-cPQqY_gOqaP8t01xsRHD9tBUGk9MgBUm2GYYxI3E,1616
25
25
  sima_cli/utils/config_loader.py,sha256=7I5we1yiCai18j9R9jvhfUzAmT3OjAqVK35XSLuUw8c,2005
26
26
  sima_cli/utils/env.py,sha256=LJy2eO8cfEYsLuC7p3BT_FAoaZc9emtq6NYhHRBpiBE,5512
27
27
  sima_cli/utils/network.py,sha256=UvqxbqbWUczGFyO-t1SybG7Q-x9kjUVRNIn_D6APzy8,1252
28
- sima_cli-0.0.15.dist-info/licenses/LICENSE,sha256=a260OFuV4SsMZ6sQCkoYbtws_4o2deFtbnT9kg7Rfd4,1082
28
+ sima_cli-0.0.16.dist-info/licenses/LICENSE,sha256=a260OFuV4SsMZ6sQCkoYbtws_4o2deFtbnT9kg7Rfd4,1082
29
29
  tests/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
30
30
  tests/test_app_zoo.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
31
31
  tests/test_auth.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
@@ -34,8 +34,8 @@ tests/test_download.py,sha256=t87DwxlHs26_ws9rpcHGwr_OrcRPd3hz6Zmm0vRee2U,4465
34
34
  tests/test_firmware.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
35
35
  tests/test_model_zoo.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
36
36
  tests/test_utils.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
37
- sima_cli-0.0.15.dist-info/METADATA,sha256=Gfm1zm3xrURxtFf9DMeq5d5vjkko8Mnk8sWVpvW4EU8,3605
38
- sima_cli-0.0.15.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
39
- sima_cli-0.0.15.dist-info/entry_points.txt,sha256=xRYrDq1nCs6R8wEdB3c1kKuimxEjWJkHuCzArQPT0Xk,47
40
- sima_cli-0.0.15.dist-info/top_level.txt,sha256=FtrbAUdHNohtEPteOblArxQNwoX9_t8qJQd59fagDlc,15
41
- sima_cli-0.0.15.dist-info/RECORD,,
37
+ sima_cli-0.0.16.dist-info/METADATA,sha256=fiQixUEICboG26ibwugfpvz3qsU3FsCV8rTueKA3s4g,3631
38
+ sima_cli-0.0.16.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
39
+ sima_cli-0.0.16.dist-info/entry_points.txt,sha256=xRYrDq1nCs6R8wEdB3c1kKuimxEjWJkHuCzArQPT0Xk,47
40
+ sima_cli-0.0.16.dist-info/top_level.txt,sha256=FtrbAUdHNohtEPteOblArxQNwoX9_t8qJQd59fagDlc,15
41
+ sima_cli-0.0.16.dist-info/RECORD,,