zen-cli 0.1.6__tar.gz → 0.1.8__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 (235) hide show
  1. {zen_cli-0.1.6 → zen_cli-0.1.8}/PKG-INFO +40 -29
  2. zen_cli-0.1.8/README.md +76 -0
  3. {zen_cli-0.1.6 → zen_cli-0.1.8}/pyproject.toml +3 -3
  4. zen_cli-0.1.8/src/zen_cli/__init__.py +14 -0
  5. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cli.py +11 -7
  6. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/activity/list.py +3 -22
  7. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/api.py +6 -7
  8. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/auth/details.py +1 -1
  9. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/auth/status.py +2 -2
  10. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/auth/token.py +1 -1
  11. zen_cli-0.1.8/src/zen_cli/cmds/completion.py +44 -0
  12. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/credential/create.py +1 -1
  13. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/deployment/create.py +1 -1
  14. zen_cli-0.1.8/src/zen_cli/cmds/deployment/list.py +19 -0
  15. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/entitlement/create.py +1 -1
  16. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/group/create.py +1 -1
  17. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/login.py +20 -22
  18. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/mcp.py +7 -0
  19. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/network/create.py +1 -1
  20. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/network/list.py +3 -9
  21. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/notification/list.py +3 -21
  22. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/org/create.py +1 -1
  23. zen_cli-0.1.8/src/zen_cli/cmds/org/list.py +20 -0
  24. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/pool/create.py +1 -1
  25. zen_cli-0.1.8/src/zen_cli/cmds/pool/list.py +36 -0
  26. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/provider/create.py +1 -1
  27. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/sag/create.py +1 -1
  28. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/task/delete.py +1 -2
  29. zen_cli-0.1.8/src/zen_cli/cmds/task/duplicate.py +29 -0
  30. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/task/get.py +1 -1
  31. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/task/list.py +1 -1
  32. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/task/log.py +3 -6
  33. zen_cli-0.1.8/src/zen_cli/cmds/upgrade.py +68 -0
  34. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/vm/delete.py +1 -1
  35. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/vm/get.py +2 -5
  36. zen_cli-0.1.8/src/zen_cli/cmds/vm/list.py +91 -0
  37. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/vm/wait.py +8 -1
  38. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/ctxp/__init__.py +1 -0
  39. zen_cli-0.1.8/src/zen_cli/ctxp/_patch_click.py +5 -0
  40. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/ctxp/built_in_cmds/_ut.py +10 -5
  41. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/ctxp/built_in_cmds/profile.py +4 -1
  42. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/ctxp/cli_options.py +2 -1
  43. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/ctxp/cli_processor.py +102 -22
  44. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/ctxp/logger.py +23 -10
  45. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/ctxp/profile.py +44 -14
  46. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/ctxp/recent.py +77 -20
  47. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/ctxp/telemetry.py +5 -1
  48. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/ctxp/util.py +9 -5
  49. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/service/task.py +0 -12
  50. zen_cli-0.1.8/src/zen_cli/sglib/__init__.py +21 -0
  51. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/sglib/auth.py +51 -4
  52. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/sglib/cli_options.py +1 -5
  53. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/sglib/csp.py +4 -1
  54. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/sglib/ez_client.py +7 -4
  55. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/sglib/login_support.py +7 -7
  56. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/sglib/requtil.py +4 -2
  57. zen_cli-0.1.8/src/zen_cli/support/activity.py +23 -0
  58. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/support/auth.py +6 -1
  59. zen_cli-0.1.8/src/zen_cli/support/deployment.py +12 -0
  60. zen_cli-0.1.8/src/zen_cli/support/network.py +10 -0
  61. zen_cli-0.1.8/src/zen_cli/support/notification.py +22 -0
  62. zen_cli-0.1.8/src/zen_cli/support/org.py +17 -0
  63. zen_cli-0.1.6/src/zen_cli/cmds/pool/list.py → zen_cli-0.1.8/src/zen_cli/support/pool.py +2 -34
  64. zen_cli-0.1.8/src/zen_cli/support/recent.py +15 -0
  65. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/support/task.py +360 -312
  66. zen_cli-0.1.6/src/zen_cli/cmds/vm/list.py → zen_cli-0.1.8/src/zen_cli/support/vm.py +61 -120
  67. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/util/exec_util.py +11 -17
  68. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/util/versions.py +5 -1
  69. zen_cli-0.1.6/src/zen_cli/support/test_utils.py → zen_cli-0.1.8/tests/blackbox/cli_test.py +2 -2
  70. {zen_cli-0.1.6 → zen_cli-0.1.8}/tests/blackbox/test_api.py +9 -9
  71. {zen_cli-0.1.6 → zen_cli-0.1.8}/tests/blackbox/test_auth.py +19 -20
  72. {zen_cli-0.1.6 → zen_cli-0.1.8}/tests/blackbox/test_completion.py +7 -8
  73. {zen_cli-0.1.6 → zen_cli-0.1.8}/tests/blackbox/test_context.py +16 -17
  74. {zen_cli-0.1.6 → zen_cli-0.1.8}/tests/blackbox/test_credential.py +10 -11
  75. {zen_cli-0.1.6 → zen_cli-0.1.8}/tests/blackbox/test_deployment.py +10 -11
  76. {zen_cli-0.1.6 → zen_cli-0.1.8}/tests/blackbox/test_entitlement.py +10 -11
  77. {zen_cli-0.1.6 → zen_cli-0.1.8}/tests/blackbox/test_errors.py +90 -88
  78. {zen_cli-0.1.6 → zen_cli-0.1.8}/tests/blackbox/test_group.py +10 -11
  79. zen_cli-0.1.8/tests/blackbox/test_io.py +135 -0
  80. {zen_cli-0.1.6 → zen_cli-0.1.8}/tests/blackbox/test_login.py +26 -27
  81. {zen_cli-0.1.6 → zen_cli-0.1.8}/tests/blackbox/test_logout.py +6 -6
  82. {zen_cli-0.1.6 → zen_cli-0.1.8}/tests/blackbox/test_mcp.py +7 -8
  83. {zen_cli-0.1.6 → zen_cli-0.1.8}/tests/blackbox/test_network.py +10 -11
  84. {zen_cli-0.1.6 → zen_cli-0.1.8}/tests/blackbox/test_org.py +22 -23
  85. {zen_cli-0.1.6 → zen_cli-0.1.8}/tests/blackbox/test_pool.py +32 -33
  86. {zen_cli-0.1.6 → zen_cli-0.1.8}/tests/blackbox/test_profile.py +54 -55
  87. {zen_cli-0.1.6 → zen_cli-0.1.8}/tests/blackbox/test_provider.py +10 -11
  88. {zen_cli-0.1.6 → zen_cli-0.1.8}/tests/blackbox/test_root.py +13 -14
  89. {zen_cli-0.1.6 → zen_cli-0.1.8}/tests/blackbox/test_sag.py +10 -11
  90. {zen_cli-0.1.6 → zen_cli-0.1.8}/tests/blackbox/test_task.py +7 -8
  91. {zen_cli-0.1.6 → zen_cli-0.1.8}/tests/blackbox/test_vm.py +7 -8
  92. zen_cli-0.1.8/tests/test_auth_status.py +88 -0
  93. {zen_cli-0.1.6 → zen_cli-0.1.8}/tests/test_cli.py +105 -9
  94. {zen_cli-0.1.6 → zen_cli-0.1.8}/tests/test_mcp.py +3 -0
  95. zen_cli-0.1.8/tests/test_recent.py +124 -0
  96. zen_cli-0.1.6/README.md +0 -66
  97. zen_cli-0.1.6/src/zen_cli/__init__.py +0 -5
  98. zen_cli-0.1.6/src/zen_cli/cmds/completion.py +0 -29
  99. zen_cli-0.1.6/src/zen_cli/cmds/deployment/list.py +0 -27
  100. zen_cli-0.1.6/src/zen_cli/cmds/org/list.py +0 -33
  101. zen_cli-0.1.6/src/zen_cli/cmds/task/duplicate.py +0 -75
  102. zen_cli-0.1.6/src/zen_cli/cmds/upgrade.py +0 -13
  103. zen_cli-0.1.6/src/zen_cli/sglib/__init__.py +0 -3
  104. zen_cli-0.1.6/src/zen_cli/sglib/payload_util.py +0 -29
  105. zen_cli-0.1.6/src/zen_cli/support/vm.py +0 -8
  106. zen_cli-0.1.6/src/zen_cli/util/param_util.py +0 -39
  107. zen_cli-0.1.6/src/zen_cli/util/patch_util.py +0 -38
  108. zen_cli-0.1.6/tests/blackbox/test_io.py +0 -88
  109. zen_cli-0.1.6/tests/test_auth_status.py +0 -26
  110. {zen_cli-0.1.6 → zen_cli-0.1.8}/.gitignore +0 -0
  111. {zen_cli-0.1.6 → zen_cli-0.1.8}/LICENSE +0 -0
  112. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/__main__.py +0 -0
  113. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/activity/__init__.py +0 -0
  114. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/activity/get.py +0 -0
  115. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/auth/__init__.py +0 -0
  116. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/auth/refresh.py +0 -0
  117. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/credential/__init__.py +0 -0
  118. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/credential/delete.py +0 -0
  119. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/credential/get.py +0 -0
  120. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/credential/list.py +0 -0
  121. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/deployment/__init__.py +0 -0
  122. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/deployment/delete.py +0 -0
  123. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/deployment/get.py +0 -0
  124. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/entitlement/__init__.py +0 -0
  125. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/entitlement/delete.py +0 -0
  126. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/entitlement/get.py +0 -0
  127. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/entitlement/list.py +0 -0
  128. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/group/__init__.py +0 -0
  129. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/group/delete.py +0 -0
  130. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/group/get.py +0 -0
  131. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/group/list.py +0 -0
  132. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/logout.py +0 -0
  133. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/network/__init__.py +0 -0
  134. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/network/delete.py +0 -0
  135. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/network/get.py +0 -0
  136. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/notification/__init__.py +0 -0
  137. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/notification/get.py +0 -0
  138. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/org/__init__.py +0 -0
  139. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/org/get.py +0 -0
  140. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/org/use.py +0 -0
  141. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/pool/__init__.py +0 -0
  142. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/pool/delete.py +0 -0
  143. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/pool/get.py +0 -0
  144. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/pool/use.py +0 -0
  145. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/profile/__init__.py +0 -0
  146. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/profile/init.py +0 -0
  147. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/provider/__init__.py +0 -0
  148. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/provider/delete.py +0 -0
  149. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/provider/get.py +0 -0
  150. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/provider/list.py +0 -0
  151. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/sag/__init__.py +0 -0
  152. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/sag/delete.py +0 -0
  153. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/sag/get.py +0 -0
  154. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/sag/list.py +0 -0
  155. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/task/__init__.py +0 -0
  156. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/task/cancel.py +0 -0
  157. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/task/namespaces.py +0 -0
  158. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/task/use.py +0 -0
  159. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/task/wait.py +0 -0
  160. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/vm/__init__.py +0 -0
  161. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/vm/poweroff.py +0 -0
  162. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/vm/poweron.py +0 -0
  163. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/vm/restart.py +0 -0
  164. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/vm/shutdown.py +0 -0
  165. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/cmds/vm/use.py +0 -0
  166. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/config/default.yaml +0 -0
  167. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/config/int.yaml +0 -0
  168. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/config/prod.yaml +0 -0
  169. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/config/stg.yaml +0 -0
  170. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/ctxp/_init.py +0 -0
  171. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/ctxp/built_in_cmds/__init__.py +0 -0
  172. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/ctxp/built_in_cmds/context.py +0 -0
  173. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/ctxp/cmd_util.py +0 -0
  174. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/ctxp/config.py +0 -0
  175. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/ctxp/context.py +0 -0
  176. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/ctxp/data_util.py +0 -0
  177. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/ctxp/dispatcher.py +0 -0
  178. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/ctxp/extension.py +0 -0
  179. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/ctxp/fn_util.py +0 -0
  180. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/ctxp/fstore.py +0 -0
  181. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/ctxp/jsondot.py +0 -0
  182. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/ctxp/profile_store.py +0 -0
  183. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/ctxp/state.py +0 -0
  184. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/ctxp/template_util.py +0 -0
  185. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/ctxp/timeutil.py +0 -0
  186. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/ctxp/var_template.py +0 -0
  187. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/mcp/__init__.py +0 -0
  188. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/mcp/_util.py +0 -0
  189. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/mcp/resources/__init__.py +0 -0
  190. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/mcp/resources/activity.py +0 -0
  191. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/mcp/resources/api.py +0 -0
  192. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/mcp/resources/credential.py +0 -0
  193. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/mcp/resources/deployment.py +0 -0
  194. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/mcp/resources/entitlement.py +0 -0
  195. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/mcp/resources/group.py +0 -0
  196. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/mcp/resources/network.py +0 -0
  197. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/mcp/resources/notification.py +0 -0
  198. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/mcp/resources/org.py +0 -0
  199. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/mcp/resources/pool.py +0 -0
  200. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/mcp/resources/provider.py +0 -0
  201. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/mcp/resources/sag.py +0 -0
  202. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/mcp/resources/task.py +0 -0
  203. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/mcp/resources/vm.py +0 -0
  204. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/mcp/server.py +0 -0
  205. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/service/__init__.py +0 -0
  206. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/service/activity.py +0 -0
  207. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/service/api.py +0 -0
  208. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/service/broker/__init__.py +0 -0
  209. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/service/broker/entitlement.py +0 -0
  210. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/service/broker/pool_group.py +0 -0
  211. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/service/cockpit/__init__.py +0 -0
  212. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/service/cockpit/network.py +0 -0
  213. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/service/cockpit/pool.py +0 -0
  214. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/service/cockpit/provider.py +0 -0
  215. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/service/cockpit/sag.py +0 -0
  216. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/service/cockpit/vm.py +0 -0
  217. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/service/credential.py +0 -0
  218. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/service/deployment.py +0 -0
  219. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/service/notification.py +0 -0
  220. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/service/org.py +0 -0
  221. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/sglib/client_util.py +0 -0
  222. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/sglib/init.py +0 -0
  223. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/sglib/mdc.py +0 -0
  224. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/sglib/utils.py +0 -0
  225. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/sglib/zds_client.py +0 -0
  226. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/support/payload.py +0 -0
  227. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/support/profile.py +0 -0
  228. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/support/use_util.py +0 -0
  229. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/util/exit.py +0 -0
  230. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/util/query_util.py +0 -0
  231. {zen_cli-0.1.6 → zen_cli-0.1.8}/src/zen_cli/util/readonly.py +0 -0
  232. {zen_cli-0.1.6 → zen_cli-0.1.8}/tests/blackbox/__init__.py +0 -0
  233. {zen_cli-0.1.6 → zen_cli-0.1.8}/tests/blackbox/util.py +0 -0
  234. {zen_cli-0.1.6 → zen_cli-0.1.8}/tests/test_device_login.py +0 -0
  235. {zen_cli-0.1.6 → zen_cli-0.1.8}/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.8
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
@@ -18,6 +18,7 @@ Requires-Dist: pyjwt
18
18
  Requires-Dist: python-dotenv
19
19
  Requires-Dist: pyyaml
20
20
  Requires-Dist: questionary
21
+ Requires-Dist: rich-click>=1.8
21
22
  Requires-Dist: tabulate
22
23
  Requires-Dist: yumako
23
24
  Provides-Extra: dev
@@ -34,43 +35,51 @@ Description-Content-Type: text/markdown
34
35
 
35
36
  [![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
37
 
37
- Command-line toolbox for Zen Cloud PC, designed for AI and human.
38
+ 面向 AI 和人的 Zen Cloud 命令行工具。
38
39
 
39
- ## Contents
40
+ ## 目录
40
41
 
41
- - [Try it out](#try-it-out)
42
- - [Prerequisites](#prerequisites)
43
- - [Installation](#installation)
44
- - [Mac & Linux](#mac--linux)
42
+ - [试用](#试用)
43
+ - [前置条件](#前置条件)
44
+ - [安装](#安装)
45
+ - [Mac 与 Linux](#mac-与-linux)
45
46
  - [Windows](#windows)
46
- - [Use the CLI](#use-the-cli)
47
- - [Documentation](#documentation)
48
- - [License](#license)
47
+ - [使用 CLI](#使用-cli)
48
+ - [文档](#文档)
49
+ - [许可证](#许可证)
49
50
 
50
- ## Try it out
51
+ ## 试用
51
52
 
52
- ### Prerequisites
53
+ ### 前置条件
53
54
 
54
- * Python 3.12 or newer
55
- * Pip
55
+ * Python 3.12 或更新版本
56
+ * [uv](https://docs.astral.sh/uv/) 或 [pipx](https://pipx.pypa.io/)
56
57
 
57
- ### Installation
58
+ ### 安装
58
59
 
59
- #### Mac & Linux
60
+ ```text
61
+ uv tool install zen-cli
62
+ ```
63
+
64
+ 或:
60
65
 
61
66
  ```text
62
- pip install zen-cli
67
+ pipx install zen-cli
63
68
  ```
64
69
 
65
- #### Windows
70
+ 装完后若找不到 `zen`,跑 `uv tool update-shell` 或 `pipx ensurepath`,然后开一个新终端。Windows 同样适用。
71
+
72
+ 升级:
66
73
 
67
74
  ```text
68
- pip install zen-cli
75
+ zen upgrade
76
+ uv tool upgrade zen-cli
77
+ pipx upgrade zen-cli
69
78
  ```
70
79
 
71
- If Python was installed without “Add python to PATH”, add Python and its `Scripts` directory to PATH.
80
+ `zen upgrade` 会按当前是 uv、pipx 还是普通环境选择对应方式。
72
81
 
73
- ### Use the CLI
82
+ ### 使用 CLI
74
83
 
75
84
  ```text
76
85
  zen login
@@ -79,20 +88,22 @@ zen auth details
79
88
  zen auth token
80
89
  ```
81
90
 
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
91
 
84
- Run a command, for example, list pools:
92
+ 跑一条命令,例如列出桌面池:
85
93
 
86
94
  ```text
87
95
  zen pool list
88
96
  ```
89
97
 
90
- ## Documentation
98
+ ## 文档
91
99
 
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
100
+ * [用户指南](docs/user-guide.md) — profile、旗标、请求体和命令约定
101
+ * [环境变量](docs/env.md) — `zen` 读取的环境变量
102
+ * [速查](docs/cheatsheet.md) — 命令示例
103
+ * [CLI 通用原则](docs/cli-principles.md) — 退出码、输出格式、通用参数和特例
104
+ * [开发指南](docs/dev-guide.md) — 环境、`dev.py`、Jenkins 和如何加命令
105
+ * [编码原则](docs/coding-principles.md) — 包划分和导入方向
95
106
 
96
- ## License
107
+ ## 许可证
97
108
 
98
- Licensed under the MIT License. See [LICENSE](LICENSE).
109
+ 采用 MIT License。见 [LICENSE](LICENSE)。
@@ -0,0 +1,76 @@
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
+ * [uv](https://docs.astral.sh/uv/) 或 [pipx](https://pipx.pypa.io/)
24
+
25
+ ### 安装
26
+
27
+ ```text
28
+ uv tool install zen-cli
29
+ ```
30
+
31
+ 或:
32
+
33
+ ```text
34
+ pipx install zen-cli
35
+ ```
36
+
37
+ 装完后若找不到 `zen`,跑 `uv tool update-shell` 或 `pipx ensurepath`,然后开一个新终端。Windows 同样适用。
38
+
39
+ 升级:
40
+
41
+ ```text
42
+ zen upgrade
43
+ uv tool upgrade zen-cli
44
+ pipx upgrade zen-cli
45
+ ```
46
+
47
+ `zen upgrade` 会按当前是 uv、pipx 还是普通环境选择对应方式。
48
+
49
+ ### 使用 CLI
50
+
51
+ ```text
52
+ zen login
53
+ zen auth status
54
+ zen auth details
55
+ zen auth token
56
+ ```
57
+
58
+
59
+ 跑一条命令,例如列出桌面池:
60
+
61
+ ```text
62
+ zen pool list
63
+ ```
64
+
65
+ ## 文档
66
+
67
+ * [用户指南](docs/user-guide.md) — profile、旗标、请求体和命令约定
68
+ * [环境变量](docs/env.md) — `zen` 读取的环境变量
69
+ * [速查](docs/cheatsheet.md) — 命令示例
70
+ * [CLI 通用原则](docs/cli-principles.md) — 退出码、输出格式、通用参数和特例
71
+ * [开发指南](docs/dev-guide.md) — 环境、`dev.py`、Jenkins 和如何加命令
72
+ * [编码原则](docs/coding-principles.md) — 包划分和导入方向
73
+
74
+ ## 许可证
75
+
76
+ 采用 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.8"
8
8
  description = "CLI for Zen Desktop Service. Designed for AI and Human."
9
9
  readme = "README.md"
10
10
  license = "MIT"
@@ -14,6 +14,7 @@ authors = [{ name = "zen-cli authors" }]
14
14
  dependencies = [
15
15
  "authlib",
16
16
  "click>=8.1",
17
+ "rich-click>=1.8",
17
18
  "coloredlogs",
18
19
  "httpx2",
19
20
  "mcp>=2",
@@ -44,7 +45,7 @@ include = ["src/zen_cli", "tests", "README.md", "LICENSE"]
44
45
  target-version = "py312"
45
46
  line-length = 120
46
47
  src = ["src"]
47
- exclude = ["cli-ref", "src/zen_cli/support/test_utils2.py"]
48
+ exclude = ["cli-ref"]
48
49
 
49
50
  [tool.ruff.lint]
50
51
  select = ["E", "F", "I", "UP", "B", "SIM", "RUF"]
@@ -53,7 +54,6 @@ select = ["E", "F", "I", "UP", "B", "SIM", "RUF"]
53
54
  python_version = "3.12"
54
55
  strict = true
55
56
  files = ["src"]
56
- exclude = ["test_utils2\\.py"]
57
57
 
58
58
  [[tool.mypy.overrides]]
59
59
  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
@@ -4,7 +4,7 @@ import sys
4
4
  from pathlib import Path
5
5
  from typing import Any
6
6
 
7
- import click
7
+ import rich_click as click
8
8
  from dotenv import load_dotenv
9
9
  from yumako import env
10
10
 
@@ -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,9 @@ 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
177
+ CONTEXT_SETTINGS["rich_help_config"] = {"color_system": None, "force_terminal": False}
174
178
  if os.environ.get("_ZEN_COMPLETE"):
175
179
  ctxp.telemetry.disable()
176
180
  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
 
@@ -50,21 +48,19 @@ def _build_headers(header: list[str], content_type: str | None) -> dict[str, str
50
48
  "--mdc",
51
49
  type=str,
52
50
  required=False,
53
- help="MDC name to use. Only valid when the service is a global service.",
51
+ help="MDC name.",
54
52
  )
55
53
  @click.option(
56
54
  "--region",
57
55
  type=str,
58
56
  required=False,
59
- help="Regional name to use. Only valid when the service is a regional service.",
57
+ help="Region name.",
60
58
  )
61
59
  @click.option(
62
60
  "--raise-on-404",
63
61
  is_flag=True,
64
62
  default=False,
65
- help=(
66
- "Raise an error on HTTP 404 responses. If not set, returns None on 404. Only valid for GET and DELETE methods."
67
- ),
63
+ help="Raise on HTTP 404.",
68
64
  )
69
65
  @click.option(
70
66
  "--all-pages",
@@ -108,6 +104,9 @@ def api(
108
104
  if raise_on_404 and method not in ("GET", "DELETE"):
109
105
  raise click.UsageError("The --raise-on-404 option is only applicable for GET and DELETE methods.")
110
106
 
107
+ from zen_cli.service import api as zen_api
108
+ from zen_cli.sglib.client_util import resolve_zds_base_url
109
+
111
110
  raw_data, json_data = handle_data_input(data_arg, json_arg)
112
111
 
113
112
  if method in ["GET", "DELETE"] and (raw_data is not None or json_data is not None):
@@ -11,7 +11,7 @@ from zen_cli.support import auth as auth_support
11
11
  "--service",
12
12
  "-s",
13
13
  required=False,
14
- help="Get the auth details for a target service. Useful if per-service auth override is configured.",
14
+ help="Target service.",
15
15
  )
16
16
  def details(service: str | None) -> Any:
17
17
  """Show cached token, JWT claims, and org."""
@@ -10,8 +10,8 @@ from zen_cli.support import auth as auth_support
10
10
  "--service",
11
11
  "-s",
12
12
  required=False,
13
- help="Report login status for a target service override.",
13
+ help="Target service.",
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)
@@ -10,7 +10,7 @@ from zen_cli.support import auth as auth_support
10
10
  "--service",
11
11
  "-s",
12
12
  required=False,
13
- help="Get the access token for a target service. Useful if per-service auth override is configured.",
13
+ help="Target service.",
14
14
  )
15
15
  def token(service: str | None) -> Any:
16
16
  """Print the current access token."""
@@ -0,0 +1,44 @@
1
+ import click
2
+ from click.shell_completion import get_completion_class
3
+
4
+ _SHELLS = ("bash", "zsh", "fish", "powershell")
5
+
6
+
7
+ @click.command()
8
+ @click.argument("shell", type=click.Choice(_SHELLS, case_sensitive=False), metavar="SHELL")
9
+ def completion(shell: str) -> None:
10
+ """Print a shell completion script for tab-completing zen.
11
+
12
+ After the script is loaded, type `zen` and press Tab to complete commands,
13
+ groups, and flags. Examples: `zen <Tab>`, `zen org <Tab>`, `zen --<Tab>`.
14
+
15
+ \b
16
+ Enable for this session:
17
+ bash: eval "$(zen completion bash)"
18
+ zsh: eval "$(zen completion zsh)"
19
+ fish: zen completion fish | source
20
+ powershell: zen completion powershell | Out-String | Invoke-Expression
21
+
22
+ \b
23
+ Make it permanent (open a new terminal afterward):
24
+ bash: echo 'eval "$(zen completion bash)"' >> ~/.bashrc
25
+ zsh: echo 'eval "$(zen completion zsh)"' >> ~/.zshrc
26
+ fish: mkdir -p ~/.config/fish/completions
27
+ zen completion fish > ~/.config/fish/completions/zen.fish
28
+ powershell: Add the Invoke-Expression line to your $PROFILE
29
+ (create it with `New-Item -Force $PROFILE` if missing)
30
+
31
+ bash needs the bash-completion package. zsh needs `compinit` in ~/.zshrc
32
+ (oh-my-zsh and most configs already have it).
33
+ """
34
+ ctx = click.get_current_context().find_root()
35
+ prog_name = ctx.info_name or "zen"
36
+ complete_var = f"_{prog_name.replace('-', '_').upper()}_COMPLETE"
37
+ cls = get_completion_class(shell)
38
+ if cls is None:
39
+ raise click.UsageError(f"Unsupported shell: {shell}")
40
+ script = cls(ctx.command, {}, prog_name, complete_var).source()
41
+ click.echo(script, nl=not script.endswith("\n"))
42
+
43
+
44
+ completion.ignore_default_io = True # type: ignore[attr-defined]
@@ -9,5 +9,5 @@ from zen_cli.support.payload import payload_options, run_create
9
9
  @click.command()
10
10
  @payload_options
11
11
  def create(data_arg: str | None, json_arg: str | None) -> Any:
12
- """Create a credential from a JSON payload."""
12
+ """Create a credential."""
13
13
  return run_create("credential", credential.create, data_arg, json_arg)
@@ -11,7 +11,7 @@ from zen_cli.support.payload import payload_options, run_create
11
11
  @cli.org_id
12
12
  @payload_options
13
13
  def create(org: str, data_arg: str | None, json_arg: str | None) -> Any:
14
- """Create an express deployment from a JSON payload."""
14
+ """Create an express deployment."""
15
15
 
16
16
  def _create(payload: Any) -> Any:
17
17
  return deployment.create(payload, org_id=cli.get_org_id(org))
@@ -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
@@ -9,5 +9,5 @@ from zen_cli.support.payload import payload_options, run_create
9
9
  @click.command()
10
10
  @payload_options
11
11
  def create(data_arg: str | None, json_arg: str | None) -> Any:
12
- """Create an entitlement from a JSON payload."""
12
+ """Create an entitlement."""
13
13
  return run_create("entitlement", entitlement.create, data_arg, json_arg)
@@ -9,5 +9,5 @@ from zen_cli.support.payload import payload_options, run_create
9
9
  @click.command()
10
10
  @payload_options
11
11
  def create(data_arg: str | None, json_arg: str | None) -> Any:
12
- """Create a pool group from a JSON payload."""
12
+ """Create a pool group."""
13
13
  return run_create("group", pool_group.create, data_arg, json_arg)