docs: update installation instructions and usage examples in README
This commit is contained in:
89
README.md
89
README.md
@@ -1,5 +1,8 @@
|
|||||||
# Codebase to Prompt
|
# Codebase to Prompt
|
||||||
|
|
||||||
|
[](https://github.com/GKaszewski/codebase-to-prompt/actions/workflows/ci.yml)
|
||||||
|
[](https://github.com/GKaszewski/codebase-to-prompt/actions/workflows/release.yml)
|
||||||
|
|
||||||
`codebase-to-prompt` is a Rust-based CLI tool designed to bundle files from a directory into a single output file. It supports filtering files by extensions, respecting `.gitignore` rules, and formatting the output in Markdown, plain text, or console-friendly formats.
|
`codebase-to-prompt` is a Rust-based CLI tool designed to bundle files from a directory into a single output file. It supports filtering files by extensions, respecting `.gitignore` rules, and formatting the output in Markdown, plain text, or console-friendly formats.
|
||||||
|
|
||||||
## Features
|
## Features
|
||||||
@@ -14,17 +17,41 @@
|
|||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
1. Ensure you have [Rust](https://www.rust-lang.org/) installed.
|
There are multiple ways to install `codebase-to-prompt`.
|
||||||
2. Clone this repository:
|
|
||||||
```bash
|
### Option 1: Using `cargo install` (Recommended for Rust developers)
|
||||||
git clone https://github.com/GKaszewski/codebase-to-prompt
|
|
||||||
cd codebase-to-prompt
|
If you have the Rust toolchain installed, you can easily install the latest version from [crates.io](https://crates.io/):
|
||||||
```
|
|
||||||
3. Build the project:
|
```bash
|
||||||
```bash
|
cargo install codebase-to-prompt
|
||||||
cargo build --release
|
```
|
||||||
```
|
|
||||||
4. The binary will be available at `target/release/codebase-to-prompt`.
|
### Option 2: Using the Install Script (for Linux & macOS)
|
||||||
|
|
||||||
|
You can download and run the installation script, which will install the latest release binary for your system:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
curl -fsSL https://raw.githubusercontent.com/GKaszewski/codebase-to-prompt/main/install.sh | sh
|
||||||
|
```
|
||||||
|
|
||||||
|
### Option 3: From GitHub Releases
|
||||||
|
|
||||||
|
You can download the pre-compiled binary for your operating system directly from the [Releases page](https://github.com/GKaszewski/codebase-to-prompt/releases).
|
||||||
|
|
||||||
|
### Option 4: Building from Source
|
||||||
|
|
||||||
|
1. Ensure you have [Rust](https://www.rust-lang.org/) installed.
|
||||||
|
2. Clone this repository:
|
||||||
|
```bash
|
||||||
|
git clone https://github.com/GKaszewski/codebase-to-prompt
|
||||||
|
cd codebase-to-prompt
|
||||||
|
```
|
||||||
|
3. Build the project:
|
||||||
|
```bash
|
||||||
|
cargo build --release
|
||||||
|
```
|
||||||
|
4. The binary will be available at `target/release/codebase-to-prompt`.
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
|
|
||||||
@@ -48,22 +75,23 @@ codebase-to-prompt [OPTIONS] [DIRECTORY]
|
|||||||
|
|
||||||
### Examples
|
### Examples
|
||||||
|
|
||||||
1. Bundle all `.rs` files in the current directory into `output.md` in Markdown format:
|
1. Bundle all `.rs` files in the current directory into `output.md` in Markdown format:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
codebase-to-prompt -o output.md -i rs --format markdown
|
codebase-to-prompt -o output.md -i rs
|
||||||
```
|
```
|
||||||
|
|
||||||
2. Bundle all files except `.log` files, appending the current date and Git hash to the output file name:
|
2. Bundle all files except `.log` files, appending the current date and Git hash to the output file name:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
codebase-to-prompt -o output.txt -e log -d -g
|
codebase-to-prompt -o output.txt -e log -d -g
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Output all files to the console, including line numbers:
|
3. Output all files to the console, including line numbers:
|
||||||
```bash
|
|
||||||
codebase-to-prompt -l
|
```bash
|
||||||
```
|
codebase-to-prompt -l
|
||||||
|
```
|
||||||
|
|
||||||
## Development
|
## Development
|
||||||
|
|
||||||
@@ -87,19 +115,6 @@ To run tests:
|
|||||||
cargo test
|
cargo test
|
||||||
```
|
```
|
||||||
|
|
||||||
### Code Structure
|
|
||||||
|
|
||||||
- `src/lib.rs`: Core logic for file processing and bundling.
|
|
||||||
- `src/main.rs`: CLI entry point.
|
|
||||||
|
|
||||||
### Adding Dependencies
|
|
||||||
|
|
||||||
To add a new dependency, update `Cargo.toml` and run:
|
|
||||||
|
|
||||||
```bash
|
|
||||||
cargo build
|
|
||||||
```
|
|
||||||
|
|
||||||
### Linting and Formatting
|
### Linting and Formatting
|
||||||
|
|
||||||
To lint the code:
|
To lint the code:
|
||||||
@@ -120,4 +135,4 @@ This project is licensed under the MIT License. See the [LICENSE](LICENSE) file
|
|||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
Contributions are welcome! Feel free to open issues or submit pull requests.
|
Contributions are welcome\! Feel free to open issues or submit pull requests.
|
||||||
|
Reference in New Issue
Block a user