> ## Documentation Index
> Fetch the complete documentation index at: https://docs.somark.cn/llms.txt
> Use this file to discover all available pages before exploring further.

# SoMark CLI

> 通过 SoMark CLI 快速完成单文件解析、批处理和自动化调用。

适合终端、脚本、CI 和“先把文件跑通”的场景。如果你还在比较接入方式，先看 [入门总览](/documentation/get-started-overview)；如果你要把能力接进代码里，去看 [SoMark SDK](/documentation/sdk)。

<Steps>
  <Step title="安装 CLI">
    Python 和 JavaScript 两个包都自带 `somark` 命令。

    ```bash theme={null}
    pip install somark
    # 或
    npm install somark-js
    ```

    <Note>
      如果全局命令还不可用，Python 先试 `python -m somark.cli.main --help`，Node.js 先试 `npx somark-js --help`。
    </Note>
  </Step>

  <Step title="配置 API Key">
    最常见的两种方式是交互式登录，或者直接用环境变量。

    ```bash theme={null}
    somark login

    # 或
    export SOMARK_API_KEY=sk-your-api-key
    ```
  </Step>

  <Step title="先解析一个文件">
    先用单文件同步解析跑通链路，再决定是否加格式、异步和批处理参数。

    ```bash theme={null}
    somark parse ./document.pdf

    somark parse ./document.pdf --formats md,json --out ./document.md
    ```
  </Step>

  <Step title="再处理大文件或批量任务">
    大文件可以直接异步等待结果，批量任务可以从文件清单读取。

    ```bash theme={null}
    somark parse ./large.pdf --async --wait

    somark parse --file-list ./files.txt --out ./parsed/
    ```

    需要更完整的参数说明时，继续看 [CLI & SDK 使用指南](/cli-sdk/usage)。
  </Step>
</Steps>
