"""项目详情 — inspect a project and its current asset. tripocli project """ NAME = "project" HELP = "查看项目详情(模型地址、预览图、operator 状态)" def add_arguments(parser): parser.add_argument("project_id", help="项目 ID") def run(ctx): detail = ctx.client.project_detail(ctx.args.project_id) or {} operator = detail.get("operator") or {} retargets = operator.get("retarget") or [] def show(): ctx.out.line(f"项目名 : {detail.get('project_name')}") ctx.out.line(f"项目 ID : {detail.get('id')}") ctx.out.line(f"operator : {operator.get('operator_id')} ({operator.get('status')})") ctx.out.line(f"模型版本 : {operator.get('model_version')}") ctx.out.line(f"模型地址 : {detail.get('model_url')}") if retargets: names = ", ".join(f"{r.get('name')}({r.get('status')})" for r in retargets) ctx.out.line(f"重定向动作 ({len(retargets)}): {names}") ctx.out.data(detail, human=show) return detail