TextIn xParse Document Parse: Transforming Documents into Agent-Readable Content with xparse-cli

Introduction

When Agents receive PDFs, scanned documents, or Office attachments, the common practice is to write custom scripts using PyMuPDF, pdfplumber, or OCR, and then manually assemble the Markdown. While this might suffice for a single file, scripts quickly become complex when tasks require chapter-based retrieval, table extraction, handling encrypted PDFs, or batch processing of multiple documents with task status tracking. Furthermore, these scripts often become entangled with billing, quotas, and error recovery logic.

Below is an introduction to TextIn xParse Document Parse on SkillHub (coordinate @user_2e25d6a2/xparse-parser, current version 1.0.4). It utilizes xparse-cli as the sole execution kernel, guiding Agents through parsing, navigation, summarization, and structured extraction, while covering a persistent multi-document Task Runtime workflow. The Skill tag is requires_api_key=false; however, paid routing and AppKey/OAuth configurations must still be set up separately according to the CLI documentation.

What is this

TextIn xParse Document Parse is a community-published office efficiency Skill (category office-efficiency, publisher user_2e25d6a2). Its positioning is straightforward: use xparse-cli to parse local files or document URLs—such as PDF, images, Office files, HTML, and OFD—into clean Markdown or structured JSON. This output is suitable for subsequent reading, searching, summarization, or extraction of tables and evidence.

The Skill itself does not re-implement HTTP, OAuth, quota management, or result merging logic; all operations are handled by the installed xparse-cli. When you need to take the first step from a raw file and desire results that are Agent-friendly, this Skill should be prioritized over directly reading raw PDFs or writing custom OCR scripts.

Core Functions

The following capabilities are derived from the official SKILL.md and accompanying references, and can be combined as needed.

Single Document Parsing and Output

  • Supports local path or URL input with the default routing --api auto (checks quota first, then routes to free or paid plans based on server-side status).
  • Outputs Markdown (default) or JSON (--view json), with the option to specify an output directory (--output <DIR>; the CLI will create the directory if it does not exist).
  • PDF support includes page ranges (--page-range), encrypted documents (--password), and character-level details (--include-char-details, requires explicit enabling).

Targeted Reading and Navigation (Local Documents)

For local files, the recommended workflow is:

get_doc_info -> Full parse -> navigate -> extract
  1. get_doc_info <FILE> to obtain the doc_id.
  2. Run a full parse on the same file (without --page-range) to write the navigation cache.
  3. Use get_outline, search_text, and read_pages to locate content.
  4. Call read_content in batches to extract required paragraphs.

Parsing with only a page range does not replace the navigation cache of the full document; URL parsing lacks a stable local doc_id, so you should use the parse output directly rather than local navigation commands.

Multi-Document Task Runtime

For two or more local files, or when the user explicitly requests persistent Task IDs, status queries, selective reading, exporting, or debugging, use Task instead of parallel parse commands:

xparse-cli task run --files '<GLOB>' --api auto

Subsequently, use subcommands such as task status, task read, task export, task debug, task continue (resuming encrypted tasks), and task resume (continuing after payment or recharge). --api auto for Task follows a “free-first, close on failure” policy and will not silently switch to paid mode; --api paid requires explicit user consent beforehand.

Quota and Routing

  • xparse-cli quota --output json to view the day’s free page count, reset time, authentication status, and plan balance.
  • --api free uses only free endpoints; --api paid explicitly enables paid mode. Free endpoints support PDFs and images; formats like Office, HTML, and OFD may require the paid API, so switching should be explained and approved first.

Structured Errors and Retries

Upon failure, parse the object in stderr where schema_version is xparse_error.v1; do not retry the same logical operation if retryable=false. Each xparse-cli command should be executed independently; do not use pipes to truncate output or mask exit codes.

Installation and Activation

1. Install xparse-cli

The Skill requires Node.js 18+. Install the CLI globally:

xparse-cli version

If not installed:

npm i -g xparse-cli

For users in China, npmmirror can be used:

npm i -g xparse-cli --registry=https://registry.npmmirror.com

In a TextIn xParse WorkBuddy Connector environment, the Connector installs a fixed version of the CLI. Within document tasks, you should use:

xparse-cli --profile workbuddy <command> ...

Do not manually override this version in tasks managed by the Connector.

2. Install the Skill via SkillHub

