# Condensed CLI

A flexible Node.js CLI tool to compile multiple files from a folder into a single file or clipboard, with robust gitignore-like filtering.

## 🚀 Features

- 📁 Compile multiple files from a source directory into a single output
- 🔍 Respect `.gitignore` rules automatically
- 📋 Option to copy compiled content directly to clipboard
- 🧩 Flexible ignore pattern support
- 💻 Easy-to-use command-line interface

## 📦 Installation

You can install the package globally using npm:

```bash
npm install -g condensed
```

Or install it as a dev dependency in your project:

```bash
npm install --save-dev condensed
```

## 💡 Usage

### Basic Usage

Compile files from a source directory to an output file:

```bash
condensed /path/to/source /path/to/output.txt
```

### Copy to Clipboard

Compile files and copy directly to clipboard:

```bash
condensed /path/to/source -c
```

### Additional Ignore Patterns

Add custom ignore patterns alongside `.gitignore`:

```bash
condensed /path/to/source /path/to/output.txt -i "node_modules,*.log"
```

## 🔧 CLI Options

| Option        | Shorthand | Description                                  | Example                   |
| ------------- | --------- | -------------------------------------------- | ------------------------- |
| `--output`    | `-o`      | Specify output file path                     | `-o compiled.txt`         |
| `--ignore`    | `-i`      | Additional ignore patterns (comma-separated) | `-i "node_modules,*.log"` |
| `--clipboard` | `-c`      | Copy output to clipboard                     | `-c`                      |

## 📝 Example Scenarios

1. Compile a project's source code:

```bash
condensed ./src ./combined-source.txt
```

2. Copy TypeScript files to clipboard, excluding test files:

```bash
condensed ./src -c -i "**/*.test.ts,**/*.spec.ts"
```

## 🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

### Development Setup

1. Clone the repository
2. Install dependencies: `npm install`
3. Build the project: `npm run build`
4. Run tests: `npm test`

## 📄 License

MIT License

## 🐛 Issues

Found a bug? Please file an issue on our GitHub repository.
