contract-cli-contract
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesecontract-cli Contract
contract-cli Contract
CRITICAL — 开始前 MUST 先读取 ../contract-cli-shared/SKILL.md。
CRITICAL — 开始前 MUST 先读取 ../contract-cli-shared/SKILL.md。
适用命令
适用命令
contract-cli contract get <contract-id>contract-cli contract searchcontract-cli contract createcontract-cli contract sync-user-groupscontract-cli contract text <contract-id>contract-cli contract category listcontract-cli contract template listcontract-cli contract template get <template-id>contract-cli contract template instantiatecontract-cli contract upload-filecontract-cli contract enum list --type <enum_type>
contract-cli contract get <contract-id>contract-cli contract searchcontract-cli contract createcontract-cli contract sync-user-groupscontract-cli contract text <contract-id>contract-cli contract category listcontract-cli contract template listcontract-cli contract template get <template-id>contract-cli contract template instantiatecontract-cli contract upload-filecontract-cli contract enum list --type <enum_type>
快速决策
快速决策
- 想直接拿合同详情:用
contract get - 想按条件查合同列表:用
contract search - 想直接透传创建合同请求体:用
contract create - 想拿正文文本:用
contract text - 想看分类树:用
contract category list - 想看模板或创建模板实例:用
contract template ... - 想上传合同正文或附件文件:用
contract upload-file --as bot - 想查创建合同相关枚举:用
contract enum list - 若需求是审批、授权、付款:当前 skill 不覆盖,别伪造命令
- 想直接拿合同详情:用
contract get - 想按条件查合同列表:用
contract search - 想直接透传创建合同请求体:用
contract create - 想拿正文文本:用
contract text - 想看分类树:用
contract category list - 想看模板或创建模板实例:用
contract template ... - 想上传合同正文或附件文件:用
contract upload-file --as bot - 想查创建合同相关枚举:用
contract enum list - 若需求是审批、授权、付款:当前 skill 不覆盖,别伪造命令
关键规则
关键规则
- 、
contract get、contract search、contract create、contract sync-user-groups、contract text、contract category list、contract template list、contract template get同时支持contract template instantiate和--as user--as bot - 当前仅支持
contract upload-file--as bot - 除这九条双身份命令和 外,其余命令仍然只支持
contract upload-file--as user - 当前直接接收原始创建请求体,不额外暴露
contract create--template - 走
contract create --as botPOST /open-apis/contract/v1/contracts - 的请求体必须自己带
contract create --as botcreate_user_id - 的推荐阅读顺序是:
contract create- 先读 references/create-contract-fields.md 选场景和最小请求体
- 再读 references/create-contract-field-tree.md 查嵌套对象和 JSON Path
- 最后读 references/create-contract-enums.md 确认 code 取值
- 这三份文档一起构成 的完整参数主档,不需要再回查旧接口清单
contract create - 走开放平台标准接口
contract get --as bot/open-apis/contract/v1/contracts/{contract_id} - /
--user-id-type是通用 query 参数:--user-id- 不传时默认拼接
--user-id-typeuser_id_type=user_id - 显式传 时会覆盖默认值
--user-id-type <type> - 传了就原样拼到底层接口,不传就不带
--user-id - 不区分 /
userbot - 不做命令级校验
- 会把
contract search、--contract-number、--page-size合并进--page-token里的 JSON 对象--input-file/--data - 走开放平台标准接口
contract search --as bot/open-apis/contract/v1/contracts/search - 走
contract sync-user-groups --as bot/open-apis/contract/v1/contracts/user-groups/sync - 走
contract text --as botPOST /open-apis/contract/v1/contracts/{contract_id}/text - 走
contract category list --as bot/open-apis/contract/v1/contract_categorys - 走
contract template list --as bot/open-apis/contract/v1/templates - 按生产文档,的
contract template list --as bot、category_number、user_id都属于 query 参数;CLI 仍只透传,不做本地必填校验user_id_type - 走
contract template get --as bot/open-apis/contract/v1/templates/{template_id} - 按生产文档,的
contract template get --as bot、user_id都属于 query 参数;CLI 仍只透传,不做本地必填校验user_id_type - 走
contract template instantiate --as botPOST /open-apis/contract/v1/template_instances - 按生产文档,的 query 只有
contract template instantiate --as bot,请求体里需要user_id_type;CLI 仍只透传,不做本地必填校验create_user_id - 走
contract upload-file --as botPOST /open-apis/contract/v1/files/upload - 使用
contract upload-file,字段是multipart/form-data、file_name、file_typefile - 的
contract upload-file是本地真实文件路径,不是 JSON 请求体文件--file - 不接受
contract upload-file/--input-file--data - 本地限制文件大小小于等于
contract upload-file200MB - 常用 :
file_type合同文本、text其他附件、attachment归档扫描件、scan合同附件、cause归档附件、archiveAttachment图片附件、customPictureAttachment表格附件、customTableAttachment文件附件customFileAttachment - 支持
contract text、--full-text、--offset--limit - 只接收请求体,不再接模板 ID 位置参数
contract template instantiate
- 、
contract get、contract search、contract create、contract sync-user-groups、contract text、contract category list、contract template list、contract template get同时支持contract template instantiate和--as user--as bot - 当前仅支持
contract upload-file--as bot - 除这九条双身份命令和 外,其余命令仍然只支持
contract upload-file--as user - 当前直接接收原始创建请求体,不额外暴露
contract create--template - 走
contract create --as botPOST /open-apis/contract/v1/contracts - 的请求体必须自己带
contract create --as botcreate_user_id - 的推荐阅读顺序是:
contract create- 先读 references/create-contract-fields.md 选场景和最小请求体
- 再读 references/create-contract-field-tree.md 查嵌套对象和 JSON Path
- 最后读 references/create-contract-enums.md 确认 code 取值
- 这三份文档一起构成 的完整参数主档,不需要再回查旧接口清单
contract create - 走开放平台标准接口
contract get --as bot/open-apis/contract/v1/contracts/{contract_id} - /
--user-id-type是通用 query 参数:--user-id- 不传时默认拼接
--user-id-typeuser_id_type=user_id - 显式传 时会覆盖默认值
--user-id-type <type> - 传了就原样拼到底层接口,不传就不带
--user-id - 不区分 /
userbot - 不做命令级校验
- 会把
contract search、--contract-number、--page-size合并进--page-token里的 JSON 对象--input-file/--data - 走开放平台标准接口
contract search --as bot/open-apis/contract/v1/contracts/search - 走
contract sync-user-groups --as bot/open-apis/contract/v1/contracts/user-groups/sync - 走
contract text --as botPOST /open-apis/contract/v1/contracts/{contract_id}/text - 走
contract category list --as bot/open-apis/contract/v1/contract_categorys - 走
contract template list --as bot/open-apis/contract/v1/templates - 按生产文档,的
contract template list --as bot、category_number、user_id都属于 query 参数;CLI 仍只透传,不做本地必填校验user_id_type - 走
contract template get --as bot/open-apis/contract/v1/templates/{template_id} - 按生产文档,的
contract template get --as bot、user_id都属于 query 参数;CLI 仍只透传,不做本地必填校验user_id_type - 走
contract template instantiate --as botPOST /open-apis/contract/v1/template_instances - 按生产文档,的 query 只有
contract template instantiate --as bot,请求体里需要user_id_type;CLI 仍只透传,不做本地必填校验create_user_id - 走
contract upload-file --as botPOST /open-apis/contract/v1/files/upload - 使用
contract upload-file,字段是multipart/form-data、file_name、file_typefile - 的
contract upload-file是本地真实文件路径,不是 JSON 请求体文件--file - 不接受
contract upload-file/--input-file--data - 本地限制文件大小小于等于
contract upload-file200MB - 常用 :
file_type合同文本、text其他附件、attachment归档扫描件、scan合同附件、cause归档附件、archiveAttachment图片附件、customPictureAttachment表格附件、customTableAttachment文件附件customFileAttachment - 支持
contract text、--full-text、--offset--limit - 只接收请求体,不再接模板 ID 位置参数
contract template instantiate
实现来源
实现来源
- internal/cli/contract_command.go
- internal/openplatform/contract/service.go
- references/commands.md
- references/create-contract-fields.md
- references/create-contract-field-tree.md
- references/create-contract-enums.md
- internal/cli/contract_command.go
- internal/openplatform/contract/service.go
- references/commands.md
- references/create-contract-fields.md
- references/create-contract-field-tree.md
- references/create-contract-enums.md
操作建议
操作建议
- 先确认 profile 已完成目标身份的登录:
- user 详情、user 搜索、user 创建、user 同步用户组、user 合同文本、user 分类查询、user 模板列表、user 模板详情、user 模板实例和其他 user-only 命令:
auth login --as user - bot 详情、bot 搜索、bot 创建、bot 同步用户组、bot 合同文本、bot 分类查询、bot 模板列表、bot 模板详情、bot 模板实例、bot 文件上传:
auth login --as bot
- user 详情、user 搜索、user 创建、user 同步用户组、user 合同文本、user 分类查询、user 模板列表、user 模板详情、user 模板实例和其他 user-only 命令:
- 复杂请求体优先用
--input-file - 需要脚本消费时加
--output json - 需要对照后端原始 envelope 时加
--raw - 创建合同前,先根据是“文件正文模式”“模板实例模式”“合同变更”还是“合同终止”选主文档里的场景配方
- 复杂对象不要平铺查表,直接去字段树附录按 JSON Path 找
- 遇到 code 型字段,不要凭印象写值,直接看枚举附录
- 交易方/我方主体、金额、期限、合同分类这几个字段最容易缺,优先核对
- 先确认 profile 已完成目标身份的登录:
- user 详情、user 搜索、user 创建、user 同步用户组、user 合同文本、user 分类查询、user 模板列表、user 模板详情、user 模板实例和其他 user-only 命令:
auth login --as user - bot 详情、bot 搜索、bot 创建、bot 同步用户组、bot 合同文本、bot 分类查询、bot 模板列表、bot 模板详情、bot 模板实例、bot 文件上传:
auth login --as bot
- user 详情、user 搜索、user 创建、user 同步用户组、user 合同文本、user 分类查询、user 模板列表、user 模板详情、user 模板实例和其他 user-only 命令:
- 复杂请求体优先用
--input-file - 需要脚本消费时加
--output json - 需要对照后端原始 envelope 时加
--raw - 创建合同前,先根据是“文件正文模式”“模板实例模式”“合同变更”还是“合同终止”选主文档里的场景配方
- 复杂对象不要平铺查表,直接去字段树附录按 JSON Path 找
- 遇到 code 型字段,不要凭印象写值,直接看枚举附录
- 交易方/我方主体、金额、期限、合同分类这几个字段最容易缺,优先核对
不要这样做
不要这样做
- 不要对 传
contract enum--as bot - 不要继续写 ;JSON 请求体用
--file contract.json--input-file - 不要对 传
contract upload-file--as user - 不要把 当成已实现能力
contract template fields
- 不要对 传
contract enum--as bot - 不要继续写 ;JSON 请求体用
--file contract.json--input-file - 不要对 传
contract upload-file--as user - 不要把 当成已实现能力
contract template fields