qbraid-cli 0.16.0__tar.gz → 0.16.1__tar.gz

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.
Files changed (69) hide show
  1. {qbraid_cli-0.16.0/qbraid_cli.egg-info → qbraid_cli-0.16.1}/PKG-INFO +2 -2
  2. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/pyproject.toml +2 -2
  3. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/agents/app.py +53 -7
  4. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1/qbraid_cli.egg-info}/PKG-INFO +2 -2
  5. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli.egg-info/requires.txt +1 -1
  6. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/LICENSE +0 -0
  7. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/README.md +0 -0
  8. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/__init__.py +0 -0
  9. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/_build_info.py +0 -0
  10. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/_version.py +0 -0
  11. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/account/__init__.py +0 -0
  12. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/account/app.py +0 -0
  13. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/admin/__init__.py +0 -0
  14. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/admin/app.py +0 -0
  15. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/admin/headers.py +0 -0
  16. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/admin/validation.py +0 -0
  17. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/agents/__init__.py +0 -0
  18. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/agents/permission_response.py +0 -0
  19. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/ai/__init__.py +0 -0
  20. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/ai/app.py +0 -0
  21. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/ai/token.py +0 -0
  22. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/compute/__init__.py +0 -0
  23. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/compute/app.py +0 -0
  24. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/compute/instances.py +0 -0
  25. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/compute/profiles.py +0 -0
  26. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/compute/server.py +0 -0
  27. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/compute/ssh.py +0 -0
  28. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/configure/__init__.py +0 -0
  29. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/configure/actions.py +0 -0
  30. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/configure/app.py +0 -0
  31. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/devices/__init__.py +0 -0
  32. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/devices/app.py +0 -0
  33. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/devices/validation.py +0 -0
  34. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/envs/__init__.py +0 -0
  35. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/envs/activate.py +0 -0
  36. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/envs/app.py +0 -0
  37. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/envs/create.py +0 -0
  38. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/envs/data_handling.py +0 -0
  39. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/envs/groups.py +0 -0
  40. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/envs/publish.py +0 -0
  41. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/envs/registry.py +0 -0
  42. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/envs/share.py +0 -0
  43. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/exceptions.py +0 -0
  44. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/handlers.py +0 -0
  45. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/jobs/__init__.py +0 -0
  46. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/jobs/app.py +0 -0
  47. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/jobs/groups.py +0 -0
  48. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/kernels/__init__.py +0 -0
  49. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/kernels/app.py +0 -0
  50. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/lab/__init__.py +0 -0
  51. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/lab/app.py +0 -0
  52. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/main.py +0 -0
  53. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/pip/__init__.py +0 -0
  54. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/pip/app.py +0 -0
  55. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/pip/hooks.py +0 -0
  56. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/projects/__init__.py +0 -0
  57. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/projects/app.py +0 -0
  58. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/py.typed +0 -0
  59. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/skills/__init__.py +0 -0
  60. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/skills/app.py +0 -0
  61. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/troubleshoot/__init__.py +0 -0
  62. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli/troubleshoot/app.py +0 -0
  63. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli.egg-info/SOURCES.txt +0 -0
  64. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli.egg-info/dependency_links.txt +0 -0
  65. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli.egg-info/entry_points.txt +0 -0
  66. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/qbraid_cli.egg-info/top_level.txt +0 -0
  67. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/setup.cfg +0 -0
  68. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/tests/test_cli_e2e.py +0 -0
  69. {qbraid_cli-0.16.0 → qbraid_cli-0.16.1}/tests/test_version.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qbraid-cli
3
- Version: 0.16.0
3
+ Version: 0.16.1
4
4
  Summary: Command Line Interface for interacting with all parts of the qBraid platform.
5
5
  Author-email: qBraid Development Team <contact@qbraid.com>
6
6
  License-Expression: LicenseRef-Proprietary
@@ -28,7 +28,7 @@ Description-Content-Type: text/markdown
28
28
  License-File: LICENSE
29
29
  Requires-Dist: typer>=0.12.1
30
30
  Requires-Dist: rich>=10.11.0
31
- Requires-Dist: click<=8.3.3
31
+ Requires-Dist: click<=8.5.0
32
32
  Requires-Dist: questionary>=2.0.0
33
33
  Requires-Dist: qbraid-core>=0.6.5
34
34
  Provides-Extra: compute
@@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "qbraid-cli"
7
- version = "0.16.0"
7
+ version = "0.16.1"
8
8
  description = "Command Line Interface for interacting with all parts of the qBraid platform."
9
9
  readme = "README.md"
10
10
  authors = [{ name = "qBraid Development Team", email = "contact@qbraid.com" }]
@@ -30,7 +30,7 @@ classifiers = [
30
30
  dependencies = [
31
31
  "typer>=0.12.1",
32
32
  "rich>=10.11.0",
33
- "click<=8.3.3",
33
+ "click<=8.5.0",
34
34
  "questionary>=2.0.0",
35
35
  "qbraid-core>=0.6.5",
36
36
  ]
@@ -327,7 +327,12 @@ def agents_list(
327
327
  remote_flags.extend(["--limit", str(limit)])
328
328
  remote_flags.extend(["--page", str(page)])
329
329
 
330
- console.print(f"[dim]Listing agents on {compute}...[/dim]")
330
+ # Nothing but the payload on stdout when --json is set: a caller
331
+ # piping this into a parser gets the status line too, and Rich
332
+ # would read square brackets in the payload as markup and mangle
333
+ # it. Status goes to stderr, the payload through plain print.
334
+ if not json_output:
335
+ console.print(f"[dim]Listing agents on {compute}...[/dim]")
331
336
  result = subprocess.run(
332
337
  ["ssh", "-o", "ConnectTimeout=10", compute, " ".join(remote_flags)],
333
338
  capture_output=True,
@@ -336,8 +341,27 @@ def agents_list(
336
341
  timeout=30,
337
342
  )
338
343
  if result.returncode == 0:
339
- console.print(result.stdout)
344
+ if json_output:
345
+ payload = result.stdout.strip()
346
+ if not payload:
347
+ # Exit 0 with nothing on stdout means the remote did
348
+ # not produce a listing -- most likely a remote CLI
349
+ # too old to know --json. Printing the blank through
350
+ # would hand a parser a bare newline while still
351
+ # reporting success; an empty result is "[]", never "".
352
+ typer.echo(
353
+ f"No JSON returned by 'qbraid agents list' on {compute} "
354
+ "(is the remote qbraid-cli recent enough to support --json?)",
355
+ err=True,
356
+ )
357
+ raise typer.Exit(code=1)
358
+ print(payload)
359
+ else:
360
+ console.print(result.stdout)
340
361
  else:
362
+ if json_output:
363
+ typer.echo(f"Failed: {result.stderr.strip()}", err=True)
364
+ raise typer.Exit(code=1)
341
365
  console.print(f"[red]Failed: {result.stderr.strip()}[/red]")
342
366
  return
343
367
 
@@ -825,11 +849,25 @@ def agents_update(
825
849
  def agents_kill(
826
850
  target: str = typer.Argument(..., help="Agent name, ID prefix, or PID"),
827
851
  force: bool = typer.Option(False, "--force", "-f", help="Use SIGKILL instead of SIGTERM"),
852
+ compute: Optional[str] = typer.Option(None, "--compute", "-c", help="SSH alias for remote compute"),
828
853
  ):
829
- """Stop an agent by name, session ID, or PID."""
854
+ """Stop an agent by name, session ID, or PID.
855
+
856
+ With ``--compute`` the agent is stopped on that machine. Without it, an
857
+ agent running elsewhere is simply not in this host's registry and reports
858
+ as not found -- the registry is per-host.
859
+ """
830
860
  try:
831
861
  from qbraid_core.services.agents import AgentSessionRegistryManager
832
862
 
863
+ if compute:
864
+ import shlex
865
+
866
+ flags = " --force" if force else ""
867
+ _ssh_cmd(compute, f"qbraid agents kill {shlex.quote(target)}{flags}")
868
+ console.print(f"[green]Stopped '{target}' on {compute}.[/green]")
869
+ return
870
+
833
871
  registry = AgentSessionRegistryManager()
834
872
  all_sessions = registry.load_registry().sessions
835
873
 
@@ -1712,6 +1750,12 @@ def agents_send(
1712
1750
  ):
1713
1751
  """Send text to a running agent's terminal."""
1714
1752
  try:
1753
+ # Imported before anything else in this try: the `except
1754
+ # AgentLauncherError` clause below cannot be evaluated unless the name
1755
+ # is bound, so a failure in the --compute branch above would raise
1756
+ # UnboundLocalError and bury the real error instead of reporting it.
1757
+ from qbraid_core.services.agents import AgentLauncher, AgentLauncherError
1758
+
1715
1759
  if compute:
1716
1760
  import shlex
1717
1761
 
@@ -1719,8 +1763,6 @@ def agents_send(
1719
1763
  console.print(f"[green]Sent text to session {session_id} on {compute}.[/green]")
1720
1764
  return
1721
1765
 
1722
- from qbraid_core.services.agents import AgentLauncher, AgentLauncherError
1723
-
1724
1766
  launcher = AgentLauncher()
1725
1767
  launcher.send(session_id, text)
1726
1768
  console.print(f"[green]Sent text to session {session_id}.[/green]")
@@ -1748,6 +1790,12 @@ def agents_read(
1748
1790
  ):
1749
1791
  """Read recent terminal output from an agent."""
1750
1792
  try:
1793
+ # Imported before anything else in this try: the `except
1794
+ # AgentLauncherError` clause below cannot be evaluated unless the name
1795
+ # is bound, so a failure in the --compute branch above would raise
1796
+ # UnboundLocalError and bury the real error instead of reporting it.
1797
+ from qbraid_core.services.agents import AgentLauncher, AgentLauncherError
1798
+
1751
1799
  if compute:
1752
1800
  import shlex
1753
1801
 
@@ -1755,8 +1803,6 @@ def agents_read(
1755
1803
  console.print(output)
1756
1804
  return
1757
1805
 
1758
- from qbraid_core.services.agents import AgentLauncher, AgentLauncherError
1759
-
1760
1806
  launcher = AgentLauncher()
1761
1807
  output = launcher.read(session_id, lines)
1762
1808
  console.print(output)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: qbraid-cli
3
- Version: 0.16.0
3
+ Version: 0.16.1
4
4
  Summary: Command Line Interface for interacting with all parts of the qBraid platform.
5
5
  Author-email: qBraid Development Team <contact@qbraid.com>
6
6
  License-Expression: LicenseRef-Proprietary
@@ -28,7 +28,7 @@ Description-Content-Type: text/markdown
28
28
  License-File: LICENSE
29
29
  Requires-Dist: typer>=0.12.1
30
30
  Requires-Dist: rich>=10.11.0
31
- Requires-Dist: click<=8.3.3
31
+ Requires-Dist: click<=8.5.0
32
32
  Requires-Dist: questionary>=2.0.0
33
33
  Requires-Dist: qbraid-core>=0.6.5
34
34
  Provides-Extra: compute
@@ -1,6 +1,6 @@
1
1
  typer>=0.12.1
2
2
  rich>=10.11.0
3
- click<=8.3.3
3
+ click<=8.5.0
4
4
  questionary>=2.0.0
5
5
  qbraid-core>=0.6.5
6
6
 
File without changes
File without changes
File without changes