> ## Documentation Index
> Fetch the complete documentation index at: https://docs.somark.ai/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](https://docs.somark.ai/en/documentation/get-started-overview.md); if you want parsing inside application code, go to [SoMark SDK](https://docs.somark.ai/en/documentation/sdk.md).

**1. 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.

**2. 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
```

**3. 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
```

**4. 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](https://docs.somark.ai/en/cli-sdk/usage.md).


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.