> ## 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

> Use the SoMark CLI for single-file parsing, batch jobs, and automation.

Best for terminals, scripts, CI, and every “run this file now” workflow. If you are still comparing integration paths, start with the [get started overview](/en/documentation/get-started-overview); if you want parsing inside application code, go to [SoMark SDK](/en/documentation/sdk).

<Steps>
  <Step title="Install the CLI">
    Both the Python and JavaScript packages provide the `somark` command.

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

    <Note>
      If the global command is not available yet, try `python -m somark.cli.main --help` on Python or `npx somark-js --help` on Node.js.
    </Note>
  </Step>

  <Step title="Set your API key">
    The two most common options are interactive login or an environment variable.

    ```bash theme={null}
    somark login

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

  <Step title="Parse one file first">
    Start with single-file sync parsing before adding more output formats, async flags, or batch inputs.

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

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

  <Step title="Move on to large files or batch jobs">
    Use async mode for large files, or read from a file list for repeatable batch processing.

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

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

    For more detail on parameters and error handling, continue to the [CLI & SDK usage guide](/en/cli-sdk/usage).
  </Step>
</Steps>
