Skip to main content

AutoMarkdown

Intelligently convert codebases into markdown for LLMs to process and provide optimal insights

npm version PyPI version License: MIT GitHub stars

AutoMarkdown is a powerful tool that converts entire codebases into well-structured markdown documents, making it easy for Large Language Models (LLMs) to understand and analyze your code. Perfect for getting comprehensive insights, code reviews, documentation generation, and architectural analysis from AI assistants.

Features

  • Intelligent File Prioritization - Automatically ranks files by importance (README, configs, entry points first)
  • Project Structure Visualization - Creates a clear tree view of your codebase
  • Language Detection - Supports 25+ programming languages with syntax highlighting
  • Highly Configurable - Customize inclusion/exclusion patterns, file size limits, and more
  • Dual Platform Support - Available as both NPX (Node.js) and pip (Python) packages
  • Metadata Rich - Includes file statistics, language info, and importance scores
  • Gitignore Aware - Respects your .gitignore files automatically
  • Multiple Output Formats - Markdown or JSON output options

Quick Start

NPX (Node.js)

# Convert current directory
npx automarkdown .

# Convert specific project
npx automarkdown /path/to/project

# Save to file
npx automarkdown . -o my-project-docs.md

# JSON output
npx automarkdown . -f json -o project-data.json

pip (Python)

# Install
pip install automarkdown

# Convert current directory
automarkdown convert .

# Convert specific project
automarkdown convert /path/to/project

# Save to file
automarkdown convert . -o my-project-docs.md

# JSON output
automarkdown convert . -f json -o project-data.json

Installation

Node.js/NPX

# No installation needed - use directly with npx
npx automarkdown --help

# Or install globally
npm install -g automarkdown

Python/pip

pip install automarkdown

Usage Examples

Basic Usage

# Analyze current project
automarkdown .

# Analyze specific directory
automarkdown /Users/john/my-awesome-project

# Save output to file
automarkdown . --output project-analysis.md

Advanced Configuration

# Include hidden files
automarkdown . --include-hidden

# Custom file size limit (2MB)
automarkdown . --max-size 2097152

# Custom exclude patterns
automarkdown . --exclude "*.test.js,coverage/**,docs/**"

# Custom include patterns
automarkdown . --include "src/**,lib/**,*.md"

# JSON output for programmatic use
automarkdown . --format json --output project.json

Configuration File

Create automarkdown.config.json:

{
  \"include_hidden\": false,
  \"max_file_size\": 1048576,
  \"exclude_patterns\": [
    \"node_modules/**\",
    \".git/**\",
    \"dist/**\",
    \"build/**\",
    \"*.log\",
    \"coverage/**\"
  ],
  \"include_patterns\": [\"**/*\"],
  \"output_format\": \"markdown\",
  \"prioritize_files\": [
    \"README.md\",
    \"package.json\",
    \"requirements.txt\",
    \"main.py\",
    \"index.js\"
  ],
  \"include_metadata\": true
}

Perfect for LLMs

AutoMarkdown creates markdown that's optimized for Large Language Models:

Structured Output

  • Clear section headers and navigation
  • Table of contents with file links
  • Hierarchical project structure
  • Metadata for each file

Intelligence Built-in

  • Files ordered by importance
  • Smart language detection
  • Automatic gitignore respect
  • Configurable exclusion patterns

Rich Context

  • Project statistics and summary
  • File importance scores
  • Language distribution
  • Size and complexity metrics

CLI Options

NPX Version

automarkdown <path> [options]

Options:
  -o, --output <file>     Output file path (default: stdout)
  -f, --format <format>   Output format: markdown or json (default: markdown)
  --include-hidden        Include hidden files and directories
  --max-size <size>       Maximum file size in bytes (default: 1048576)
  --exclude <patterns>    Comma-separated exclude patterns
  --include <patterns>    Comma-separated include patterns
  --no-metadata          Exclude file metadata from output

Commands:
  init                    Create configuration file
  examples               Show usage examples

Python Version

automarkdown convert <path> [options]

