docs for lmcat v0.0.1

Contents

lmcat

A Python tool for concatenating files and directory structures into a single document, perfect for sharing code with language models. It respects .gitignore and .lmignore patterns and provides configurable output formatting.

Features

Installation

Install from PyPI:

pip install lmcat

Usage

Basic usage - concatenate current directory:

python -m lmcat

The output will include a directory tree and the contents of each non-ignored file.

Command Line Options

Configuration

lmcat can be configured using any of these files (in order of precedence):

  1. pyproject.toml (under [tool.lmcat])
  2. lmcat.toml
  3. lmcat.json

Configuration options:

[tool.lmcat]
tree_divider = "│   "    # Used for vertical lines in the tree
indent = "    "          # Used for indentation
file_divider = "├── "    # Used for file/directory entries
content_divider = "``````" # Used to delimit file contents
include_gitignore = true # Whether to respect .gitignore files
tree_only = false       # Whether to only show the tree

Ignore Patterns

lmcat supports two types of ignore files:

  1. .gitignore - Standard Git ignore patterns (used by default)
  2. .lmignore - Custom ignore patterns specific to lmcat

.lmignore follows the same pattern syntax as .gitignore. Patterns in .lmignore take precedence over .gitignore.

Example .lmignore:

# Ignore all .log files
*.log

# Ignore the build directory and its contents
build/

# Un-ignore a specific file (overrides previous patterns)
!important.log

Development

Setup

  1. Clone the repository:
git clone https://github.com/mivanit/lmcat
cd lmcat
  1. Set up the development environment:
make setup

This will: - Create a virtual environment - Install development dependencies - Set up pre-commit hooks

Development Commands

The project uses make for common development tasks:

Run make help to see all available commands.

Running Tests

make test

For verbose output:

VERBOSE=1 make test

For test coverage:

make cov

Roadmap

API Documentation

View Source on GitHub

lmcat

lmcat

A Python tool for concatenating files and directory structures into a single document, perfect for sharing code with language models. It respects .gitignore and .lmignore patterns and provides configurable output formatting.

Features

Installation

Install from PyPI:

pip install lmcat

Usage

Basic usage - concatenate current directory:

python -m lmcat

The output will include a directory tree and the contents of each non-ignored file.

Command Line Options
Configuration

lmcat can be configured using any of these files (in order of precedence):

  1. pyproject.toml (under [tool.lmcat])
  2. lmcat.toml
  3. lmcat.json

Configuration options:

[tool.lmcat]
tree_divider = "│   "    # Used for vertical lines in the tree
indent = "    "          # Used for indentation
file_divider = "├── "    # Used for file/directory entries
content_divider = "``````" # Used to delimit file contents
include_gitignore = true # Whether to respect .gitignore files
tree_only = false       # Whether to only show the tree
Ignore Patterns

lmcat supports two types of ignore files:

  1. .gitignore - Standard Git ignore patterns (used by default)
  2. .lmignore - Custom ignore patterns specific to lmcat

.lmignore follows the same pattern syntax as .gitignore. Patterns in .lmignore take precedence over .gitignore.

Example .lmignore:

### Ignore all .log files
*.log

### Ignore the build directory and its contents
build/

### Un-ignore a specific file (overrides previous patterns)
!important.log

Development

Setup
  1. Clone the repository:
git clone https://github.com/mivanit/lmcat
cd lmcat
  1. Set up the development environment:
make setup

This will: - Create a virtual environment - Install development dependencies - Set up pre-commit hooks

Development Commands

The project uses make for common development tasks:

Run make help to see all available commands.

Running Tests
make test

For verbose output:

VERBOSE=1 make test

For test coverage:

make cov
Roadmap

View Source on GitHub

def main

() -> None

View Source on GitHub

Main entry point for the script