https://github.com/ever0de/fcat-rs
The CLI tool for turning your codebase into a single, copy-pasteable context for LLMs
https://github.com/ever0de/fcat-rs
Last synced: 4 days ago
JSON representation
The CLI tool for turning your codebase into a single, copy-pasteable context for LLMs
- Host: GitHub
- URL: https://github.com/ever0de/fcat-rs
- Owner: ever0de
- License: apache-2.0
- Created: 2025-07-16T05:05:38.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2025-07-16T07:50:23.000Z (12 months ago)
- Last Synced: 2025-07-17T08:20:40.743Z (12 months ago)
- Language: Rust
- Homepage:
- Size: 31.3 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# fcat
`fcat` is a command-line utility that recursively scans directories, processes files, and consolidates the contents of all found files into a single text file or directly to your clipboard.
It's designed to make it easy to gather project context, create source code archives, or generate project overviews. Its primary use case is to quickly create a single context file that can be pasted into a prompt for a Large Language Model (LLM), providing the AI with the full context of a project.
## Installation
### Cargo
TODO:
### From Source
Alternatively, you can build it from the source code:
1. Clone the repository:
```bash
git clone https://github.com/ever0de/fcat-rs.git
cd fcat-rs
```
2. Build and install the binary:
```bash
cargo install --path .
```
## Usage
The basic command structure is simple:
```bash
fcat [OPTIONS] ...
```
### Arguments
| Argument | Description |
| -------- | -------------------------------------------------------------------------------------------------------- |
| `...` | One or more paths to target directories or files. Supports shell-expanded glob patterns (e.g., `src/**/*.rs`). |
### Options
| Option | Short | Description | Default |
| ---------------------- | ----- | ------------------------------------------------------------------ | ------------- |
| `--output-file` | `-o` | The path for the output file. | `bundler.txt` |
| `--clipboard` | `-c` | Copy the output directly to the clipboard instead of a file. | (disabled) |
| `--exclude-dir` | `-e` | A specific directory to exclude from the scan. | (none) |
| `--no-default-ignores` | | Disables the default ignore list (includes `.git`, `target`, etc.). | (disabled) |
| `--help` | `-h` | Print help information. | |
| `--version` | `-V` | Print version information. | |
### Examples
**1. Copy Current Directory to Clipboard**
This is the most common use case. Run this command in your project's root directory. It will bundle the project's contents and copy the result directly to your clipboard.
```bash
fcat . -c
```
**2. Select Specific Files and Directories**
You can specify multiple paths. For example, to bundle all files in the `src` directory and the `Cargo.toml` file:
```bash
fcat src Cargo.toml -c
```
**3. Use Glob Patterns to Select Files**
Use your shell's globbing capabilities to select files with specific patterns. For example, to bundle all `.rs` files in the `src` directory and the `Cargo.toml` file:
```bash
fcat src/**/*.rs Cargo.toml -c
```
*(Note: Glob pattern behavior may vary slightly depending on your shell, e.g., zsh, bash.)*
**4. Generate an Output File**
If you prefer to save the context to a file, omit the `-c` or `--clipboard` flag. This command will create a `bundler.txt` file.
```bash
fcat .
```
**5. Exclude an Additional Directory**
Bundle the project but also ignore the `docs` folder, in addition to the default ignores.
```bash
fcat . -c --exclude-dir ./docs
```
## Output Format
`fcat` wraps the content of each file with a simple header and footer indicating the file's path. This makes the resulting bundle easy to read and parse.
**Example output:**
```text
fn main() {
println!("Hello from main!");
}
pub fn a_helpful_function() -> bool {
true
}
```