First, confirm the SkillHub CLI (see SkillHub Installation Instructions):

command -v skillhub && skillhub --version

If not installed, run the official script (full install or --cli-only for CLI only). When installing the Skill, you must use --dir to point to the current Agent’s skills directory; otherwise, it defaults to ./skills/ and may not be recognized.

The common path for Cursor is ~/.cursor/skills/:

skillhub install @user_2e25d6a2/xparse-parser --dir ~/.cursor/skills/

For Claude Code, use ~/.claude/skills/; for Codex, it can be ~/.codex/skills/ or .agents/skills/ under the project directory. After installation, restart or refresh the Skill list according to the client’s requirements.

The SkillHub page also provides installation instructions for AI: Install @user_2e25d6a2/xparse-parser based on https://skillhub.cn/install/skillhub.md.

3. Authentication (As Needed)

  • WorkBuddy: Relies on the Connector’s Device OAuth and the workbuddy profile. If disconnected, prompt the user to reconnect; do not ask for Secrets/Tokens.
  • Standalone CLI: Supports the xparse-cli auth interactive menu, AppKey, Device OAuth, browser PKCE, etc. For non-interactive use, set the XPARSE_APP_ID and XPARSE_SECRET_CODE environment variables. See references/authentication.md inside the Skill for details.

The Skill store metadata does not require a pre-configured API Key; however, authentication via the CLI is still required when using paid routing or specific quota features.

Typical Usage

Convert Entire PDF to Markdown and Save to Disk

For long documents, it is recommended to write to a directory to avoid terminal truncation:

xparse-cli parse report.pdf --api auto --output ./result/

Read the <basename>.md in the generated directory before performing summarization or Q&A.

Structured JSON (Including Tables and Hierarchy)

xparse-cli parse report.pdf --api auto --view json --output ./result/

Add --include-char-details when coordinate-level character information is required.

Specify Pages and Encryption

xparse-cli parse doc.pdf --api auto --page-range 1-5
xparse-cli parse doc.pdf --api auto --password secret123

Search within Local Document then Extract

xparse-cli get_doc_info ./contract.pdf
xparse-cli parse ./contract.pdf --api auto --output ./result/
xparse-cli search_text <DOC_ID> "Breach of Contract"

Based on the outline or search results, call read_content (for single tasks, it is recommended to keep the number of calls within roughly eight; independent reads can be merged).

Multi-File Batch Processing

xparse-cli task run --files './invoices/*.pdf' --api auto
xparse-cli task status <TASK_ID> --run-id <RUN_ID>
xparse-cli task export <TASK_ID> --run-id <RUN_ID> --output ./export/

Keep the returned operation_id, task_id, and run_id. If the status is waiting_paid_authorization or waiting_funds, stop and wait for user confirmation before using task resume to continue.

View Quota

xparse-cli quota --output json

Before the user asks about remaining limits, routing fails, or suggests a paid retry, you should first read the current quota facts.

Use Cases and Notes

Suitable for:

  • The user provides a single file or URL, and the first step is to convert the content into Markdown/JSON for the Agent to use.
  • Targeted extraction within a local PDF based on keywords, tables of contents, or page numbers, rather than reading the entire text.
  • Multi-document batch processing requiring a resumable workflow with Task IDs and subsequent status/read/export/debug.
  • A desire to unify under TextIn xParse’s quota and billing rules rather than maintaining multiple custom parsing scripts.

Notes:

  • Free routing mainly covers PDFs and images; other formats often require --api paid and explicit user consent.
  • Select between parse and task run based on the number of input files and whether a persistent Task is needed. Do not split an accepted Task into multiple parse calls due to quota failures.
  • Execute each CLI command independently; upon failure, rely on the next_action of the structured error object.
  • SkillHub page statistics (as of data capture): Rating approximately 100000, Downloads approximately 2799, Installs approximately 11; refer to the SkillHub Skill Page for real-time data.

Conclusion

TextIn xParse Document Parse consolidates document parsing, navigation, batch task processing, and quota routing into a single command line via xparse-cli. This provides Agents with reproducible steps and clear error boundaries when starting from “reading files.” If your workflow frequently starts with PDF/Office/images, it is worth installing this Skill on SkillHub and configuring the CLI.

羽毛球分组比赛记分
小程序二维码

欢迎使用《羽毛球分组比赛记分》微信小程序

Xiaoye