CRITICAL — Before starting, MUST first read ../contract-cli-shared/SKILL.md。
Applicable Commands
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>
Quick Decision
- Want to get contract details directly: use
contract get - Want to query the contract list by conditions: use
contract search - Want to directly pass through the contract creation request body: use
contract create - Want to get the body text: use
contract text - Want to view the category tree: use
contract category list - Want to view templates or create template instances: use
contract template ... - Want to upload contract body or attachment files: use
contract upload-file --as bot - Want to query enums related to contract creation: use
contract enum list - If the requirement is approval, authorization, or payment: the current skill does not cover it, do not fabricate commands
Key Rules
contract get、contract search、contract create、contract sync-user-groups、contract text、contract category list、contract template list、contract template get、contract template instantiateSupports both--as userand--as botcontract upload-fileCurrently only supports--as bot- Except for these nine dual-identity commands and
contract upload-file, the remaining commands still only support--as user contract createCurrently directly accepts the raw creation request body, without additionally exposing--templatecontract create --as botgoes throughPOST /open-apis/contract/v1/contractscontract create --as botThe request body for must carry its owncreate_user_idcontract createThe recommended reading order for is:- First read references/create-contract-fields.md choose the scenario and minimal request body
- Then read references/create-contract-field-tree.md check nested objects and JSON Path
- Finally read references/create-contract-enums.md confirm the code values
- These three documents together form
contract createThe complete parameter master file, no need to look back at the old interface list contract get --as botgoes through Open Platform standard API/open-apis/contract/v1/contracts/{contract_id}--user-id-type/--user-idis a common query parameter:--user-id-typeWhen not passed, the default concatenation isuser_id_type=user_id- Explicitly passing
--user-id-type <type>will override the default value --user-idIf passed, it will be concatenated as-is to the underlying API; if not passed, it will not be included- Does not distinguish
user/bot - No command-level validation
contract searchwill--contract-number、--page-size、--page-tokenmerge into--input-file/--datathe JSON object incontract search --as botgoes through Open Platform standard API/open-apis/contract/v1/contracts/searchcontract sync-user-groups --as botgoes through/open-apis/contract/v1/contracts/user-groups/synccontract text --as botgoes throughPOST /open-apis/contract/v1/contracts/{contract_id}/textcontract category list --as botgoes through/open-apis/contract/v1/contract_categoryscontract template list --as botgoes through/open-apis/contract/v1/templates- According to the production documentation,
contract template list --as bot'scategory_number、user_id、user_id_typeall belong to query parameters; CLI still only passes through, without local required-field validation contract template get --as botgoes through/open-apis/contract/v1/templates/{template_id}- According to the production documentation,
contract template get --as bot'suser_id、user_id_typeall belong to query parameters; CLI still only passes through, without local required-field validation contract template instantiate --as botgoes throughPOST /open-apis/contract/v1/template_instances- According to the production documentation,
contract template instantiate --as botthe query only hasuser_id_type, the request body needscreate_user_id; CLI still only passes through, without local required-field validation contract upload-file --as botgoes throughPOST /open-apis/contract/v1/files/uploadcontract upload-fileusesmultipart/form-data, the fields arefile_name、file_type、filecontract upload-file's--fileis a local real file path, not a JSON request body filecontract upload-filedoes not accept--input-file/--datacontract upload-fileThe local file size limit is less than or equal to200MB- Common
file_type:textContract text,attachmentOther attachments,scanArchived scans,causeContract attachments,archiveAttachmentArchive attachments,customPictureAttachmentImage attachment,customTableAttachmentTable attachment,customFileAttachmentFile attachment contract textSupports--full-text、--offset、--limitcontract template instantiateonly accepts the request body, no longer accepts the template ID positional argument
Implementation source
- 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
Suggested actions
- First confirm that the profile has completed login for the target identity:
- user details, user search, user create, user sync user group, user contract text, user category query, user template list, user template details, user template instance, and other user-only commands:
auth login --as user - bot details, bot search, bot create, bot sync user group, bot contract text, bot category query, bot template list, bot template details, bot template instance, bot file upload:
auth login --as bot
- user details, user search, user create, user sync user group, user contract text, user category query, user template list, user template details, user template instance, and other user-only commands:
- For complex request bodies, prefer
--input-file - Add when script consumption is needed
--output json - Add when you need to compare against the backend's raw envelope
--raw - Before creating a contract, first choose the scenario recipe in the main document based on whether it is "file body mode", "template instance mode", "contract change", or "contract termination"
- Do not flatten complex objects into a lookup table; go directly to the field tree appendix and find them by JSON Path
- When encountering code-type fields, do not write values from memory; look directly at the enum appendix
- Counterparty/our entity, amount, term, and contract category are the fields most likely to be missing; check them first
Do not do this
- Do not pass
contract enumto--as bot - Do not continue writing
--file contract.json; for the JSON request body use--input-file - Do not pass
contract upload-fileto--as user - Do not treat
contract template fieldsas an implemented capability