from https://github.com/tesserato/CodeWeaver/edit/main/README.md:
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.
.git
, build artifacts, specific file types).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/CodeWeaver@vX.Y.Z
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.