docs for
lmcatv0.0.1
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.
.gitignore patterns (can be disabled).lmignorepyproject.toml,
lmcat.toml, or lmcat.jsonInstall from PyPI:
pip install lmcatBasic usage - concatenate current directory:
python -m lmcatThe output will include a directory tree and the contents of each non-ignored file.
-g, --no-include-gitignore: Ignore
.gitignore files (they are included by default)-t, --tree-only: Only print the directory
tree, not file contents-o, --output: Specify an output file
(defaults to stdout)-h, --help: Show help messagelmcat can be configured using any of these files (in order of precedence):
pyproject.toml (under [tool.lmcat])lmcat.tomllmcat.jsonConfiguration 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 treelmcat supports two types of ignore files:
.gitignore - Standard Git ignore patterns (used by
default).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
git clone https://github.com/mivanit/lmcat
cd lmcatmake setupThis will: - Create a virtual environment - Install development dependencies - Set up pre-commit hooks
The project uses make for common development tasks:
make dep: Install/update dependenciesmake format: Format code using ruff and pyclnmake test: Run testsmake typing: Run type checksmake check: Run all checks (format, test, typing)make clean: Clean temporary filesmake docs: Generate documentationmake build: Build the packagemake publish: Publish to PyPI (maintainers only)Run make help to see all available commands.
make testFor verbose output:
VERBOSE=1 make testFor test coverage:
make cov.lmsummary/lmcatA 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.
.gitignore patterns (can be disabled).lmignorepyproject.toml,
lmcat.toml, or lmcat.jsonInstall from PyPI:
pip install lmcatBasic usage - concatenate current directory:
python -m lmcatThe output will include a directory tree and the contents of each non-ignored file.
-g, --no-include-gitignore: Ignore
.gitignore files (they are included by default)-t, --tree-only: Only print the directory
tree, not file contents-o, --output: Specify an output file
(defaults to stdout)-h, --help: Show help messagelmcat can be configured using any of these files (in order of precedence):
pyproject.toml (under [tool.lmcat])lmcat.tomllmcat.jsonConfiguration 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 treelmcat supports two types of ignore files:
.gitignore - Standard Git ignore patterns (used by
default).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
git clone https://github.com/mivanit/lmcat
cd lmcatmake setupThis will: - Create a virtual environment - Install development dependencies - Set up pre-commit hooks
The project uses make for common development tasks:
make dep: Install/update dependenciesmake format: Format code using ruff and pyclnmake test: Run testsmake typing: Run type checksmake check: Run all checks (format, test, typing)make clean: Clean temporary filesmake docs: Generate documentationmake build: Build the packagemake publish: Publish to PyPI (maintainers only)Run make help to see all available commands.
make testFor verbose output:
VERBOSE=1 make testFor test coverage:
make cov.lmsummary/def main() -> NoneMain entry point for the script