zen-cli 0.1.6__tar.gz → 0.1.7__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 (232) hide show
  1. {zen_cli-0.1.6 → zen_cli-0.1.7}/PKG-INFO +27 -25
  2. zen_cli-0.1.7/README.md +68 -0
  3. {zen_cli-0.1.6 → zen_cli-0.1.7}/pyproject.toml +2 -3
  4. zen_cli-0.1.7/src/zen_cli/__init__.py +14 -0
  5. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cli.py +9 -6
  6. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/activity/list.py +3 -22
  7. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/api.py +3 -2
  8. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/auth/status.py +1 -1
  9. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/completion.py +3 -0
  10. zen_cli-0.1.7/src/zen_cli/cmds/deployment/list.py +19 -0
  11. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/login.py +14 -10
  12. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/mcp.py +3 -0
  13. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/network/list.py +3 -9
  14. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/notification/list.py +3 -21
  15. zen_cli-0.1.7/src/zen_cli/cmds/org/list.py +20 -0
  16. zen_cli-0.1.7/src/zen_cli/cmds/pool/list.py +36 -0
  17. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/task/delete.py +5 -3
  18. zen_cli-0.1.7/src/zen_cli/cmds/task/duplicate.py +29 -0
  19. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/task/list.py +1 -1
  20. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/task/log.py +1 -1
  21. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/upgrade.py +4 -1
  22. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/vm/delete.py +1 -1
  23. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/vm/get.py +2 -5
  24. zen_cli-0.1.7/src/zen_cli/cmds/vm/list.py +91 -0
  25. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/vm/wait.py +10 -1
  26. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/ctxp/built_in_cmds/_ut.py +10 -5
  27. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/ctxp/built_in_cmds/profile.py +4 -1
  28. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/ctxp/cli_options.py +2 -1
  29. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/ctxp/logger.py +23 -10
  30. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/ctxp/profile.py +44 -14
  31. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/ctxp/recent.py +77 -20
  32. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/ctxp/telemetry.py +5 -1
  33. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/ctxp/util.py +9 -5
  34. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/service/task.py +0 -12
  35. zen_cli-0.1.7/src/zen_cli/sglib/__init__.py +21 -0
  36. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/sglib/auth.py +51 -4
  37. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/sglib/cli_options.py +1 -5
  38. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/sglib/csp.py +4 -1
  39. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/sglib/ez_client.py +7 -4
  40. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/sglib/login_support.py +7 -7
  41. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/sglib/requtil.py +4 -2
  42. zen_cli-0.1.7/src/zen_cli/support/activity.py +23 -0
  43. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/support/auth.py +6 -1
  44. zen_cli-0.1.7/src/zen_cli/support/deployment.py +12 -0
  45. zen_cli-0.1.7/src/zen_cli/support/network.py +10 -0
  46. zen_cli-0.1.7/src/zen_cli/support/notification.py +22 -0
  47. zen_cli-0.1.7/src/zen_cli/support/org.py +17 -0
  48. zen_cli-0.1.6/src/zen_cli/cmds/pool/list.py → zen_cli-0.1.7/src/zen_cli/support/pool.py +2 -34
  49. zen_cli-0.1.7/src/zen_cli/support/recent.py +15 -0
  50. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/support/task.py +360 -312
  51. zen_cli-0.1.6/src/zen_cli/cmds/vm/list.py → zen_cli-0.1.7/src/zen_cli/support/vm.py +61 -120
  52. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/util/exec_util.py +11 -17
  53. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/util/versions.py +5 -1
  54. zen_cli-0.1.6/src/zen_cli/support/test_utils.py → zen_cli-0.1.7/tests/blackbox/cli_test.py +2 -2
  55. {zen_cli-0.1.6 → zen_cli-0.1.7}/tests/blackbox/test_api.py +9 -9
  56. {zen_cli-0.1.6 → zen_cli-0.1.7}/tests/blackbox/test_auth.py +19 -20
  57. {zen_cli-0.1.6 → zen_cli-0.1.7}/tests/blackbox/test_completion.py +7 -8
  58. {zen_cli-0.1.6 → zen_cli-0.1.7}/tests/blackbox/test_context.py +16 -17
  59. {zen_cli-0.1.6 → zen_cli-0.1.7}/tests/blackbox/test_credential.py +10 -11
  60. {zen_cli-0.1.6 → zen_cli-0.1.7}/tests/blackbox/test_deployment.py +10 -11
  61. {zen_cli-0.1.6 → zen_cli-0.1.7}/tests/blackbox/test_entitlement.py +10 -11
  62. {zen_cli-0.1.6 → zen_cli-0.1.7}/tests/blackbox/test_errors.py +90 -88
  63. {zen_cli-0.1.6 → zen_cli-0.1.7}/tests/blackbox/test_group.py +10 -11
  64. zen_cli-0.1.7/tests/blackbox/test_io.py +143 -0
  65. {zen_cli-0.1.6 → zen_cli-0.1.7}/tests/blackbox/test_login.py +26 -27
  66. {zen_cli-0.1.6 → zen_cli-0.1.7}/tests/blackbox/test_logout.py +6 -6
  67. {zen_cli-0.1.6 → zen_cli-0.1.7}/tests/blackbox/test_mcp.py +7 -8
  68. {zen_cli-0.1.6 → zen_cli-0.1.7}/tests/blackbox/test_network.py +10 -11
  69. {zen_cli-0.1.6 → zen_cli-0.1.7}/tests/blackbox/test_org.py +22 -23
  70. {zen_cli-0.1.6 → zen_cli-0.1.7}/tests/blackbox/test_pool.py +32 -33
  71. {zen_cli-0.1.6 → zen_cli-0.1.7}/tests/blackbox/test_profile.py +54 -55
  72. {zen_cli-0.1.6 → zen_cli-0.1.7}/tests/blackbox/test_provider.py +10 -11
  73. {zen_cli-0.1.6 → zen_cli-0.1.7}/tests/blackbox/test_root.py +13 -14
  74. {zen_cli-0.1.6 → zen_cli-0.1.7}/tests/blackbox/test_sag.py +10 -11
  75. {zen_cli-0.1.6 → zen_cli-0.1.7}/tests/blackbox/test_task.py +7 -8
  76. {zen_cli-0.1.6 → zen_cli-0.1.7}/tests/blackbox/test_vm.py +7 -8
  77. zen_cli-0.1.7/tests/test_auth_status.py +88 -0
  78. {zen_cli-0.1.6 → zen_cli-0.1.7}/tests/test_cli.py +14 -10
  79. zen_cli-0.1.7/tests/test_recent.py +124 -0
  80. zen_cli-0.1.6/README.md +0 -66
  81. zen_cli-0.1.6/src/zen_cli/__init__.py +0 -5
  82. zen_cli-0.1.6/src/zen_cli/cmds/deployment/list.py +0 -27
  83. zen_cli-0.1.6/src/zen_cli/cmds/org/list.py +0 -33
  84. zen_cli-0.1.6/src/zen_cli/cmds/task/duplicate.py +0 -75
  85. zen_cli-0.1.6/src/zen_cli/sglib/__init__.py +0 -3
  86. zen_cli-0.1.6/src/zen_cli/sglib/payload_util.py +0 -29
  87. zen_cli-0.1.6/src/zen_cli/support/vm.py +0 -8
  88. zen_cli-0.1.6/src/zen_cli/util/param_util.py +0 -39
  89. zen_cli-0.1.6/src/zen_cli/util/patch_util.py +0 -38
  90. zen_cli-0.1.6/tests/blackbox/test_io.py +0 -88
  91. zen_cli-0.1.6/tests/test_auth_status.py +0 -26
  92. {zen_cli-0.1.6 → zen_cli-0.1.7}/.gitignore +0 -0
  93. {zen_cli-0.1.6 → zen_cli-0.1.7}/LICENSE +0 -0
  94. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/__main__.py +0 -0
  95. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/activity/__init__.py +0 -0
  96. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/activity/get.py +0 -0
  97. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/auth/__init__.py +0 -0
  98. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/auth/details.py +0 -0
  99. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/auth/refresh.py +0 -0
  100. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/auth/token.py +0 -0
  101. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/credential/__init__.py +0 -0
  102. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/credential/create.py +0 -0
  103. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/credential/delete.py +0 -0
  104. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/credential/get.py +0 -0
  105. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/credential/list.py +0 -0
  106. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/deployment/__init__.py +0 -0
  107. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/deployment/create.py +0 -0
  108. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/deployment/delete.py +0 -0
  109. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/deployment/get.py +0 -0
  110. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/entitlement/__init__.py +0 -0
  111. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/entitlement/create.py +0 -0
  112. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/entitlement/delete.py +0 -0
  113. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/entitlement/get.py +0 -0
  114. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/entitlement/list.py +0 -0
  115. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/group/__init__.py +0 -0
  116. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/group/create.py +0 -0
  117. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/group/delete.py +0 -0
  118. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/group/get.py +0 -0
  119. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/group/list.py +0 -0
  120. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/logout.py +0 -0
  121. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/network/__init__.py +0 -0
  122. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/network/create.py +0 -0
  123. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/network/delete.py +0 -0
  124. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/network/get.py +0 -0
  125. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/notification/__init__.py +0 -0
  126. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/notification/get.py +0 -0
  127. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/org/__init__.py +0 -0
  128. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/org/create.py +0 -0
  129. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/org/get.py +0 -0
  130. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/org/use.py +0 -0
  131. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/pool/__init__.py +0 -0
  132. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/pool/create.py +0 -0
  133. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/pool/delete.py +0 -0
  134. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/pool/get.py +0 -0
  135. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/pool/use.py +0 -0
  136. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/profile/__init__.py +0 -0
  137. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/profile/init.py +0 -0
  138. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/provider/__init__.py +0 -0
  139. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/provider/create.py +0 -0
  140. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/provider/delete.py +0 -0
  141. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/provider/get.py +0 -0
  142. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/provider/list.py +0 -0
  143. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/sag/__init__.py +0 -0
  144. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/sag/create.py +0 -0
  145. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/sag/delete.py +0 -0
  146. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/sag/get.py +0 -0
  147. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/sag/list.py +0 -0
  148. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/task/__init__.py +0 -0
  149. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/task/cancel.py +0 -0
  150. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/task/get.py +0 -0
  151. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/task/namespaces.py +0 -0
  152. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/task/use.py +0 -0
  153. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/task/wait.py +0 -0
  154. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/vm/__init__.py +0 -0
  155. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/vm/poweroff.py +0 -0
  156. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/vm/poweron.py +0 -0
  157. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/vm/restart.py +0 -0
  158. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/vm/shutdown.py +0 -0
  159. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/cmds/vm/use.py +0 -0
  160. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/config/default.yaml +0 -0
  161. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/config/int.yaml +0 -0
  162. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/config/prod.yaml +0 -0
  163. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/config/stg.yaml +0 -0
  164. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/ctxp/__init__.py +0 -0
  165. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/ctxp/_init.py +0 -0
  166. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/ctxp/built_in_cmds/__init__.py +0 -0
  167. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/ctxp/built_in_cmds/context.py +0 -0
  168. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/ctxp/cli_processor.py +0 -0
  169. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/ctxp/cmd_util.py +0 -0
  170. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/ctxp/config.py +0 -0
  171. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/ctxp/context.py +0 -0
  172. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/ctxp/data_util.py +0 -0
  173. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/ctxp/dispatcher.py +0 -0
  174. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/ctxp/extension.py +0 -0
  175. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/ctxp/fn_util.py +0 -0
  176. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/ctxp/fstore.py +0 -0
  177. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/ctxp/jsondot.py +0 -0
  178. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/ctxp/profile_store.py +0 -0
  179. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/ctxp/state.py +0 -0
  180. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/ctxp/template_util.py +0 -0
  181. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/ctxp/timeutil.py +0 -0
  182. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/ctxp/var_template.py +0 -0
  183. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/mcp/__init__.py +0 -0
  184. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/mcp/_util.py +0 -0
  185. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/mcp/resources/__init__.py +0 -0
  186. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/mcp/resources/activity.py +0 -0
  187. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/mcp/resources/api.py +0 -0
  188. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/mcp/resources/credential.py +0 -0
  189. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/mcp/resources/deployment.py +0 -0
  190. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/mcp/resources/entitlement.py +0 -0
  191. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/mcp/resources/group.py +0 -0
  192. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/mcp/resources/network.py +0 -0
  193. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/mcp/resources/notification.py +0 -0
  194. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/mcp/resources/org.py +0 -0
  195. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/mcp/resources/pool.py +0 -0
  196. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/mcp/resources/provider.py +0 -0
  197. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/mcp/resources/sag.py +0 -0
  198. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/mcp/resources/task.py +0 -0
  199. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/mcp/resources/vm.py +0 -0
  200. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/mcp/server.py +0 -0
  201. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/service/__init__.py +0 -0
  202. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/service/activity.py +0 -0
  203. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/service/api.py +0 -0
  204. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/service/broker/__init__.py +0 -0
  205. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/service/broker/entitlement.py +0 -0
  206. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/service/broker/pool_group.py +0 -0
  207. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/service/cockpit/__init__.py +0 -0
  208. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/service/cockpit/network.py +0 -0
  209. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/service/cockpit/pool.py +0 -0
  210. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/service/cockpit/provider.py +0 -0
  211. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/service/cockpit/sag.py +0 -0
  212. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/service/cockpit/vm.py +0 -0
  213. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/service/credential.py +0 -0
  214. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/service/deployment.py +0 -0
  215. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/service/notification.py +0 -0
  216. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/service/org.py +0 -0
  217. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/sglib/client_util.py +0 -0
  218. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/sglib/init.py +0 -0
  219. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/sglib/mdc.py +0 -0
  220. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/sglib/utils.py +0 -0
  221. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/sglib/zds_client.py +0 -0
  222. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/support/payload.py +0 -0
  223. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/support/profile.py +0 -0
  224. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/support/use_util.py +0 -0
  225. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/util/exit.py +0 -0
  226. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/util/query_util.py +0 -0
  227. {zen_cli-0.1.6 → zen_cli-0.1.7}/src/zen_cli/util/readonly.py +0 -0
  228. {zen_cli-0.1.6 → zen_cli-0.1.7}/tests/blackbox/__init__.py +0 -0
  229. {zen_cli-0.1.6 → zen_cli-0.1.7}/tests/blackbox/util.py +0 -0
  230. {zen_cli-0.1.6 → zen_cli-0.1.7}/tests/test_device_login.py +0 -0
  231. {zen_cli-0.1.6 → zen_cli-0.1.7}/tests/test_mcp.py +0 -0
  232. {zen_cli-0.1.6 → zen_cli-0.1.7}/tests/test_payload.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: zen-cli
