SuperAPI AI Directory

contract-cli-contract

Office & productivity

View repository

Updated 10-15 22:41

About this skill

contract-cli Contract

CRITICAL — Before starting, MUST first read ../contract-cli-shared/SKILL.md。

Applicable Commands

  • contract-cli contract get <contract-id>
  • contract-cli contract search
  • contract-cli contract create
  • contract-cli contract sync-user-groups
  • contract-cli contract text <contract-id>
  • contract-cli contract category list
  • contract-cli contract template list
  • contract-cli contract template get <template-id>
  • contract-cli contract template instantiate
  • contract-cli contract upload-file
  • contract-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 instantiate Supports both --as user and --as bot
  • contract upload-file Currently only supports --as bot
  • Except for these nine dual-identity commands and contract upload-file , the remaining commands still only support --as user
  • contract create Currently directly accepts the raw creation request body, without additionally exposing --template
  • contract create --as bot goes through POST /open-apis/contract/v1/contracts
  • contract create --as bot The request body for must carry its own create_user_id
  • contract create The recommended reading order for is:
  • These three documents together form contract create The complete parameter master file, no need to look back at the old interface list
  • contract get --as bot goes through Open Platform standard API /open-apis/contract/v1/contracts/{contract_id}
  • --user-id-type / --user-id is a common query parameter:
    • --user-id-type When not passed, the default concatenation is user_id_type=user_id
    • Explicitly passing --user-id-type <type> will override the default value
    • --user-id If 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 search will --contract-number、--page-size、--page-token merge into --input-file/--data the JSON object in
  • contract search --as bot goes through Open Platform standard API /open-apis/contract/v1/contracts/search
  • contract sync-user-groups --as bot goes through /open-apis/contract/v1/contracts/user-groups/sync
  • contract text --as bot goes through POST /open-apis/contract/v1/contracts/{contract_id}/text
  • contract category list --as bot goes through /open-apis/contract/v1/contract_categorys
  • contract template list --as bot goes through /open-apis/contract/v1/templates
  • According to the production documentation,contract template list --as bot 's category_number、user_id、user_id_type all belong to query parameters; CLI still only passes through, without local required-field validation
  • contract template get --as bot goes through /open-apis/contract/v1/templates/{template_id}
  • According to the production documentation,contract template get --as bot 's user_id、user_id_type all belong to query parameters; CLI still only passes through, without local required-field validation
  • contract template instantiate --as bot goes through POST /open-apis/contract/v1/template_instances
  • According to the production documentation,contract template instantiate --as bot the query only has user_id_type, the request body needs create_user_id; CLI still only passes through, without local required-field validation
  • contract upload-file --as bot goes through POST /open-apis/contract/v1/files/upload
  • contract upload-file uses multipart/form-data, the fields are file_name、file_type、file
  • contract upload-file 's --file is a local real file path, not a JSON request body file
  • contract upload-file does not accept --input-file / --data
  • contract upload-file The local file size limit is less than or equal to 200MB
  • Common file_type:text Contract text,attachment Other attachments,scan Archived scans,cause Contract attachments,archiveAttachment Archive attachments,customPictureAttachment Image attachment,customTableAttachment Table attachment,customFileAttachment File attachment
  • contract text Supports --full-text、--offset、--limit
  • contract template instantiate only accepts the request body, no longer accepts the template ID positional argument

Implementation source

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
  • 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 enum to --as bot
  • Do not continue writing --file contract.json; for the JSON request body use --input-file
  • Do not pass contract upload-file to --as user
  • Do not treat contract template fields as an implemented capability