top

mdctl - A CLI Tool for Markdown File Operations

mdctl logo

An AI-powered CLI tool to enhance your Markdown workflow, with auto-image downloading, translation, and more features coming soon!

Build Status Release Version go report MIT License Ask DeepWiki

Key Features

Installation

Use Homebrew to install mdctl. Follow the Homebrew Installation Guide to install Homebrew.

brew tap samzong/tap
brew install samzong/tap/mdctl

Or use go to install mdctl.

go install github.com/samzong/mdctl@latest

Usage

Quick examples for common tasks:

Downloading Images

# Process a single file
mdctl download -f path/to/your/file.md

# Process a directory
mdctl download -d path/to/your/directory

Translating I18n

# Translate to Chinese
mdctl translate -f README.md -l zh

# Translate a directory to Japanese
mdctl translate -d docs/ -l ja

Uploading Images to Cloud Storage

# Upload images from a file
mdctl upload -f post.md

# Upload images from a directory
mdctl upload -d docs/

Exporting Documents to .docx

# Export to DOCX
mdctl export -f README.md -o output.docx

# Export to PDF with table of contents
mdctl export -d docs/ -o documentation.pdf -F pdf --toc

Generating llms.txt from sitemap.xml

# Standard mode (titles and descriptions)
mdctl llmstxt https://example.com/sitemap.xml > llms.txt

# Full-content mode
mdctl llmstxt -f https://example.com/sitemap.xml > llms-full.txt

Developer's Guide

If you are interested in contributing, please refer to the DEVELOPMENT.md file for a complete technical architecture, component design, and development guide.

Contributing

Welcome to contribute code, report issues, or suggest features! Please follow these steps:

  1. Fork this repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.