3
- Version: 0.1.6
3
+ Version: 0.1.7
4
4
  Summary: CLI for Zen Desktop Service. Designed for AI and Human.
5
5
  Project-URL: Homepage, https://pypi.org/project/zen-cli/
6
6
  Author: zen-cli authors
@@ -34,29 +34,29 @@ Description-Content-Type: text/markdown
34
34
 
35
35
  [![PyPI](https://img.shields.io/pypi/v/zen-cli?logo=pypi&logoColor=white)](https://pypi.org/project/zen-cli/) [![Python](https://img.shields.io/badge/python-3.12%2B-3776AB?logo=python&logoColor=white)](https://www.python.org/downloads/) [![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE) [![PyPI downloads](https://img.shields.io/pypi/dm/zen-cli)](https://pypi.org/project/zen-cli/) [![Wheel](https://img.shields.io/pypi/wheel/zen-cli)](https://pypi.org/project/zen-cli/) [![OS](https://img.shields.io/badge/OS-macOS%20%7C%20Linux%20%7C%20Windows-informational)](https://pypi.org/project/zen-cli/) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![Checked with mypy](https://img.shields.io/badge/mypy-checked-2A6DB2)](https://mypy-lang.org/) [![Click](https://img.shields.io/badge/cli-Click%208-4584b6)](https://click.palletsprojects.com/) [![Hatch](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5)](https://github.com/pypa/hatch)
36
36
 
37
- Command-line toolbox for Zen Cloud PC, designed for AI and human.
37
+ 面向 AI 和人的 Zen Cloud 命令行工具。
38
38
 
39
- ## Contents
39
+ ## 目录
40
40
 
41
- - [Try it out](#try-it-out)
42
- - [Prerequisites](#prerequisites)
43
- - [Installation](#installation)
44
- - [Mac & Linux](#mac--linux)
41
+ - [试用](#试用)
42
+ - [前置条件](#前置条件)
43
+ - [安装](#安装)
44
+ - [Mac 与 Linux](#mac-与-linux)
45
45
  - [Windows](#windows)
46
- - [Use the CLI](#use-the-cli)
47
- - [Documentation](#documentation)
48
- - [License](#license)
46
+ - [使用 CLI](#使用-cli)
47
+ - [文档](#文档)
48
+ - [许可证](#许可证)
49
49
 
50
- ## Try it out
50
+ ## 试用
51
51
 
52
- ### Prerequisites
52
+ ### 前置条件
53
53
 
54
- * Python 3.12 or newer
54
+ * Python 3.12 或更新版本
55
55
  * Pip
56
56
 
57
- ### Installation
57
+ ### 安装
58
58
 
59
- #### Mac & Linux
59
+ #### Mac 与 Linux
60
60
 
61
61
  ```text
62
62
  pip install zen-cli
@@ -68,9 +68,9 @@ pip install zen-cli
68
68
  pip install zen-cli
69
69
  ```
70
70
 
71
- If Python was installed without “Add python to PATH”, add Python and its `Scripts` directory to PATH.
71
+ 如果安装 Python 时没有勾选 “Add python to PATH”,请把 Python 及其 `Scripts` 目录加入 PATH。
72
72
 
73
- ### Use the CLI
73
+ ### 使用 CLI
74
74
 
75
75
  ```text
76
76
  zen login
@@ -79,20 +79,22 @@ zen auth details
79
79
  zen auth token
80
80
  ```
81
81
 
82
- `zen login` reuses a valid cached token or configured credentials (API token, client id/secret). If neither is available it starts device-code login. It does not print the access token. Machine login is `zen login --client-id` / `--client-secret`. `zen auth status` is JSON (`logged_in`, `method`, `ttl`). `zen auth details` is the JWT and org. `zen auth token` is the bearer (`--service` on details/token). `zen auth refresh` refreshes the cached token.
83
82
 
84
- Run a command, for example, list pools:
83
+ 跑一条命令,例如列出桌面池:
85
84
 
86
85
  ```text
87
86
  zen pool list
88
87
  ```
89
88
 
90
- ## Documentation
89
+ ## 文档
91
90
 
92
- * [User guide](docs/user-guide.md) — profiles, flags, payloads, and command conventions
93
- * [Cheatsheet](docs/cheatsheet.md) — command examples
94
- * [Developer guide](docs/dev.md) — build, test, and package layout
91
+ * [用户指南](docs/user-guide.md) — profile、旗标、请求体和命令约定
92
+ * [环境变量](docs/env.md) — `zen` 读取的环境变量
93
+ * [速查](docs/cheatsheet.md) — 命令示例
94
+ * [CLI 通用原则](docs/cli-principles.md) — 退出码、输出格式、通用参数和特例
95
+ * [开发指南](docs/dev-guide.md) — 环境、`dev.py`、Jenkins 和如何加命令
96
+ * [编码原则](docs/coding-principles.md) — 包划分和导入方向
95
97
 
96
- ## License
98
+ ## 许可证
97
99
 
98
- Licensed under the MIT License. See [LICENSE](LICENSE).
100
+ 采用 MIT License。见 [LICENSE](LICENSE)。
@@ -0,0 +1,68 @@
1
+ # zen-cli
2
+
3
+ [![PyPI](https://img.shields.io/pypi/v/zen-cli?logo=pypi&logoColor=white)](https://pypi.org/project/zen-cli/) [![Python](https://img.shields.io/badge/python-3.12%2B-3776AB?logo=python&logoColor=white)](https://www.python.org/downloads/) [![License: MIT](https://img.shields.io/badge/license-MIT-green)](LICENSE) [![PyPI downloads](https://img.shields.io/pypi/dm/zen-cli)](https://pypi.org/project/zen-cli/) [![Wheel](https://img.shields.io/pypi/wheel/zen-cli)](https://pypi.org/project/zen-cli/) [![OS](https://img.shields.io/badge/OS-macOS%20%7C%20Linux%20%7C%20Windows-informational)](https://pypi.org/project/zen-cli/) [![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff) [![Checked with mypy](https://img.shields.io/badge/mypy-checked-2A6DB2)](https://mypy-lang.org/) [![Click](https://img.shields.io/badge/cli-Click%208-4584b6)](https://click.palletsprojects.com/) [![Hatch](https://img.shields.io/badge/%F0%9F%A5%9A-Hatch-4051b5)](https://github.com/pypa/hatch)
4
+
5
+ 面向 AI 和人的 Zen Cloud 命令行工具。
6
+
7
+ ## 目录
8
+
9
+ - [试用](#试用)
10
+ - [前置条件](#前置条件)
11
+ - [安装](#安装)
12
+ - [Mac 与 Linux](#mac-与-linux)
13
+ - [Windows](#windows)
14
+ - [使用 CLI](#使用-cli)
15
+ - [文档](#文档)
16
+ - [许可证](#许可证)
17
+
18
+ ## 试用
19
+
20
+ ### 前置条件
21
+
22
+ * Python 3.12 或更新版本
23
+ * Pip
24
+
25
+ ### 安装
26
+
27
+ #### Mac 与 Linux
28
+
29
+ ```text
30
+ pip install zen-cli
31
+ ```
32
+
33
+ #### Windows
34
+
35
+ ```text
36
+ pip install zen-cli
37
+ ```
38
+
39
+ 如果安装 Python 时没有勾选 “Add python to PATH”,请把 Python 及其 `Scripts` 目录加入 PATH。
40
+
41
+ ### 使用 CLI
42
+
43
+ ```text
44
+ zen login
45
+ zen auth status
46
+ zen auth details
47
+ zen auth token
48
+ ```
49
+
50
+
51
+ 跑一条命令,例如列出桌面池:
52
+
53
+ ```text
54
+ zen pool list
55
+ ```
56
+
57
+ ## 文档
58
+
59
+ * [用户指南](docs/user-guide.md) — profile、旗标、请求体和命令约定
60
+ * [环境变量](docs/env.md) — `zen` 读取的环境变量
61
+ * [速查](docs/cheatsheet.md) — 命令示例
62
+ * [CLI 通用原则](docs/cli-principles.md) — 退出码、输出格式、通用参数和特例
63
+ * [开发指南](docs/dev-guide.md) — 环境、`dev.py`、Jenkins 和如何加命令
64
+ * [编码原则](docs/coding-principles.md) — 包划分和导入方向
65
+
66
+ ## 许可证
67
+
68
+ 采用 MIT License。见 [LICENSE](LICENSE)。
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "zen-cli"
7
- version = "0.1.6"
7
+ version = "0.1.7"
8
8
  description = "CLI for Zen Desktop Service. Designed for AI and Human."
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -44,7 +44,7 @@ include = ["src/zen_cli", "tests", "README.md", "LICENSE"]
44
44
  target-version = "py312"
45
45
  line-length = 120
46
46
  src = ["src"]
47
- exclude = ["cli-ref", "src/zen_cli/support/test_utils2.py"]
47
+ exclude = ["cli-ref"]
48
48
 
49
49
  [tool.ruff.lint]
50
50
  select = ["E", "F", "I", "UP", "B", "SIM", "RUF"]
@@ -53,7 +53,6 @@ select = ["E", "F", "I", "UP", "B", "SIM", "RUF"]
53
53
  python_version = "3.12"
54
54
  strict = true
55
55
  files = ["src"]
56
- exclude = ["test_utils2\\.py"]
57
56
 
58
57
  [[tool.mypy.overrides]]
59
58
  module = ["mcp", "mcp.*"]
@@ -0,0 +1,14 @@
1
+ """zen-cli package."""
2
+
3
+ _httpx_aliased = False
4
+
5
+
6
+ def alias_httpx() -> None:
7
+ """Install httpx2 as httpx. Call before the first HTTP client import."""
8
+ global _httpx_aliased
9
+ if _httpx_aliased:
10
+ return
11
+ import httpx2
12
+
13
+ httpx2.alias_httpx()
14
+ _httpx_aliased = True
@@ -32,11 +32,8 @@ logging.getLogger("urllib3").setLevel(logging.ERROR)
32
32
  # logging.getLogger("zen_cli.sglib.login_support").setLevel(logging.DEBUG)
33
33
  # logging.getLogger("login_support").setLevel(logging.DEBUG)
34
34
  # -----------------------------------------------------------
35
- import zen_cli.sglib.ez_client as ez_client # noqa: E402
36
35
 
37
- ez_client._print_http_error = False
38
-
39
- CONTEXT_SETTINGS = {
36
+ CONTEXT_SETTINGS: dict[str, Any] = {
40
37
  "help_option_names": ["-h", "--help"],
41
38
  "max_content_width": 160,
42
39
  }
@@ -52,6 +49,7 @@ def _apply_readonly() -> None:
52
49
  else:
53
50
  is_readonly = bool(is_readonly)
54
51
  if is_readonly:
52
+ from zen_cli.sglib import ez_client
55
53
  from zen_cli.util import readonly as readonly_support
56
54
 
57
55
  ez_client.set_readonly(True, readonly_support.ALLOW_PATHS)
@@ -75,7 +73,7 @@ def _enable_verbose() -> None:
75
73
 
76
74
 
77
75
  def _check_upgrade() -> None:
78
- check_flag_from_env = env.bool("HCS_CLI_CHECK_UPGRADE", True)
76
+ check_flag_from_env = env.bool("ZEN_CLI_CHECK_UPGRADE", True)
79
77
  if not check_flag_from_env:
80
78
  return
81
79
  if os.environ.get("_ZEN_COMPLETE"):
@@ -105,7 +103,7 @@ def _check_upgrade() -> None:
105
103
  @click.option(
106
104
  "--check-upgrade/--no-check-upgrade",
107
105
  default=None,
108
- help="Check for a new zen-cli version. On by default. Or set HCS_CLI_CHECK_UPGRADE=false.",
106
+ help="Check for a new zen-cli version. On by default. Or set ZEN_CLI_CHECK_UPGRADE=false.",
109
107
  )
110
108
  @click.option(
111
109
  "--telemetry/--no-telemetry",
@@ -155,6 +153,9 @@ def cli(
155
153
 
156
154
  mdc_session.set(mdc)
157
155
 
156
+ from zen_cli.support.recent import install as install_recent
157
+
158
+ install_recent()
158
159
  _apply_readonly()
159
160
  load_commands()
160
161
 
@@ -171,6 +172,8 @@ def load_commands() -> None:
171
172
  def main() -> None:
172
173
  ctxp.init(app_name="zen", config_path=str(_CONFIG_DIR))
173
174
  load_dotenv(".env")
175
+ if not logger.color_enabled():
176
+ CONTEXT_SETTINGS["color"] = False
174
177
  if os.environ.get("_ZEN_COMPLETE"):
175
178
  ctxp.telemetry.disable()
176
179
  ctxp.init_cli(main_cli=cli, commands_dir=str(_COMMANDS_DIR))
@@ -3,8 +3,9 @@ from typing import Any
3
3
  import click
4
4
 
5
5
  import zen_cli.sglib.cli_options as cli
6
- from zen_cli.ctxp import recent, util
6
+ from zen_cli.ctxp import recent
7
7
  from zen_cli.service import activity
8
+ from zen_cli.support.activity import format_activity_table
8
9
 
9
10
  _RESOURCE_TYPES = [
10
11
  "ORG",
@@ -28,26 +29,6 @@ _RESOURCE_TYPES = [
28
29
  "NOTIFICATION",
29
30
  ]
30
31
 
31
- _TABLE_MAPPING = {
32
- "code": "Code",
33
- "severity": "Severity",
34
- "initiator": "Initiator",
35
- "serviceName": "Service",
36
- "resourceId": "Resource",
37
- "traceId": "Trace",
38
- }
39
-
40
-
41
- def _format_activity_table(data: Any) -> Any:
42
- for d in data:
43
- if d.get("timestamp") and not d.get("createdAt"):
44
- d["createdAt"] = d["timestamp"]
45
- if not d.get("name"):
46
- d["name"] = d.get("resourceName") or d.get("code") or ""
47
- if not d.get("type"):
48
- d["type"] = d.get("resourceType")
49
- return util.default_table_formatter(data, _TABLE_MAPPING)
50
-
51
32
 
52
33
  @click.command(name="list")
53
34
  @cli.org_id
@@ -101,7 +82,7 @@ def _format_activity_table(data: Any) -> Any:
101
82
  )
102
83
  @cli.sort
103
84
  @cli.limit
104
- @cli.formatter(_format_activity_table)
85
+ @cli.formatter(format_activity_table)
105
86
  def list_activities(
106
87
  org: str,
107
88
  service_name: str,
@@ -2,9 +2,7 @@ from typing import Any
2
2
 
3
3
  import click
4
4
 
5
- from zen_cli.service import api as zen_api
6
5
  from zen_cli.sglib import mdc as mdc_session
7
- from zen_cli.sglib.client_util import resolve_zds_base_url
8
6
  from zen_cli.support.payload import handle_data_input
9
7
 
10
8
 
@@ -108,6 +106,9 @@ def api(
108
106
  if raise_on_404 and method not in ("GET", "DELETE"):
109
107
  raise click.UsageError("The --raise-on-404 option is only applicable for GET and DELETE methods.")
110
108
 
109
+ from zen_cli.service import api as zen_api
110
+ from zen_cli.sglib.client_util import resolve_zds_base_url
111
+
111
112
  raw_data, json_data = handle_data_input(data_arg, json_arg)
112
113
 
113
114
  if method in ["GET", "DELETE"] and (raw_data is not None or json_data is not None):
@@ -13,5 +13,5 @@ from zen_cli.support import auth as auth_support
13
13
  help="Report login status for a target service override.",
14
14
  )
15
15
  def status(service: str | None) -> Any:
16
- """Show whether you are logged in, the login method, and token TTL in seconds."""
16
+ """Show whether you are logged in, TTL, and main JWT identity (name, acct, org, roles)."""
17
17
  return auth_support.session_status(service)
@@ -9,6 +9,9 @@ _SHELLS = ("bash", "zsh", "fish", "powershell")
9
9
  def completion(shell: str) -> None:
10
10
  """Print a shell completion script.
11
11
 
12
+ Writes the script to stdout (not via --output). I/O flags do not apply.
13
+ Skips the startup upgrade check.
14
+
12
15
  \b
13
16
  bash:
14
17
  eval "$(zen completion bash)"
@@ -0,0 +1,19 @@
1
+ from typing import Any
2
+
3
+ import click
4
+
5
+ import zen_cli.sglib.cli_options as cli
6
+ from zen_cli.ctxp import recent
7
+ from zen_cli.service import deployment
8
+ from zen_cli.support.deployment import format_deployment_table
9
+
10
+
11
+ @click.command(name="list")
12
+ @cli.org_id
13
+ @cli.limit
14
+ @cli.formatter(format_deployment_table)
15
+ def list_deployments(org: str, **kwargs: Any) -> Any:
16
+ """List express deployments."""
17
+ ret = deployment.list(org_id=cli.get_org_id(org), **kwargs)
18
+ recent.helper.default_list(ret, "deployment")
19
+ return ret
@@ -6,8 +6,8 @@ import click
6
6
  import zen_cli.ctxp as ctxp
7
7
  import zen_cli.sglib as sglib
8
8
  from zen_cli.ctxp.util import error_details
9
- from zen_cli.sglib import login_support
10
9
  from zen_cli.sglib.cli_options import use_org
10
+ from zen_cli.support import auth as auth_support
11
11
  from zen_cli.support import profile as profile_support
12
12
 
13
13
  # Login use cases:
@@ -88,12 +88,14 @@ def login(
88
88
  """Login Zen Desktop Service.
89
89
 
90
90
  This command works with the current profile and will update the current profile.
91
+ --org is the login org, not a resource --org. --verbose is this command's own flag.
92
+
91
93
  With no method flag, reuses the cached token or configured credentials.
92
94
  If neither is available, starts device-code login. Browser SSO runs only
93
95
  with `--browser`.
94
96
 
95
- Inspect or refresh an existing session with `zen auth` (not this command):
96
- `zen auth status`, `zen auth details`, `zen auth token`, `zen auth refresh`.
97
+ On success, prints the same JSON as `zen auth status`.
98
+ Inspect or refresh later with `zen auth details`, `zen auth token`, `zen auth refresh`.
97
99
  Per-service tokens: `zen auth details --service` / `zen auth token --service`.
98
100
 
99
101
  \b
@@ -183,6 +185,8 @@ def login(
183
185
 
184
186
  interactive = browser or device_code
185
187
 
188
+ from zen_cli.sglib import login_support
189
+
186
190
  if interactive and not login_support.identify_client_id(csp.url):
187
191
  return ctxp.error(
188
192
  "The interactive login on the specified stack is not yet available. Try a different authentication method."
@@ -240,7 +244,7 @@ def login(
240
244
  # Cache key is md5(csp config); re-save so orgId backfill does not orphan the entry.
241
245
  sglib.auth.save_auth_cache(csp, oauth_token)
242
246
 
243
- return None
247
+ return auth_support.session_status()
244
248
 
245
249
 
246
250
  def _is_missing_session(err: BaseException) -> bool:
@@ -253,6 +257,8 @@ def _echo(msg: str) -> None:
253
257
 
254
258
 
255
259
  def _do_browser_login() -> Any:
260
+ from zen_cli.sglib import login_support
261
+
256
262
  current: Any = ctxp.profile.current()
257
263
  auth_config = current.csp
258
264
  org_id = auth_config.orgId
@@ -282,21 +288,19 @@ def _do_browser_login() -> Any:
282
288
 
283
289
 
284
290
  def _do_device_login() -> Any:
291
+ from zen_cli.sglib import login_support
292
+
285
293
  current: Any = ctxp.profile.current()
286
294
  auth_config = current.csp
287
295
  org_id = auth_config.orgId
288
296
 
289
297
  def _announce(started: dict[str, Any]) -> None:
290
- uri = started.get("verification_uri") or ""
291
- complete = started.get("verification_uri_complete") or uri
298
+ url = started.get("verification_uri_complete") or started.get("verification_uri") or ""
292
299
  _echo("Logging to Zen Desktop Service with device code...")
293
300
  _echo(f" CSP: {auth_config.url}")
294
301
  _echo(f" Organization: {org_id if org_id else '<default>'}")
295
302
  _echo(f" Profile: {ctxp.profile.name()}")
296
- _echo(f"On any device, open {uri} and enter this code:")
297
- _echo(f" {started.get('user_code')}")
298
- if complete and complete != uri:
299
- _echo(f"Or open: {complete}")
303
+ _echo(f"Open: {url}")
300
304
  _echo("Waiting for authorization. Press CTRL+C to abort.")
301
305
 
302
306
  token = login_support.login_via_device_code(auth_config.url, org_id, announce=_announce)
@@ -5,6 +5,9 @@ import click
5
5
  def mcp() -> None:
6
6
  """Run the zen MCP server over stdio.
7
7
 
8
+ Uses stdout for the MCP protocol; I/O flags do not apply.
9
+ Skips the startup upgrade check.
10
+
8
11
  Tools: api, plus get/list for org, activity, entitlement, group, provider,
9
12
  sag, network, credential, deployment, notification, pool, vm, and task.
10
13
  """
@@ -3,15 +3,9 @@ from typing import Any
3
3
  import click
4
4
 
5
5
  import zen_cli.sglib.cli_options as cli
6
- from zen_cli.ctxp import recent, util
6
+ from zen_cli.ctxp import recent
7
7
  from zen_cli.service.cockpit import network
8
-
9
-
10
- def _format_network_table(data: Any) -> Any:
11
- for d in data:
12
- if not d.get("name"):
13
- d["name"] = d.get("description") or d.get("region") or ""
14
- return util.default_table_formatter(data, {"region": "Region"})
8
+ from zen_cli.support.network import format_network_table
15
9
 
16
10
 
17
11
  @click.command(name="list")
@@ -19,7 +13,7 @@ def _format_network_table(data: Any) -> Any:
19
13
  @cli.search
20
14
  @cli.sort
21
15
  @cli.limit
22
- @cli.formatter(_format_network_table)
16
+ @cli.formatter(format_network_table)
23
17
  def list_networks(org: str, **kwargs: Any) -> Any:
24
18
  """List network infrastructure deployments."""
25
19
  ret = network.list(org_id=cli.get_org_id(org), **kwargs)
@@ -3,27 +3,9 @@ from typing import Any
3
3
  import click
4
4
 
5
5
  import zen_cli.sglib.cli_options as cli
6
- from zen_cli.ctxp import recent, util
6
+ from zen_cli.ctxp import recent
7
7
  from zen_cli.service import notification
8
-
9
-
10
- def _format_notification_table(data: Any) -> Any:
11
- for d in data:
12
- if not d.get("name"):
13
- d["name"] = d.get("title") or d.get("code") or ""
14
- if d.get("sentAt") and not d.get("createdAt"):
15
- d["createdAt"] = d["sentAt"]
16
- if d.get("lastOccurrenceAt") and not d.get("updatedAt"):
17
- d["updatedAt"] = d["lastOccurrenceAt"]
18
- return util.default_table_formatter(
19
- data,
20
- {
21
- "code": "Code",
22
- "serviceName": "Service",
23
- "resourceName": "Resource",
24
- "acknowledgedBy": "Ack By",
25
- },
26
- )
8
+ from zen_cli.support.notification import format_notification_table
27
9
 
28
10
 
29
11
  @click.command(name="list")
@@ -41,7 +23,7 @@ def _format_notification_table(data: Any) -> Any:
41
23
  )
42
24
  @cli.sort
43
25
  @cli.limit
44
- @cli.formatter(_format_notification_table)
26
+ @cli.formatter(format_notification_table)
45
27
  def list_notifications(
46
28
  org: str,
47
29
  service_name: str,
@@ -0,0 +1,20 @@
1
+ from typing import Any
2
+
3
+ import click
4
+
5
+ import zen_cli.sglib.cli_options as cli
6
+ from zen_cli.ctxp import recent
7
+ from zen_cli.service import org
8
+ from zen_cli.support.org import format_org_table
9
+
10
+
11
+ @click.command(name="list")
12
+ @cli.search
13
+ @cli.sort
14
+ @cli.limit
15
+ @cli.formatter(format_org_table)
16
+ def list_orgs(**kwargs: Any) -> Any:
17
+ """List org details"""
18
+ ret = org.list(**kwargs)
19
+ recent.helper.default_list(ret, "org", field_name="orgId")
20
+ return ret
@@ -0,0 +1,36 @@
1
+ from typing import Any
2
+
3
+ import click
4
+
5
+ import zen_cli.sglib.cli_options as cli
6
+ from zen_cli.ctxp import recent
7
+ from zen_cli.service.cockpit import pool
8
+ from zen_cli.support.pool import format_pool_table
9
+
10
+
11
+ @click.command(name="list")
12
+ @cli.org_id
13
+ @cli.search
14
+ @cli.sort
15
+ @cli.limit
16
+ @click.option("--brokerable-only", type=bool, required=False, default=False)
17
+ @click.option("--expanded", type=bool, required=False, default=False)
18
+ @click.option(
19
+ "--reported-search",
20
+ type=str,
21
+ required=False,
22
+ help="Search expression for selection of pool reported properties",
23
+ )
24
+ @cli.formatter(format_pool_table)
25
+ def list_pools(org: str, **kwargs: Any) -> Any:
26
+ """List pools"""
27
+
28
+ org_id = cli.get_org_id(org)
29
+
30
+ if "search" in kwargs:
31
+ kwargs["pool_search"] = kwargs["search"]
32
+ del kwargs["search"]
33
+
34
+ ret = pool.list(org_id=org_id, **kwargs)
35
+ recent.helper.default_list(ret, "pool")
36
+ return ret
@@ -25,7 +25,10 @@ def delete(
25
25
  confirm: bool,
26
26
  **kwargs: Any,
27
27
  ) -> Any:
28
- """Delete a task."""
28
+ """Delete a task.
29
+
30
+ Not implemented. Prints TODO on stderr and exits 1.
31
+ """
29
32
  namespace, group, key = parse_task_param(namespace, group, smart_path)
30
33
  org_id = cli.get_org_id(org)
31
34
  ret = task.get(org_id, namespace, group, key, **kwargs)
@@ -38,5 +41,4 @@ def delete(
38
41
  # with contextlib.suppress(Exception):
39
42
  # task.cancel(org_id, namespace, group, key)
40
43
  # return task.delete(org_id, namespace, group, key, execution_id, exclusive_id)
41
- click.echo("Task delete is not implemented on the service side yet.", err=True)
42
- return "", 1
44
+ return "TODO", 1
@@ -0,0 +1,29 @@
1
+ from typing import Any
2
+
3
+ import click
4
+
5
+ import zen_cli.sglib.cli_options as cli
6
+ from zen_cli.support.task import duplicate_task
7
+
8
+
9
+ @click.command()
10
+ @cli.org_id
11
+ @click.option("--namespace", "-n", type=str, required=False)
12
+ @click.option("--group", "-g", type=str, required=False)
13
+ @click.option(
14
+ "--reference",
15
+ "-r",
16
+ type=str,
17
+ required=True,
18
+ help="Reference task to copy parameters from, format: [[<namespace>/]<group>/]<key>.",
19
+ )
20
+ @click.option(
21
+ "--at",
22
+ type=str,
23
+ required=False,
24
+ help="Schedule time, exact time 'YYYY-MM-DD HH:MM:SS', or delta time '1h30m', default is now.",
25
+ )
26
+ @click.argument("smart_path", type=str, required=False)
27
+ def duplicate(org: str, namespace: str, group: str, smart_path: str, at: str, reference: str, **kwargs: Any) -> Any:
28
+ """Duplicate an existing task to run once, immediately or at a specific time."""
29
+ return duplicate_task(cli.get_org_id(org), namespace, group, smart_path, at, reference, **kwargs)
@@ -48,7 +48,7 @@ _TIME_RANGE = "Time range, one side optional. E.g. '2026-01-01,'"
48
48
  @click.option("--time-scheduled", type=str, required=False, help=_TIME_RANGE)
49
49
  @click.option("--time-started", type=str, required=False, help=_TIME_RANGE)
50
50
  @click.option("--time-completed", type=str, required=False, help=_TIME_RANGE)
51
- @cli.limit(default=10)
51
+ @cli.limit
52
52
  @cli.search
53
53
  @cli.formatter(format_task_table)
54
54
  def list_tasks(
@@ -27,7 +27,7 @@ from zen_cli.support.task import (
27
27
  ),
28
28
  )
29
29
  @cli.search
30
- @cli.limit(default=10)
30
+ @cli.limit
31
31
  @cli.formatter(format_tasklog_table)
32
32
  def log(
33
33
  org: str, namespace: str, group: str, smart_path: str, last: bool, state: str, search: str, **kwargs: Any
@@ -6,7 +6,10 @@ import click
6
6
 
7
7
  @click.command()
8
8
  def upgrade() -> None:
9
- """Upgrade zen-cli."""
9
+ """Upgrade zen-cli.
10
+
11
+ Runs pip and writes its output to the terminal. Skips the startup upgrade check.
12
+ """
10
13
  cmd = "pip install -U zen-cli --upgrade-strategy eager --no-cache-dir"
11
14
  p = subprocess.run(cmd, stdout=sys.stdout, stderr=sys.stderr, text=False, shell=True, check=False)
12
15
  if p.returncode: