SuperAPI AI Directory

contract-cli-shared

Agents & models

View repository

Updated 10-15 21:34

About this skill

contract-cli Shared

CRITICAL — before starting, MUST first read ../auth/SKILL.md, to confirm the current profile, user login state, and bot/token constraints.

Quick decision

  • Contract search, detail, create, contract text, template, category, enumeration: read ../contract-cli-contract/SKILL.md The structure here is now "main document + field tree appendix + enumeration appendix"
  • Counterparty query: read ../contract-cli-mdm-vendor/SKILL.md The structure here is now "main guide + parameter appendix + command examples"
  • Legal entity query: read ../contract-cli-mdm-legal/SKILL.md The structure here is now "main guide + parameter appendix + command examples"
  • Field configuration query: read ../contract-cli-mdm-fields/SKILL.md The structure here is now "main guide + biz-line appendix + command examples"
  • The user gave an exact open platform path, or the structured command does not yet cover it: do not recommend api call; it is a reserved capability and is currently not yet open for use

Currently implemented modules

  • contract get/search/create/sync-user-groups/text
  • contract upload-file
  • contract category list
  • contract template list/get/instantiate
  • contract enum list
  • mdm vendor list/get
  • mdm legal list/get
  • mdm fields list

Shared constraints

  • api call is currently not open to the public; executing contract-cli api ... will directly return api call 暂未开放使用,请使用已开放的结构化命令
  • contract/v1/mcp Most of these paths only support --as user
  • Among the current structured commands, only contract get、contract search、contract create、contract sync-user-groups、contract text、contract category list、contract template list、contract template get、contract template instantiate、contract upload-file、mdm vendor list、mdm vendor get、mdm legal list、mdm legal get、mdm fields list supports bot; among them, the contract commands' bot route goes through /open-apis/contract/v1/...,contract upload-file goes through /open-apis/contract/v1/files/upload and only supports bot,mdm vendor list/get 's bot route goes through /open-apis/mdm/v1/vendors...,mdm legal list 's bot route goes through /open-apis/mdm/v1/legal_entities/list_all,mdm legal get 's bot route goes through /open-apis/mdm/v1/legal_entities/{legal_entity_id},mdm fields list 's bot route goes through /open-apis/mdm/v1/config/config_list
  • If it matches /open-apis/contract/v1/mcp/ and --as is not passed --as, the CLI will by default parse as user and ignore default_identity
  • These commands do not expose --operator
  • Request body file input uniformly uses --input-file
  • --user-id-type / --user-id is a general open platform query parameter: supported by structured commands;--user-id-type When not passed, by default append user_id_type=user_id, explicitly passing a value will override the default value;--user-id If passed, it is passed through; if not passed, it is not included; no command-level validation is done
  • --file is now only used for real binary file uploads, for example contract upload-file
  • JSON request body file input always uses --input-file, do not treat --file as a JSON request body parameter
  • For default output, it is recommended to use json; when troubleshooting is needed, you can add --raw

Implementation source

Troubleshooting points

  • Command reports only supports --as user: what is currently matched is a user-only contract/v1/mcp path, switch to --as user
  • Command reports profile "<name>" not found: first execute contract-cli config add --env dev --name <profile>
  • Command reports user identity is not authorized: first execute contract-cli auth login --profile <profile> --as user
  • The user wants to do file upload: currently only supported contract upload-file --as bot --file <path> --file-type <type>