Skip to content

CLI Reference

mdink edited this page Feb 28, 2026 · 1 revision

CLI Reference

Synopsis

mdink [OPTIONS] <file>
mdink [OPTIONS] -
mdink --list-themes
mdink --dump-theme

Use - as the file argument to read from stdin.


Arguments

Argument Description
<file> Path to the Markdown file to render. Use - for stdin. Required unless --list-themes or --dump-theme is given.

Flags

Flag Short Description
--no-images Disable image rendering. Images show their alt text instead.
--style <THEME> -s Theme name (dark, light, dracula) or path to a JSON theme file.
--list-themes Print available built-in themes and exit (no file required).
--no-color Disable all colors. Structural modifiers (bold, italic) are preserved.
--dump-theme Print the resolved theme as pretty-printed JSON and exit (no file required). Useful for creating a custom theme.
--help -h Print help and exit.
--version -V Print version and exit.

Environment variables

Variable Description
MDINK_STYLE Theme name or path. Equivalent to --style. Overridden by the --style flag.
NO_COLOR When set to any value, disables all colors. Equivalent to --no-color. Honored per the no-color.org convention.

Config file

Location: ~/.config/mdink/config.json (or the platform equivalent on macOS/Windows)

mdink reads this file on startup. A missing file is silently ignored. A malformed file prints a warning to stderr and falls back to defaults.

Schema

{
  "style": "dracula",
  "no_images": false,
  "no_color": false
}
Field Type Description
style string | null Theme name or path. Same values accepted by --style.
no_images bool Disable image rendering when true.
no_color bool Disable all colors when true.

All fields are optional. Omitted fields fall back to their default values.

Precedence chain

CLI flags  >  MDINK_STYLE env var  >  config file  >  built-in defaults

For the no_color flag specifically:

--no-color flag  OR  NO_COLOR env var (any value)  OR  config.no_color = true

Any of the three sources activates no-color mode.


Exit codes

Code Constant Meaning
0 — Success
65 EX_DATAERR File too large (> 100 MB)
66 EX_NOINPUT File not found or unreadable

Exit codes follow the BSD sysexits.h convention. Error details are printed to stderr before the TUI initializes, so they appear in the normal terminal output.


Usage examples

# Render a file with the default (dark) theme
mdink README.md

# Render with the Dracula theme
mdink -s dracula README.md

# Render with a custom JSON theme
mdink -s ~/themes/nord.json README.md

# Read from stdin (e.g. in a pipeline)
cat notes.md | mdink -

# Render without images
mdink --no-images README.md

# List available built-in themes
mdink --list-themes

# Export the current theme as JSON (starting point for customization)
mdink --dump-theme > my-theme.json

# Use a custom theme you just edited
mdink -s my-theme.json README.md

# Disable color (e.g. in a script or log)
NO_COLOR=1 mdink README.md

Clone this wiki locally