CodeWeaver is a command-line tool designed to weave your codebase into a single, easy-to-navigate Markdown document. It recursively scans a directory, generating a structured representation of your project's file hierarchy and embedding the content of each file within code blocks. This tool simplifies codebase sharing, documentation, and integration with AI/ML code analysis tools by providing a consolidated and readable Markdown output. The output for the current repository can be found here.
- Comprehensive Codebase Documentation: Generates a Markdown file that meticulously outlines your project's directory and file structure in a clear, tree-like format.
- Code Content Inclusion: Embeds the complete content of each file directly within the Markdown document, enclosed in syntax-highlighted code blocks based on file extensions.
- Flexible Path Filtering: Utilize regular expressions to define ignore patterns, allowing you to exclude specific files and directories from the generated documentation (e.g.,
.git
, build artifacts, specific file types). - Optional Path Logging: Choose to save lists of included and excluded file paths to separate files for detailed tracking and debugging of your ignore rules.
- Simple Command-Line Interface: Offers an intuitive command-line interface with straightforward options for customization.
If you have Go installed, run go install github.com/tesserato/CodeWeaver@latest
to install the latest version of CodeWeaver or go install github.com/tesserato/[email protected]
to install a specific version.
Alternatively, download the appropriate pre built executable from the releases page.
If necessary, make the codeweaver
executable by using the chmod
command:
chmod +x codeweaver
codeweaver -h
codeweaver [options]
Options:
Option | Description | Default Value |
---|---|---|
-dir <directory> |
The root directory to scan and document. | Current directory (. ) |
-output <filename> |
The name of the output Markdown file. | codebase.md |
-ignore "<regex patterns>" |
Comma-separated list of regular expression patterns for paths to exclude. | \.git.* |
-included-paths-file <filename> |
File to save the list of paths that were included in the documentation. | None |
-excluded-paths-file <filename> |
File to save the list of paths that were excluded from the documentation. | None |
-help |
Display this help message and exit. |
./codeweaver
This will create a file named codebase.md
in the current directory, documenting the structure and content of the current directory and its subdirectories (excluding paths matching the default ignore pattern \.git.*
).
./codeweaver -dir=my_project -output=project_docs.md
This command will process the my_project
directory and save the documentation to project_docs.md
.
./codeweaver -ignore="\.log,temp,build" -output=detailed_docs.md
This example will generate detailed_docs.md
, excluding any files or directories with names containing .log
, temp
, or build
. Regular expression patterns are comma-separated.
./codeweaver -ignore="node_modules" -included-paths-file=included.txt -excluded-paths-file=excluded.txt -output=code_overview.md
This command will create code_overview.md
while also saving the list of included paths to included.txt
and the list of excluded paths (due to the node_modules
ignore pattern) to excluded.txt
.
Contributions are welcome! If you encounter any issues, have suggestions for new features, or want to improve CodeWeaver, please feel free to open an issue or submit a pull request on the project's GitHub repository.
CodeWeaver is released under the MIT License. See the LICENSE
file for complete license details.
- ai-context - https://github.com/tanq16/ai-context
- bundle-codebases - https://github.com/manfrin/bundle-codebases
- code2prompt - https://github.com/mufeedvh/code2prompt
- code2text - https://github.com/forrest321/code2text
- codefetch - https://github.com/regenrek/codefetch
- copcon - https://github.com/kasperjunge/copcon
- describe - https://github.com/rodlaf/describe
- feed-llm - https://github.com/nahco314/feed-llm
- files-to-prompt - https://github.com/simonw/files-to-prompt
- ggrab - https://github.com/keizo/ggrab
- gitingest - https://gitingest.com/
- gitpodcast - https://gitpodcast.com
- globcat.sh - https://github.com/jzombie/globcat.sh
- grimoire - https://github.com/foresturquhart/grimoire
- llmcat - https://github.com/azer/llmcat
- RepoMix - https://github.com/yamadashy/repomix
- techdocs - https://github.com/thesurlydev/techdocs
- thisismy - https://github.com/franzenzenhofer/thisismy
- yek - https://github.com/bodo-run/yek
- your-source-to-prompt - https://github.com/Dicklesworthstone/your-source-to-prompt.html
- ingest - https://github.com/sammcj/ingest
- onefilellm - https://github.com/jimmc414/onefilellm
- repo2file - https://github.com/artkulak/repo2file
- code2prompt - https://github.com/mufeedvh/code2prompt
- clipsource - https://github.com/strizzo/clipsource
- r2md - https://crates.io/crates/r2md
- repo2txt - https://chathub.gg/repo2txt
- repo2txt - https://repo2txt.simplebasedomain.com/local.html
- repoprompt - https://www.repoprompt.com
- Codebase to Markdown - https://marketplace.visualstudio.com/items?itemName=DVYIO.combine-open-files