or ~
or prebuilt from the latest release
Advanced explanationInputs can be:
- local file
- url
- bytes from stdin
The type of each input is inferred automatically, and it continues through the pipeline until it reaches the output format the user requested.
For example, if the user runs:
mcat will:
- Convert both file.docx and file.pdf into a single Markdown file
- Convert that Markdown into HTML
- Convert the HTML into an image
- Convert the image into an inline terminal image and print it
You can also start from the middle of the pipeline.
For example:
This starts at an HTML file and directly converts it into a PNG image.
-
Markdown - set when -o md or when the stdout isn't the terminal (piped)
-
Pretty Terminal is markdown with ANSI formatting, and is the default for any non video / image file. (the -c flag forces it)
-
HTML set when -o html -- only works for non image / video files
-
Static Image set when -o image and gives an image
-
Interactive Image set when -o interactive and launches an interactive view to zoom and pan the image in the terminal.
-
Inline Display set when -o inline or -i and prints the content as image in the terminal
Mcat will continue working without them
Chromium (for rendering HTML to image)- Available by default on most Windows machines via Microsoft Edge.
- Also works with any installed Chrome, Edge, or Chromium.
- You can install it manually via mcat --fetch-chromium
pdftocairo/pdftoppm (for rendering PDF to image)
- Is included by default in most major distros
- Windows users can install from poppler-windows
- If not installed, mcat will fallback into converting the PDF to Markdown and then screenshot using chromium
FFmpeg (for videos)
- If it's already on your machine 🫠.
- Otherwise, you can install it with mcat --fetch-ffmpeg
Using Flags
the main flags for configuring are:
- --opts for inline image printing
- --ls-opts for the ls command
run mcat --help for full detail, and other flags.
Using Environment Variables
each variable mimicks its corresponding flag alternative.
- MCAT_ENCODER, Options: kitty,iterm,sixel,ascii. e.g. MCAT_ENCODER=kitty is the same as doing --kitty
- MCAT_PAGER, the full command mcat will try to pipe into.
- MCAT_THEME, same as the --theme flag
- MCAT_INLINE_OPTS, same as the --opts flag
- MCAT_LS_OPTS, same as the --ls-opts flag
- MCAT_SILENT, same as the --silent flag
- MCAT_NO_LINENUMBERS, same as the --no-linenumbers flag
- MCAT_MD_IMAGE, same as the --no-images flag
- mcat.nvim: a neovim plugin to use mcat inside neovim
MIT License