# Pymupdf4llm CLI

**URL:** <https://forum.mupdf.com/t/pymupdf4llm-cli/54>\
**Category:** PyMuPDF\
**Created:** [July 15, 2025, 8:16pm UTC](https://forum.mupdf.com/t/pymupdf4llm-cli/54 "2025-07-15T20:16:45Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![sahvtsl](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@sahvtsl](https://forum.mupdf.com/u/sahvtsl)\
**Post date:** [July 15, 2025, 8:16pm UTC](https://forum.mupdf.com/t/pymupdf4llm-cli/54/1 "2025-07-15T20:16:45Z")

</div>

It would be great to have a CLI wrapper around. The usage I have in mind is to take pdfs and convert them to markdown and then feed them manually as context.

---

<div class="post-metadata">

**Author:** ![Jamie\_Lemon](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.mupdf.com/jamie_lemon/32/5_2.png) [@Jamie\_Lemon](https://forum.mupdf.com/u/Jamie_Lemon)\
**Post date:** [July 15, 2025, 9:37pm UTC](https://forum.mupdf.com/t/pymupdf4llm-cli/54/2 "2025-07-15T21:37:10Z")

</div>

Hi sahvtsl!  
Can you explain more about what you mean by a “CLI wrapper” in this context?

---

<div class="post-metadata">

**Author:** ![sahvtsl](https://avatars.discourse-cdn.com/v4/letter/s/35a633/32.png) [@sahvtsl](https://forum.mupdf.com/u/sahvtsl)\
**Post date:** [July 15, 2025, 10:56pm UTC](https://forum.mupdf.com/t/pymupdf4llm-cli/54/3 "2025-07-15T22:56:26Z")

</div>

Hi Jamie, what I meant was a command line interface. I use:  
pymupdf … -gettext …

to convert pdf to txt

The docs don’t say if I can invoke pymupdf4llm module on the command line.

Thanks,  
Avneesh

---

<div class="post-metadata">

**Author:** ![Jamie\_Lemon](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.mupdf.com/jamie_lemon/32/5_2.png) [@Jamie\_Lemon](https://forum.mupdf.com/u/Jamie_Lemon)\
**Post date:** [July 15, 2025, 10:58pm UTC](https://forum.mupdf.com/t/pymupdf4llm-cli/54/4 "2025-07-15T22:58:30Z")

</div>

Aha! Got it thanks - so the way we use PyMuPDF directly on the CLI like this: [Command line interface - PyMuPDF 1.26.3 documentation](https://pymupdf.readthedocs.io/en/latest/module.html) but for PyMuPDF4LLM - got it!  
@HaraldLieder might have ideas around this so let’s see if he has any ideas here!

---

<div class="post-metadata">

**Author:** ![HaraldLieder](https://yyz2.discourse-cdn.com/flex004/user_avatar/forum.mupdf.com/haraldlieder/32/14_2.png) [@HaraldLieder](https://forum.mupdf.com/u/HaraldLieder)\
**Post date:** [July 15, 2025, 11:26pm UTC](https://forum.mupdf.com/t/pymupdf4llm-cli/54/5 "2025-07-15T23:26:22Z")

</div>

Hi all, yes, that is a gap currently. One of the many things we have on our list of improvements …