Options:
  -o, --output PATH       Output file path (default: stdout)
  -f, --format [markdown|json]  Output format (default: markdown)
  --include-hidden        Include hidden files and directories
  --max-size INTEGER      Maximum file size in bytes (default: 1048576)
  --exclude TEXT          Comma-separated exclude patterns
  --include TEXT          Comma-separated include patterns
  --no-metadata          Exclude file metadata from output

Commands:
  init                    Create configuration file
  examples               Show usage examples

Example Output

# MyProject - Codebase Documentation

> Generated by autoMarkdown - Intelligent codebase to markdown converter

## Table of Contents
- [Project Summary](#project-summary)
- [Project Structure](#project-structure)
- [File Contents](#file-contents)
  - [package.json](#file-1-package-json)
  - [src/index.js](#file-2-src-index-js)
  - [README.md](#file-3-readme-md)

## Project Summary
Project contains 15 files in 3 different languages (javascript, markdown, json). 
Total size: 45.67 KB.

### Key Statistics
- **Total Files**: 15
- **Languages**: javascript, markdown, json
- **Total Size**: 45.67 KB
- **Most Important Files**: package.json, src/index.js, README.md

## Project Structure

├── MyProject │ ├── package.json │ ├── README.md │ └── src │ ├── index.js │ └── utils.js


## File Contents

### File 1: `package.json`
**Language**: json | **Size**: 456 bytes | **Importance**: 8.5/10

```json
{
  \"name\": \"my-project\",
  \"version\": \"1.0.0\"
}

## Supported Languages

AutoMarkdown intelligently detects and highlights 25+ programming languages:

- **Web**: JavaScript, TypeScript, HTML, CSS, SCSS, Vue, Svelte
- **Backend**: Python, Java, C/C++, C#, Go, Rust, PHP, Ruby
- **Mobile**: Swift, Kotlin, Scala
- **Shell**: Bash, Zsh, Fish, PowerShell
- **Data**: SQL, JSON, YAML, TOML, XML
- **Docs**: Markdown, Text
- **Config**: Dockerfile, INI files

## Use Cases

### AI Code Reviews
```bash
automarkdown . -o codebase.md
# Share codebase.md with Claude, GPT-4, or other LLMs for comprehensive code review

Documentation Generation

automarkdown . --exclude \"**/*.test.*,docs/**\" -o architecture-overview.md
# Generate clean architectural documentation

Legacy Code Analysis

automarkdown /path/to/legacy-project --include-hidden -o legacy-analysis.md
# Get AI insights on complex legacy codebases

Project Insights

automarkdown . -f json -o project-data.json
# Programmatic analysis of codebase structure and metrics

Contributing

We welcome contributions! Please see our Contributing Guide for details.

  1. Fork the 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.

Acknowledgments

  • Thanks to all contributors who help make AutoMarkdown better
  • Inspired by the need for better AI-codebase interaction
  • Built with love for the developer community

Links


Made by harshpreet931

AutoMarkdown - Making codebases AI-friendly, one conversion at a time.

Metadata

Release files for automarkdown 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for automarkdown 1.0.2
File Size Uploaded Provenance
automarkdown-1.0.2.tar.gz 14.3 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for automarkdown 1.0.2
File Interpreter ABI Platform
automarkdown-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 27.8 kB

Release files / automarkdown-1.0.2.tar.gz

Download URL automarkdown-1.0.2.tar.gz
Size 14.3 kB
Tags Source
SHA-256 checksum
How to use checksums
47a3f463523422a08ab55166c52eacca17ec43e8a86a1b2c446c85c936b5eb1b
BLAKE2b-256 checksum
How to use checksums
9b877a4aee0b727f6c620cfcda2ca8268a0b5ed768977e4ace339610f81e93de
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Release files / automarkdown-1.0.2-py3-none-any.whl

Download URL automarkdown-1.0.2-py3-none-any.whl
Size 13.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6242a23c3334189bb6cbadf7e7fb3e9ec2e575101ece9c99aa175447b83ced01
BLAKE2b-256 checksum
How to use checksums
7c15cc48028c37aac0c76b63e7e7a2b121b17e18ed580c648754e8f8fc6c354c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.13.7

Security for automarkdown 1.0.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page