Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/spookyuser/repototextrs
https://github.com/spookyuser/repototextrs
Last synced: 18 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/spookyuser/repototextrs
- Owner: spookyuser
- License: mit
- Created: 2024-03-24T14:32:31.000Z (9 months ago)
- Default Branch: master
- Last Pushed: 2024-06-24T13:50:36.000Z (6 months ago)
- Last Synced: 2024-12-15T22:44:08.576Z (19 days ago)
- Language: Rust
- Size: 32.2 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: LICENSE
Awesome Lists containing this project
README
# RepoToText
RepoToText is a Rust-based command-line tool that converts the structure and files of a repository into a text file probably for uploading to an llm.
Inspired by [this](https://github.com/JeremiahPetersen/RepoToText)
## Features
- Converts repository structure and files to text.
- Allows you to specify include and exclude glob patterns for files.
- Reads .gitignore file if present and excludes those files.
- Allows you to specify the output file path.
- If no output file path is provided, it generates a default one in the /tmp directory.
- Prints the directory structure using the `tree` command.## Usage
Run the `repototext` command with the following arguments:
- `repo_path`: Path to the repository (required).
- `output_path`: Path to the output text file (optional).
- `package_name`: Name of the package to include in the output file headers (optional).
- `include`: Glob pattern for including files (e.g., '**/*.rs') (optional).
- `exclude`: Glob pattern for excluding files (e.g., 'node_modules/**') (optional).Example:
```sh
cargo run -- repo_path output_path package_name --include '**/*.rs' --exclude 'node_modules/**'
```## Environment Variables
You can also specify include and exclude glob patterns through the following environment variables:
- `REPOTOTEXT_INCLUDE_GLOBS`: Glob pattern for including files.
- `REPOTOTEXT_EXCLUDE_GLOBS`: Glob pattern for excluding files.
- `REPOTOTEXT_TREE_EXCLUDES`: Directories to exclude from the `tree` command.## Building
To build the project, run:
```sh
cargo build
```## License
This project is licensed under the MIT License.