convertr

module
v0.1.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 1, 2026 License: MIT

README

convertr

Русская версия

Universal file format converter. One binary, 50+ formats, CLI, TUI, Web UI, REST API, and automatic route selection.

CI Go Reference Go Report Card

convertr wraps pandoc, ffmpeg, LibreOffice, ImageMagick, jq, yq, Tesseract, csvkit, AsciiDoctor, Calibre, pdfcpu, and plugin backends behind one command:

convertr FILE -o OUT

It detects formats, checks installed backends, and picks a conversion route automatically. If no direct route exists, it can chain available tools.

Category Formats
Documents MD, DOCX, PDF, ODT, HTML, EPUB, RST, TeX, PPTX
Images JPG, PNG, WebP, SVG, AVIF, HEIC, GIF
Video MP4, MKV, WebM, AVI, MOV
Audio MP3, FLAC, AAC, WAV, OGG
Data JSON, YAML, TOML, CSV, XLSX
OCR image to text through Tesseract

convertr CLI basics demo

Why use it?

  • One interface for documents, media, data, OCR, and PDF tools.
  • Automatic routing over installed backend capabilities.
  • Batch conversion with workers, retry policy, and conflict handling.
  • Watch mode for converting files as they change.
  • Unicode safety controls for Cyrillic PDF output and strict text-layer checks.
  • TUI, built in Web UI, REST API, Docker image, and plugin protocol.

Install

Go
go install github.com/Mark1708/convertr/cmd/convertr@latest

Requires Go 1.25+.

Homebrew
brew install mark1708/tap/convertr
Source
git clone https://github.com/Mark1708/convertr.git
cd convertr
go build -o ~/.local/bin/convertr ./cmd/convertr
Backend tools

Install common conversion tools:

# macOS
./scripts/install-deps-macos.sh

# Debian or Ubuntu
./scripts/install-deps-linux.sh

Check what is available:

convertr version
convertr doctor

doctor prints installed tools, versions, paths, and install hints for missing backends.

First conversion

# Format is inferred from extensions.
convertr report.docx -o report.md

# Target format can be explicit.
convertr notes.md --to pdf -o notes.pdf

# Require Unicode-safe PDF text when Cyrillic is detected.
convertr notes.md --to pdf -o notes.pdf --unicode-mode strict

# Stdin to stdout.
cat data.json | convertr - --from json --to yaml -o -

Common workflows

# Convert a directory recursively.
convertr -r ./docs -o ./out --to md --mkdir

# Use 4 workers and retry failed jobs.
convertr -r ./inbox -o ./outbox --to pdf -j 4 --on-error retry --mkdir

# Preview the plan without writing files.
convertr -r ./docs -o ./out --to md --dry-run

# Prefer higher fidelity routes.
convertr source.docx -o out.pdf --route-policy quality

# Reject lossy route edges.
convertr image.png -o out.webp --avoid-lossy

# Limit route length.
convertr source.md -o out.pdf --max-hops 2

# Watch a directory and convert on every change.
convertr watch ./inbox -o ./outbox --to md

# Inspect formats and the conversion graph.
convertr formats
convertr formats --dot | dot -Tsvg > /tmp/formats.svg

More examples are in docs/workflows.md.

Interfaces

CLI

The CLI is the default interface for single files, batches, watch mode, PDF tools, backend checks, config, and plugins.

convertr --help
convertr backends list
convertr pdf merge -o bundle.pdf a.pdf b.pdf

Full reference: docs/cli.md.

Web UI and REST API
convertr serve
convertr serve --addr 127.0.0.1:8080

The browser UI supports uploads, route preview, Unicode safety selection, downloads, backend status, and PDF tools. Use --api-only when you only need the REST API.

TUI
convertr tui

Use the terminal UI to inspect backend status, preview routes, adjust route policy and Unicode mode on preview screens, and run an interactive conversion. Guide: docs/tui.md.

Docker

Use ghcr.io/mark1708/convertr for the full backend image with CLI, Web UI, and REST API. See docs/docker.md for tags, run commands, volumes, health checks, and image notes.

Configuration

Create a config file:

convertr config init
convertr config print
convertr config validate

Default path: ~/.config/convertr/config.toml. CLI flags override environment variables, which override the config file, which overrides built in defaults.

