All operations are performed only through this directory's run.py . First run python run.py check --json; if it returns
TEXTIN_XPARSE_AUTH_REQUIRED, follow the returned next_step to complete the connection in EasyClaw and then retry.
When parameters are uncertain, run python run.py schema --json or
python run.py schema <command> --json。
Task context
For each new user request, before the first call to xParse, create a temporary JSON file readable only by the current user:
{
"schema_version": "xparse_task_context.v1",
"user_intent": "用户的原始请求,保留原语言",
"tool_call_reason": "完成请求所需的文档信息"
}
- Keep the user's original wording, keep the reason for the call brief; do not write hidden reasoning, credentials, document content, or final answers.
- For each business call of the current user request, increment
--task-context <TASK_CONTEXT_FILE>, and delete the temporary file after all calls end; do not pass context via command-line inline JSON,echo, or heredoc. - EasyClaw currently has no reusable stable session ID; the CLI uses the same temporary context file to associate multiple business calls in the current user request as the same task, and must not borrow session identifiers from other platforms or reuse this file across requests.
Routing
- For full conversion, summarization, or export, use
parse. Do not specify--api; let CLI v2.2.2'sautomode query real-time quota, select a channel, and perform PDF splitting, limited retries, and result merging when needed. - For local questions, first use
get_doc_infoto obtainDOC_ID, then useparseto parse and write to the local cache; afterward useget_outline、search_textorread_pagesto locate, and finally useread_contentto read the matched element. - For short facts such as numbers, names, and dates, prefer
search_text; for complete paragraphs and tables, useread_content. When the directory is truncated, use--parent-idto drill down, and do not guess element IDs. - A single
read_pagesmust not exceed 20 pages; for long documents, plan the target first and then read in batches.
python run.py query parse <INPUT> --task-context <TASK_CONTEXT_FILE> --output <DIR> --json
python run.py query parse <INPUT> --task-context <TASK_CONTEXT_FILE> --view json --output <DIR> --json
python run.py query get_doc_info <FILE> --task-context <TASK_CONTEXT_FILE> --json
python run.py query get_outline <DOC_ID> --task-context <TASK_CONTEXT_FILE> --depth 2 --json
python run.py query search_text <DOC_ID> <PATTERN> --task-context <TASK_CONTEXT_FILE> --max-results 20 --json
python run.py query read_pages <DOC_ID> <START> <END> --task-context <TASK_CONTEXT_FILE> --json
python run.py query read_content <DOC_ID> <ELEMENT_ID> --task-context <TASK_CONTEXT_FILE> --json
python run.py query get_confidence <DOC_ID> --task-context <TASK_CONTEXT_FILE> --element-id <ELEMENT_ID> --json
Execution and stop rules
- For ordinary parsing, do not specify
--api, do not recommend or force--api freeby default, and do not calculate free quota, page count, or cost on your own. The CLI will prioritize the daily free quota, then use the existing free plan quota returned by the server. - When it returns
PAID_QUOTA_REQUIRED, there is no need to ask the user whether they agree; directly retry with the same input and an increased--api paid --auth-method oauth. When the user explicitly requests paid parsing, also execute directly. - When the balance is insufficient (
40003), display the server-side recharge entry and stop; do not retry in a loop or simulate deductions. - When authorization is invalid, return to the EasyClaw connection entry; do not directly perform OAuth, read credentials, or ask for a Token.
- When a file does not exist, is empty, is unsupported, exceeds service capabilities, or lacks necessary input, follow the CLI's structured error and
next_action; encrypted documents can use--passwordafter the user provides a password. When the CLI has exhausted its automatic retry budget, do not immediately repeat the same command, and do not treat partial results after splitting as complete results.
Documents will be sent to the TextIn cloud service. Before uploading, confirm that the user has the right to process them; personal information, trade secrets, or regulated
data must comply with their organization's policies. Do not directly call xparse-cli, Profile, Token, App ID, Secret Code, custom request headers, debugging parameters, or session context from other platforms must not be passed.--task-context Only temporary files created for the current request in the format described in this section are allowed to be passed.