https://github.com/jaennil/codex
Code Extractor
https://github.com/jaennil/codex
code extractor llm
Last synced: 4 months ago
JSON representation
Code Extractor
- Host: GitHub
- URL: https://github.com/jaennil/codex
- Owner: jaennil
- Created: 2025-05-21T10:19:16.000Z (8 months ago)
- Default Branch: main
- Last Pushed: 2025-06-29T18:26:36.000Z (7 months ago)
- Last Synced: 2025-08-16T14:36:26.729Z (6 months ago)
- Topics: code, extractor, llm
- Language: Rust
- Homepage:
- Size: 8.79 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Codex
This Rust program, `codex`, recursively traverses a specified directory and concatenates the contents of files with code extensions into a single output file named `code`. It's useful for collecting code to paste into large language models (LLMs) for analysis or debugging.
## Installation
1. Ensure you have [Rust](https://rustup.rs/) installed.
2. Clone the repository or copy the source code.
3. Run the following command to build and install the program:
```bash
make build-install
```
This compiles the program and copies binary to `/usr/local/bin` making it available for use.
## Usage
1. **Run the program**:
```bash
codex
```
Replace `` with the path to the directory you want to scan.
2. **Output**:
- Creates a `code` file in the current directory.
- For each file with a matching extension, it writes:
- The full path of the file.
- The file's contents.
- A blank line separator.
3. **Example**:
```bash
codex ./src
```
Scans the `./src` directory and writes contents of matching files to `code`.
## Requirements
- **Rust**: Install via [rustup](https://rustup.rs/).
- A valid directory path as a command-line argument.
## TODO
- Add support for processing GitHub URLs to fetch and include code from repositories.
- Implement a feature to copy the contents of the `code` file to the clipboard for easy pasting into LLMs.
- Update the search to ignore `.gitignore` files.
- Add support for including `Makefile` and other usefull files without extension in the output.