Common environment overrides:

  • CONVERTR_QUALITY
  • CONVERTR_WORKERS
  • CONVERTR_ON_ERROR
  • CONVERTR_ON_CONFLICT

Config fields and backend options are documented in docs/cli.md.

Backends and plugins

convertr removes missing backend capabilities from the graph at startup. Install tools, then run:

convertr doctor
convertr backends status

External plugins are executables named convertr-* in PATH.

convertr plugins list
convertr plugins test

Backend details and plugin protocol: docs/cli.md.

VHS demo tapes live in docs/demos. Only the CLI basics GIF is committed. Render the full local gallery with:

make demo

More docs

Contributor checks

make build
make test
make lint

CI also runs go vet, race enabled tests, go build ./..., and govulncheck.

License

MIT, see LICENSE.

Directories

Path Synopsis
cmd
convertr command
internal
backend/backends/asciidoctor
Package asciidoctor provides AsciiDoc conversion via the asciidoctor binary.
Package asciidoctor provides AsciiDoc conversion via the asciidoctor binary.
backend/backends/calibre
Package calibre provides ebook conversion via the calibre ebook-convert binary.
Package calibre provides ebook conversion via the calibre ebook-convert binary.
backend/backends/csvkit
Package csvkit provides CSV/XLSX/JSON conversion via csvkit or xlsx2csv.
Package csvkit provides CSV/XLSX/JSON conversion via csvkit or xlsx2csv.
backend/backends/ffmpeg
Package ffmpeg provides audio/video conversion via the ffmpeg binary.
Package ffmpeg provides audio/video conversion via the ffmpeg binary.
backend/backends/figlet
Package figlet converts plain text to ASCII art via the figlet binary.
Package figlet converts plain text to ASCII art via the figlet binary.
backend/backends/imagemagick
Package imagemagick provides image conversion via ImageMagick (magick or convert).
Package imagemagick provides image conversion via ImageMagick (magick or convert).
backend/backends/jq
Package jq provides JSON formatting/transformation via the jq binary.
Package jq provides JSON formatting/transformation via the jq binary.
backend/backends/libjxl
Package libjxl provides JPEG XL conversion via cjxl and djxl.
Package libjxl provides JPEG XL conversion via cjxl and djxl.
backend/backends/libreoffice
Package libreoffice provides a backend that delegates to soffice (LibreOffice).
Package libreoffice provides a backend that delegates to soffice (LibreOffice).
backend/backends/pandoc
Package pandoc provides a backend that delegates conversions to pandoc.
Package pandoc provides a backend that delegates conversions to pandoc.
backend/backends/pdfcpu
Package pdfcpu provides PDF manipulation via the pdfcpu binary.
Package pdfcpu provides PDF manipulation via the pdfcpu binary.
backend/backends/plugin
Package plugin discovers and registers external convertr-* executables as backends.
Package plugin discovers and registers external convertr-* executables as backends.
backend/backends/resvg
Package resvg provides SVG to PNG rendering via resvg.
Package resvg provides SVG to PNG rendering via resvg.
backend/backends/tesseract
Package tesseract provides OCR via the tesseract binary.
Package tesseract provides OCR via the tesseract binary.
backend/backends/textutil
Package textutil provides a macOS-native backend using the textutil(1) command.
Package textutil provides a macOS-native backend using the textutil(1) command.
backend/backends/yq
Package yq provides YAML/JSON/TOML conversion via the yq binary.
Package yq provides YAML/JSON/TOML conversion via the yq binary.
cli
config
Package config loads and merges convertr configuration.
Package config loads and merges convertr configuration.
fonts
Package fonts defines the font preferences consumed by PDF-producing backends.
Package fonts defines the font preferences consumed by PDF-producing backends.
formats
Package formats defines the canonical format registry used for routing.
Package formats defines the canonical format registry used for routing.
progress
Package progress provides progress reporting for batch conversions.
Package progress provides progress reporting for batch conversions.
server/ui
templ: version: v0.3.1020
templ: version: v0.3.1020
tui
watch
Package watch provides file system watching with debouncing for convertr watch mode.
Package watch provides file system watching with debouncing for convertr watch mode.
xdg
pkg
plugin
Package plugin defines the public protocol for convertr external plugins.
Package plugin defines the public protocol for convertr external plugins.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL