zen-cli 0.1.7__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.
- {zen_cli-0.1.7 → zen_cli-0.1.8}/PKG-INFO +16 -7
- {zen_cli-0.1.7 → zen_cli-0.1.8}/README.md +14 -6
- {zen_cli-0.1.7 → zen_cli-0.1.8}/pyproject.toml +2 -1
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cli.py +2 -1
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/api.py +3 -5
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/auth/details.py +1 -1
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/auth/status.py +1 -1
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/auth/token.py +1 -1
- zen_cli-0.1.8/src/zen_cli/cmds/completion.py +44 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/credential/create.py +1 -1
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/deployment/create.py +1 -1
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/entitlement/create.py +1 -1
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/group/create.py +1 -1
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/login.py +10 -16
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/mcp.py +7 -3
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/network/create.py +1 -1
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/org/create.py +1 -1
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/pool/create.py +1 -1
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/provider/create.py +1 -1
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/sag/create.py +1 -1
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/task/delete.py +1 -4
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/task/get.py +1 -1
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/task/log.py +2 -5
- zen_cli-0.1.8/src/zen_cli/cmds/upgrade.py +68 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/vm/wait.py +1 -3
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/ctxp/__init__.py +1 -0
- zen_cli-0.1.8/src/zen_cli/ctxp/_patch_click.py +5 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/ctxp/cli_processor.py +102 -22
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/blackbox/test_io.py +7 -15
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/test_cli.py +97 -5
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/test_mcp.py +3 -0
- zen_cli-0.1.7/src/zen_cli/cmds/completion.py +0 -32
- zen_cli-0.1.7/src/zen_cli/cmds/upgrade.py +0 -16
- {zen_cli-0.1.7 → zen_cli-0.1.8}/.gitignore +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/LICENSE +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/__init__.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/__main__.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/activity/__init__.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/activity/get.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/activity/list.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/auth/__init__.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/auth/refresh.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/credential/__init__.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/credential/delete.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/credential/get.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/credential/list.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/deployment/__init__.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/deployment/delete.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/deployment/get.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/deployment/list.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/entitlement/__init__.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/entitlement/delete.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/entitlement/get.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/entitlement/list.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/group/__init__.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/group/delete.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/group/get.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/group/list.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/logout.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/network/__init__.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/network/delete.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/network/get.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/network/list.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/notification/__init__.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/notification/get.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/notification/list.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/org/__init__.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/org/get.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/org/list.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/org/use.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/pool/__init__.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/pool/delete.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/pool/get.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/pool/list.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/pool/use.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/profile/__init__.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/profile/init.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/provider/__init__.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/provider/delete.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/provider/get.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/provider/list.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/sag/__init__.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/sag/delete.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/sag/get.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/sag/list.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/task/__init__.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/task/cancel.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/task/duplicate.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/task/list.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/task/namespaces.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/task/use.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/task/wait.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/vm/__init__.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/vm/delete.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/vm/get.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/vm/list.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/vm/poweroff.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/vm/poweron.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/vm/restart.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/vm/shutdown.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/cmds/vm/use.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/config/default.yaml +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/config/int.yaml +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/config/prod.yaml +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/config/stg.yaml +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/ctxp/_init.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/ctxp/built_in_cmds/__init__.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/ctxp/built_in_cmds/_ut.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/ctxp/built_in_cmds/context.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/ctxp/built_in_cmds/profile.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/ctxp/cli_options.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/ctxp/cmd_util.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/ctxp/config.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/ctxp/context.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/ctxp/data_util.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/ctxp/dispatcher.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/ctxp/extension.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/ctxp/fn_util.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/ctxp/fstore.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/ctxp/jsondot.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/ctxp/logger.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/ctxp/profile.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/ctxp/profile_store.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/ctxp/recent.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/ctxp/state.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/ctxp/telemetry.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/ctxp/template_util.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/ctxp/timeutil.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/ctxp/util.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/ctxp/var_template.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/mcp/__init__.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/mcp/_util.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/mcp/resources/__init__.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/mcp/resources/activity.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/mcp/resources/api.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/mcp/resources/credential.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/mcp/resources/deployment.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/mcp/resources/entitlement.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/mcp/resources/group.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/mcp/resources/network.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/mcp/resources/notification.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/mcp/resources/org.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/mcp/resources/pool.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/mcp/resources/provider.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/mcp/resources/sag.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/mcp/resources/task.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/mcp/resources/vm.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/mcp/server.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/service/__init__.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/service/activity.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/service/api.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/service/broker/__init__.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/service/broker/entitlement.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/service/broker/pool_group.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/service/cockpit/__init__.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/service/cockpit/network.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/service/cockpit/pool.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/service/cockpit/provider.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/service/cockpit/sag.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/service/cockpit/vm.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/service/credential.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/service/deployment.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/service/notification.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/service/org.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/service/task.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/sglib/__init__.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/sglib/auth.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/sglib/cli_options.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/sglib/client_util.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/sglib/csp.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/sglib/ez_client.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/sglib/init.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/sglib/login_support.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/sglib/mdc.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/sglib/requtil.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/sglib/utils.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/sglib/zds_client.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/support/activity.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/support/auth.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/support/deployment.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/support/network.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/support/notification.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/support/org.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/support/payload.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/support/pool.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/support/profile.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/support/recent.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/support/task.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/support/use_util.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/support/vm.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/util/exec_util.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/util/exit.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/util/query_util.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/util/readonly.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/src/zen_cli/util/versions.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/blackbox/__init__.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/blackbox/cli_test.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/blackbox/test_api.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/blackbox/test_auth.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/blackbox/test_completion.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/blackbox/test_context.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/blackbox/test_credential.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/blackbox/test_deployment.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/blackbox/test_entitlement.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/blackbox/test_errors.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/blackbox/test_group.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/blackbox/test_login.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/blackbox/test_logout.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/blackbox/test_mcp.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/blackbox/test_network.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/blackbox/test_org.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/blackbox/test_pool.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/blackbox/test_profile.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/blackbox/test_provider.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/blackbox/test_root.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/blackbox/test_sag.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/blackbox/test_task.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/blackbox/test_vm.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/blackbox/util.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/test_auth_status.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/test_device_login.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/test_payload.py +0 -0
- {zen_cli-0.1.7 → zen_cli-0.1.8}/tests/test_recent.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: zen-cli
|
|
3
|
-
Version: 0.1.
|
|
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
|
|
@@ -52,23 +53,31 @@ Description-Content-Type: text/markdown
|
|
|
52
53
|
### 前置条件
|
|
53
54
|
|
|
54
55
|
* Python 3.12 或更新版本
|
|
55
|
-
*
|
|
56
|
+
* [uv](https://docs.astral.sh/uv/) 或 [pipx](https://pipx.pypa.io/)
|
|
56
57
|
|
|
57
58
|
### 安装
|
|
58
59
|
|
|
59
|
-
|
|
60
|
+
```text
|
|
61
|
+
uv tool install zen-cli
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
或:
|
|
60
65
|
|
|
61
66
|
```text
|
|
62
|
-
|
|
67
|
+
pipx install zen-cli
|
|
63
68
|
```
|
|
64
69
|
|
|
65
|
-
|
|
70
|
+
装完后若找不到 `zen`,跑 `uv tool update-shell` 或 `pipx ensurepath`,然后开一个新终端。Windows 同样适用。
|
|
71
|
+
|
|
72
|
+
升级:
|
|
66
73
|
|
|
67
74
|
```text
|
|
68
|
-
|
|
75
|
+
zen upgrade
|
|
76
|
+
uv tool upgrade zen-cli
|
|
77
|
+
pipx upgrade zen-cli
|
|
69
78
|
```
|
|
70
79
|
|
|
71
|
-
|
|
80
|
+
`zen upgrade` 会按当前是 uv、pipx 还是普通环境选择对应方式。
|
|
72
81
|
|
|
73
82
|
### 使用 CLI
|
|
74
83
|
|
|
@@ -20,23 +20,31 @@
|
|
|
20
20
|
### 前置条件
|
|
21
21
|
|
|
22
22
|
* Python 3.12 或更新版本
|
|
23
|
-
*
|
|
23
|
+
* [uv](https://docs.astral.sh/uv/) 或 [pipx](https://pipx.pypa.io/)
|
|
24
24
|
|
|
25
25
|
### 安装
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
```text
|
|
28
|
+
uv tool install zen-cli
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
或:
|
|
28
32
|
|
|
29
33
|
```text
|
|
30
|
-
|
|
34
|
+
pipx install zen-cli
|
|
31
35
|
```
|
|
32
36
|
|
|
33
|
-
|
|
37
|
+
装完后若找不到 `zen`,跑 `uv tool update-shell` 或 `pipx ensurepath`,然后开一个新终端。Windows 同样适用。
|
|
38
|
+
|
|
39
|
+
升级:
|
|
34
40
|
|
|
35
41
|
```text
|
|
36
|
-
|
|
42
|
+
zen upgrade
|
|
43
|
+
uv tool upgrade zen-cli
|
|
44
|
+
pipx upgrade zen-cli
|
|
37
45
|
```
|
|
38
46
|
|
|
39
|
-
|
|
47
|
+
`zen upgrade` 会按当前是 uv、pipx 还是普通环境选择对应方式。
|
|
40
48
|
|
|
41
49
|
### 使用 CLI
|
|
42
50
|
|
|
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
|
|
4
4
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "zen-cli"
|
|
7
|
-
version = "0.1.
|
|
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",
|
|
@@ -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
|
|
|
@@ -174,6 +174,7 @@ def main() -> None:
|
|
|
174
174
|
load_dotenv(".env")
|
|
175
175
|
if not logger.color_enabled():
|
|
176
176
|
CONTEXT_SETTINGS["color"] = False
|
|
177
|
+
CONTEXT_SETTINGS["rich_help_config"] = {"color_system": None, "force_terminal": False}
|
|
177
178
|
if os.environ.get("_ZEN_COMPLETE"):
|
|
178
179
|
ctxp.telemetry.disable()
|
|
179
180
|
ctxp.init_cli(main_cli=cli, commands_dir=str(_COMMANDS_DIR))
|
|
@@ -48,21 +48,19 @@ def _build_headers(header: list[str], content_type: str | None) -> dict[str, str
|
|
|
48
48
|
"--mdc",
|
|
49
49
|
type=str,
|
|
50
50
|
required=False,
|
|
51
|
-
help="MDC name
|
|
51
|
+
help="MDC name.",
|
|
52
52
|
)
|
|
53
53
|
@click.option(
|
|
54
54
|
"--region",
|
|
55
55
|
type=str,
|
|
56
56
|
required=False,
|
|
57
|
-
help="
|
|
57
|
+
help="Region name.",
|
|
58
58
|
)
|
|
59
59
|
@click.option(
|
|
60
60
|
"--raise-on-404",
|
|
61
61
|
is_flag=True,
|
|
62
62
|
default=False,
|
|
63
|
-
help=
|
|
64
|
-
"Raise an error on HTTP 404 responses. If not set, returns None on 404. Only valid for GET and DELETE methods."
|
|
65
|
-
),
|
|
63
|
+
help="Raise on HTTP 404.",
|
|
66
64
|
)
|
|
67
65
|
@click.option(
|
|
68
66
|
"--all-pages",
|
|
@@ -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="
|
|
14
|
+
help="Target service.",
|
|
15
15
|
)
|
|
16
16
|
def details(service: str | None) -> Any:
|
|
17
17
|
"""Show cached token, JWT claims, and org."""
|
|
@@ -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="
|
|
13
|
+
help="Target service.",
|
|
14
14
|
)
|
|
15
15
|
def status(service: str | None) -> Any:
|
|
16
16
|
"""Show whether you are logged in, TTL, and main JWT identity (name, acct, org, roles)."""
|
|
@@ -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="
|
|
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
|
|
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
|
|
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))
|
|
@@ -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
|
|
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
|
|
12
|
+
"""Create a pool group."""
|
|
13
13
|
return run_create("group", pool_group.create, data_arg, json_arg)
|
|
@@ -37,7 +37,7 @@ from zen_cli.support import profile as profile_support
|
|
|
37
37
|
"--org",
|
|
38
38
|
type=str,
|
|
39
39
|
required=False,
|
|
40
|
-
help="
|
|
40
|
+
help="CSP organization to login.",
|
|
41
41
|
)
|
|
42
42
|
@click.option("--api-token", type=str, required=False, help="Login with a user CSP API token.")
|
|
43
43
|
@click.option("--client-id", type=str, required=False, help="Login with OAuth client ID/secret.")
|
|
@@ -49,27 +49,27 @@ from zen_cli.support import profile as profile_support
|
|
|
49
49
|
"--browser",
|
|
50
50
|
is_flag=True,
|
|
51
51
|
default=False,
|
|
52
|
-
help="Login with browser SSO.
|
|
52
|
+
help="Login with browser SSO.",
|
|
53
53
|
)
|
|
54
54
|
@click.option(
|
|
55
55
|
"--device-code",
|
|
56
56
|
is_flag=True,
|
|
57
57
|
default=False,
|
|
58
|
-
help="Login with OAuth device code
|
|
58
|
+
help="Login with OAuth device code.",
|
|
59
59
|
)
|
|
60
60
|
@click.option(
|
|
61
61
|
"--refresh",
|
|
62
62
|
"-r",
|
|
63
63
|
default=False,
|
|
64
64
|
is_flag=True,
|
|
65
|
-
help="
|
|
65
|
+
help="Force-refresh the cached access token.",
|
|
66
66
|
)
|
|
67
67
|
@click.option(
|
|
68
68
|
"--verbose",
|
|
69
69
|
"-v",
|
|
70
70
|
is_flag=True,
|
|
71
71
|
default=False,
|
|
72
|
-
help="
|
|
72
|
+
help="Print verbose output.",
|
|
73
73
|
)
|
|
74
74
|
def login(
|
|
75
75
|
org: str | None,
|
|
@@ -87,22 +87,16 @@ def login(
|
|
|
87
87
|
) -> Any:
|
|
88
88
|
"""Login Zen Desktop Service.
|
|
89
89
|
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
Updates the current profile. With no method flag, reuses cache or configured
|
|
91
|
+
credentials; otherwise starts device-code login.
|
|
92
92
|
|
|
93
|
-
|
|
94
|
-
If neither is available, starts device-code login. Browser SSO runs only
|
|
95
|
-
with `--browser`.
|
|
96
|
-
|
|
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`.
|
|
99
|
-
Per-service tokens: `zen auth details --service` / `zen auth token --service`.
|
|
93
|
+
On success, prints session status.
|
|
100
94
|
|
|
101
95
|
\b
|
|
102
96
|
Examples:
|
|
103
97
|
1. Re-login with cache, configured credentials, or device code:
|
|
104
98
|
zen login
|
|
105
|
-
2. Login with OAuth device code
|
|
99
|
+
2. Login with OAuth device code:
|
|
106
100
|
zen login --device-code
|
|
107
101
|
3. Login with OAuth client id/secret:
|
|
108
102
|
zen login --client-id <oauth-client-id> --client-secret <oauth-client-secret>
|
|
@@ -110,7 +104,7 @@ def login(
|
|
|
110
104
|
zen login --api-token <csp-org-scope-user-api-token>
|
|
111
105
|
5. Login with CSP HTTP basic auth token:
|
|
112
106
|
zen login --basic <csp-http-basic-auth-token>
|
|
113
|
-
6. Login with CSP OAuth2 access token
|
|
107
|
+
6. Login with CSP OAuth2 access token:
|
|
114
108
|
zen login --access-token <csp-access-token>
|
|
115
109
|
7. Login with CSP OAuth2 refresh token:
|
|
116
110
|
zen login --refresh-token <csp-refresh-token>
|
|
@@ -5,12 +5,16 @@ 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
|
-
|
|
11
8
|
Tools: api, plus get/list for org, activity, entitlement, group, provider,
|
|
12
9
|
sag, network, credential, deployment, notification, pool, vm, and task.
|
|
10
|
+
|
|
11
|
+
\b
|
|
12
|
+
Examples:
|
|
13
|
+
zen mcp
|
|
13
14
|
"""
|
|
14
15
|
from zen_cli.mcp import server as mcp_server
|
|
15
16
|
|
|
16
17
|
mcp_server.run()
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
mcp.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 network infrastructure deployment
|
|
12
|
+
"""Create a network infrastructure deployment."""
|
|
13
13
|
return run_create("network", network.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 org details
|
|
12
|
+
"""Create org details."""
|
|
13
13
|
return run_create("org", org_svc.create, data_arg, json_arg, id_field="orgId")
|
|
@@ -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
|
|
12
|
+
"""Create a pool."""
|
|
13
13
|
return run_create("pool", pool.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 provider instance
|
|
12
|
+
"""Create a provider instance."""
|
|
13
13
|
return run_create("provider", provider.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 SAG deployment
|
|
12
|
+
"""Create a SAG deployment."""
|
|
13
13
|
return run_create("sag", sag.create, data_arg, json_arg)
|
|
@@ -25,10 +25,7 @@ def delete(
|
|
|
25
25
|
confirm: bool,
|
|
26
26
|
**kwargs: Any,
|
|
27
27
|
) -> Any:
|
|
28
|
-
"""Delete a task.
|
|
29
|
-
|
|
30
|
-
Not implemented. Prints TODO on stderr and exits 1.
|
|
31
|
-
"""
|
|
28
|
+
"""Delete a task."""
|
|
32
29
|
namespace, group, key = parse_task_param(namespace, group, smart_path)
|
|
33
30
|
org_id = cli.get_org_id(org)
|
|
34
31
|
ret = task.get(org_id, namespace, group, key, **kwargs)
|
|
@@ -14,7 +14,7 @@ from zen_cli.support.task import parse_task_param
|
|
|
14
14
|
@click.option("--location", hidden=True, type=str, required=False, help="Task location.")
|
|
15
15
|
@click.argument("smart_path", type=str, required=False)
|
|
16
16
|
def get(org: str, namespace: str, group: str, location: str, smart_path: str, **kwargs: Any) -> Any:
|
|
17
|
-
"""Get a task.
|
|
17
|
+
"""Get a task. Path: [[<namespace>/]<group>/]<key>."""
|
|
18
18
|
namespace, group, key = parse_task_param(namespace, group, smart_path)
|
|
19
19
|
org_id = cli.get_org_id(org)
|
|
20
20
|
return task.get(org_id, namespace, group, key, location=location, **kwargs)
|
|
@@ -16,15 +16,12 @@ from zen_cli.support.task import (
|
|
|
16
16
|
@click.option("--namespace", "-n", type=str, required=False)
|
|
17
17
|
@click.option("--group", "-g", type=str, required=False)
|
|
18
18
|
@click.argument("smart_path", type=str, required=False)
|
|
19
|
-
@click.option("--last", is_flag=True, default=False, help="
|
|
19
|
+
@click.option("--last", is_flag=True, default=False, help="Return only the last log.")
|
|
20
20
|
@click.option(
|
|
21
21
|
"--state",
|
|
22
22
|
type=str,
|
|
23
23
|
required=False,
|
|
24
|
-
help=
|
|
25
|
-
"Filter tasks by state, for one-time tasks only. "
|
|
26
|
-
"Comma separated values. E.g. Init,Running,Canceled,Error,Success"
|
|
27
|
-
),
|
|
24
|
+
help="Filter by one-time task state. Comma-separated: Init,Running,Canceled,Error,Success",
|
|
28
25
|
)
|
|
29
26
|
@cli.search
|
|
30
27
|
@cli.limit
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import shutil
|
|
2
|
+
import subprocess
|
|
3
|
+
import sys
|
|
4
|
+
from pathlib import Path
|
|
5
|
+
|
|
6
|
+
import click
|
|
7
|
+
|
|
8
|
+
_PKG = "zen-cli"
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def _managed_by(prefix: Path | None = None) -> str | None:
|
|
12
|
+
root = Path(prefix or sys.prefix)
|
|
13
|
+
if (root / "uv-receipt.toml").is_file():
|
|
14
|
+
return "uv"
|
|
15
|
+
if (root / "pipx_metadata.json").is_file():
|
|
16
|
+
return "pipx"
|
|
17
|
+
parts = [part.lower() for part in root.parts]
|
|
18
|
+
if "pipx" in parts and "venvs" in parts:
|
|
19
|
+
return "pipx"
|
|
20
|
+
for i, part in enumerate(parts[:-1]):
|
|
21
|
+
if part == "uv" and parts[i + 1] == "tools":
|
|
22
|
+
return "uv"
|
|
23
|
+
return None
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
def _upgrade_cmd() -> list[str]:
|
|
27
|
+
manager = _managed_by()
|
|
28
|
+
if manager == "uv":
|
|
29
|
+
uv = shutil.which("uv")
|
|
30
|
+
if uv:
|
|
31
|
+
return [uv, "tool", "upgrade", _PKG]
|
|
32
|
+
elif manager == "pipx":
|
|
33
|
+
pipx = shutil.which("pipx")
|
|
34
|
+
if pipx:
|
|
35
|
+
return [pipx, "upgrade", _PKG]
|
|
36
|
+
return [
|
|
37
|
+
sys.executable,
|
|
38
|
+
"-m",
|
|
39
|
+
"pip",
|
|
40
|
+
"install",
|
|
41
|
+
"-U",
|
|
42
|
+
_PKG,
|
|
43
|
+
"--upgrade-strategy",
|
|
44
|
+
"eager",
|
|
45
|
+
"--no-cache-dir",
|
|
46
|
+
]
|
|
47
|
+
|
|
48
|
+
|
|
49
|
+
@click.command()
|
|
50
|
+
def upgrade() -> None:
|
|
51
|
+
"""Upgrade zen-cli from PyPI.
|
|
52
|
+
|
|
53
|
+
\b
|
|
54
|
+
Examples:
|
|
55
|
+
zen upgrade
|
|
56
|
+
"""
|
|
57
|
+
cmd = _upgrade_cmd()
|
|
58
|
+
p = subprocess.run(cmd, stdout=sys.stdout, stderr=sys.stderr, check=False)
|
|
59
|
+
if p.returncode:
|
|
60
|
+
if _managed_by() is None and sys.prefix == getattr(sys, "base_prefix", sys.prefix):
|
|
61
|
+
print(
|
|
62
|
+
"Install with: uv tool install zen-cli or pipx install zen-cli",
|
|
63
|
+
file=sys.stderr,
|
|
64
|
+
)
|
|
65
|
+
raise SystemExit(p.returncode)
|
|
66
|
+
|
|
67
|
+
|
|
68
|
+
upgrade.ignore_default_io = True # type: ignore[attr-defined]
|
|
@@ -22,7 +22,7 @@ from zen_cli.support.vm import vm_from_path
|
|
|
22
22
|
type=str,
|
|
23
23
|
required=False,
|
|
24
24
|
default="5m",
|
|
25
|
-
help="How long to wait
|
|
25
|
+
help="How long to wait. Examples: '2m', '30s', '1h30m'. Default: 5m.",
|
|
26
26
|
)
|
|
27
27
|
@click.option(
|
|
28
28
|
"--fail-fast/--fail-timeout",
|
|
@@ -35,8 +35,6 @@ from zen_cli.support.vm import vm_from_path
|
|
|
35
35
|
def wait(vm_path: str, org: str, property: str, timeout: str, fail_fast: bool, **kwargs: Any) -> Any:
|
|
36
36
|
"""Wait for a VM field.
|
|
37
37
|
|
|
38
|
-
Uses --timeout/-t (default 5m) instead of --wait.
|
|
39
|
-
|
|
40
38
|
\b
|
|
41
39
|
Examples:
|
|
42
40
|
zen vm wait -p agentStatus=AVAILABLE,ERROR --timeout 5m
|