Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 13 additions & 6 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
# Changelog

All notable changes to POWERcat are documented in this file.
All notable changes to PowerCat are documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]

### ✨ Added
- `-WhatIf` (Dry-run) mode to preview files before bundling.
- `-IncludeTree` to prepend a directory structure tree to the output.
- Global/User `.catignore` support via `$HOME/.catignore` or `CATIGNORE_PATH`.
- `-Verbose` output for tracking processing progress.

## [2.0.0] - 2025-12-21

### ⚠️ Breaking
Expand All @@ -20,7 +28,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
### ✅ Improved

- Positional `SourceDir` clarified as the first required parameter.
- Script wrapper (`scripts/POWERcat.ps1`) now mirrors module behavior and accepts the same flags.
- Script wrapper (`scripts/PowerCat.ps1`) now mirrors module behavior and accepts the same flags.
- Expanded Pester tests to cover new behaviors and script parity.

### 🧭 Migration
Expand All @@ -42,8 +50,8 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- **Extension filters** — Default `.md` plus switches (`-Bash`, `-PowerShell`, `-HTML`, `-CSS`, `-Lua`) or custom via `-Extensions`
- **Sorting options** — Control file order with `-Sort Name|Extension|LastWriteTime|Length`
- **Catignore support** — Exclude files and directories with a `.gitignore`-style `catignore` file
- **Command aliases** — Quick commands `POWERcat`, `pcat`, `concat` all point to `Invoke-POWERcat`
- **Native help system** — Full comment-based help via `Get-Help Invoke-POWERcat`
- **Command aliases** — Quick commands `PowerCat`, `pcat`, `concat` all point to `Invoke-PowerCat`
- **Native help system** — Full comment-based help via `Get-Help Invoke-PowerCat`
- **Cross-platform support** — Windows, Linux (via PowerShell Core), macOS

### 🛠️ Infrastructure
Expand All @@ -58,7 +66,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
- **Comprehensive README** — Overview, features, examples, and use cases
- **Native PowerShell help** — Full documentation via `Get-Help` cmdlet
- **Usage examples** — Real-world scenarios for bundling, LLM sharing, and token estimation
- **Feature comparison table** — POWERcat vs. standard `cat`/`Get-Content` for clear value proposition
- **Feature comparison table** — PowerCat vs. standard `cat`/`Get-Content` for clear value proposition

### 🎯 Features for AI & LLMs

Expand Down Expand Up @@ -90,7 +98,6 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),

- [ ] **Batch operations** — Process multiple source directories in one command
- [ ] **Custom separators** — User-defined file delimiters
- [ ] **Preview mode** — Show what would be concatenated without bundling
- [ ] **Parallel processing** — Faster bundling for large projects
- [ ] **Cloud integration** — Direct upload to cloud storage or AI services
- [ ] **GUI application** — Windows/cross-platform graphical interface
88 changes: 45 additions & 43 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
# 🐈‍⬛ POWERcat
# 🐈‍⬛ PowerCat

![POWERcat Logo](assets/banner.png)
![PowerCat Logo](assets/banner.png)

[![POWERcat CI](https://img.shields.io/github/actions/workflow/status/TheOnliestMattastic/POWERcat/pester.yml?branch=main&style=for-the-badge&label=CI%20Tests&labelColor=6272a4)](https://github.com/TheOnliestMattastic/POWERcat/actions/workflows/pester.yml)
[![PowerShell Gallery](https://img.shields.io/powershellgallery/v/POWERcat?color=bd93f9&style=for-the-badge&labelColor=6272a4)](https://www.powershellgallery.com/packages/POWERcat)
[![PowerCat CI](https://img.shields.io/github/actions/workflow/status/TheOnliestMattastic/PowerCat/pester.yml?branch=main&style=for-the-badge&label=CI%20Tests&labelColor=6272a4)](https://github.com/TheOnliestMattastic/PowerCat/actions/workflows/pester.yml)
[![PowerShell Gallery](https://img.shields.io/powershellgallery/v/PowerCat?color=bd93f9&style=for-the-badge&labelColor=6272a4)](https://www.powershellgallery.com/packages/PowerCat)
[![License: MIT](https://img.shields.io/badge/License-MIT-bd93f9?color=bd93f9&style=for-the-badge&labelColor=6272a4)](https://opensource.org/licenses/MIT)
[![Portfolio](https://img.shields.io/badge/Portfolio-bd93f9?style=for-the-badge&logo=githubpages&logoColor=white&labelColor=6272a4)](https://theonliestmattastic.github.io/)
[![GitHub](https://img.shields.io/badge/GitHub-Profile-bd93f9?style=for-the-badge&logo=github&logoColor=white&labelColor=6272a4)](https://github.com/theonliestmattastic)

## 🔭 Overview

**POWERcat** is a single-shot concatenator for bundling markdown and code into one clean text file.
**PowerCat** is a single-shot concatenator for bundling markdown and code into one clean text file.
It's the feline cousin of Unix `cat`—polished for PowerShell, built for sharing code with recruiters, collaborators, and LLMs.

> **Breaking change (v2.0.0):** POWERcat no longer includes `.md` files by default. This was an intentional, breaking change to avoid accidentally bundling documentation. To restore previous behavior, explicitly opt-in with `-IncludeMarkdown` or add `-Extensions ".md"`. See ReleaseNotes for migration guidance.
> **Breaking change (v2.0.0):** PowerCat no longer includes `.md` files by default. This was an intentional, breaking change to avoid accidentally bundling documentation. To restore previous behavior, explicitly opt-in with `-IncludeMarkdown` or add `-Extensions ".md"`. See ReleaseNotes for migration guidance.

## ✨ Features

Expand All @@ -29,81 +29,83 @@ It's the feline cousin of Unix `cat`—polished for PowerShell, built for sharin
- **Extensions:** No implicit defaults — opt-in. Use `-IncludeMarkdown` to include `.md`, or include types via switches (`-Bash`, `-PowerShell`, `-HTML`, `-CSS`, `-Lua`) or `-Extensions`.
- **Sorting:** Control file order with `-Sort Name|Extension|LastWriteTime|Length`.
- **Catignore support:** Exclude files and directories with a `.gitignore`-style `catignore` file.
- **Aliases:** Quick commands `POWERcat`, `pcat`, `concat` all point to `Invoke-POWERcat`.
- **Native help:** Full comment-based help via `Get-Help Invoke-POWERcat`.
- **WhatIf/Verbose:** Safe dry-runs and granular progress tracking.
- **IncludeTree:** Prepend directory structure for better context.
- **Aliases:** Quick commands `PowerCat`, `pcat`, `concat` all point to `Invoke-PowerCat`.
- **Native help:** Full comment-based help via `Get-Help Invoke-PowerCat`.

## 🚀 Blasting Off

### Install from PowerShell Gallery

```powershell
Install-Module -Name POWERcat -Scope CurrentUser
Import-Module POWERcat
Install-Module -Name PowerCat -Scope CurrentUser
Import-Module PowerCat
```

### Run as a cmdlet

```powershell
# Output to file (positional SourceDir)
Invoke-POWERcat "C:\Project" -OutputFile "C:\bundle.txt"
Invoke-PowerCat "C:\Project" -OutputFile "C:\bundle.txt"

# Output to stdout (and pipe to file)
Invoke-POWERcat "C:\Project" | Out-File "C:\bundle.txt"
Invoke-PowerCat "C:\Project" | Out-File "C:\bundle.txt"
```

### Aliases

```powershell
POWERcat . -o out.txt # Write to file
PowerCat . -o out.txt # Write to file
pcat . | Out-File out.txt # Pipe to file
concat . -r -f -p # Stdout with fences
```

### Help

```powershell
Get-Help Invoke-POWERcat -Full
Get-Help Invoke-POWERcat -Examples
Get-Help Invoke-PowerCat -Full
Get-Help Invoke-PowerCat -Examples
```

## Demos

See POWERcat in action:
See PowerCat in action:

### Display help with the `-h` flag

![Demo of POWERcat with help flat](https://media3.giphy.com/media/v1.Y2lkPTc5MGI3NjExYXBkZzl0bGExamhhZmRzeHNtbzk0ajh6M3VtNjhvcHZ4NWwyMzgyeCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/lvK3qtQj34pWwHch1H/giphy.gif)
![Demo of PowerCat with help flag](https://media3.giphy.com/media/v1.Y2lkPTc5MGI3NjExYXBkZzl0bGExamhhZmRzeHNtbzk0ajh6M3VtNjhvcHZ4NWwyMzgyeCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/lvK3qtQj34pWwHch1H/giphy.gif)

### Bundle files with `-Stats` and output to stdout

![Demo of POWERcat with stats flag](https://media1.giphy.com/media/v1.Y2lkPTc5MGI3NjExaGxuOHBiNDVkOTU1ZGJ5bTVsZDhhODQ0bDFrZGx2N25iYmw3eWcycCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/GGuPOvVAg61zc0WxE9/giphy.gif)
![Demo of PowerCat with stats flag](https://media1.giphy.com/media/v1.Y2lkPTc5MGI3NjExaGxuOHBiNDVkOTU1ZGJ5bTVsZDhhODQ0bDFrZGx2N25iYmw3eWcycCZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/GGuPOvVAg61zc0WxE9/giphy.gif)

### Write bundled files to `.txt` and view with `nano`

![Demo of POWERcat budling files and varifying with `nano`](https://media1.giphy.com/media/v1.Y2lkPTc5MGI3NjExd3B1dmluaDFkbTl3YWNueDA4am93Ym5vcGY3bjZpdXd3bGV1M3htbiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/BeM9Uxe31ol7EzIQ8L/giphy.gif)
![Demo of PowerCat bundling files and verifying with `nano`](https://media1.giphy.com/media/v1.Y2lkPTc5MGI3NjExd3B1dmluaDFkbTl3YWNueDA4am93Ym5vcGY3bjZpdXd3bGV1M3htbiZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/BeM9Uxe31ol7EzIQ8L/giphy.gif)

### Pipe bundled bash files to `bat` for syntax highlighting

![Demo of POWERcat piping output to `bat` with syntax highlighting](https://media4.giphy.com/media/v1.Y2lkPTc5MGI3NjExa3d5bnhhM2V1N210MmxvNDQwMzY3b3d1MW90ZHQxMTF1NDd5Y3ZmYSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/WUnH3gHQRTdDzrxxO8/giphy.gif)
![Demo of PowerCat piping output to `bat` with syntax highlighting](https://media4.giphy.com/media/v1.Y2lkPTc5MGI3NjExa3d5bnhhM2V1N210MmxvNDQwMzY3b3d1MW90ZHQxMTF1NDd5Y3ZmYSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/WUnH3gHQRTdDzrxxO8/giphy.gif)

### Pipe bundled output to `lolcat` for rainbow terminal fun

![Demo of POWERcat piping output to `lolcat`](https://media1.giphy.com/media/v1.Y2lkPTc5MGI3NjExcXJ4NmJxd2cxbWxyeTNodGFuN3Nyb2hrbzRrdjVqYWpmOW51bXFveSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/ULnasHsrwyqu2SxYVy/giphy.gif)
![Demo of PowerCat piping output to `lolcat`](https://media1.giphy.com/media/v1.Y2lkPTc5MGI3NjExcXJ4NmJxd2cxbWxyeTNodGFuN3Nyb2hrbzRrdjVqYWpmOW51bXFveSZlcD12MV9pbnRlcm5hbF9naWZfYnlfaWQmY3Q9Zw/ULnasHsrwyqu2SxYVy/giphy.gif)

## 🧪 Examples

- **Concatenate matching files to stdout (no implicit Markdown):**

```powershell
Invoke-POWERcat "C:\Project"
Invoke-PowerCat "C:\Project"
# Output streams to console; pipe to capture
Invoke-POWERcat "C:\Project" | Out-File bundle.txt
Invoke-PowerCat "C:\Project" | Out-File bundle.txt
```

- **Bundle for LLMs with minification, fences, and token stats:**

```powershell
Invoke-POWERcat "C:\Project" -Recurse -Minify -Fence -PowerShell -Stats
Invoke-PowerCat "C:\Project" -Recurse -Minify -Fence -PowerShell -Stats
```

Output includes:
Expand All @@ -113,7 +115,7 @@ Output includes:
- Token estimate (4 chars/token baseline):

```powershell
=== POWERcat Statistics ===
=== PowerCat Statistics ===
Files processed: 15
Total characters: 45,230
Estimated tokens: 11,308 (4 chars/token baseline)
Expand All @@ -123,21 +125,21 @@ Estimated tokens: 11,308 (4 chars/token baseline)
- **Write to file with JSON headers for structured parsing:**

```powershell
Invoke-POWERcat "C:\Project" -o "C:\bundle.txt" -Recurse -HeaderFormat JSON -Lua
Invoke-PowerCat "C:\Project" -o "C:\bundle.txt" -Recurse -HeaderFormat JSON -Lua
```

Output includes structured headers like `{"file":"script.lua"}` for better LLM parsing.

- **Exclude large files to optimize for token limits:**

```powershell
Invoke-POWERcat "C:\Project" -Recurse -MaxSize 50KB -Bash
Invoke-PowerCat "C:\Project" -Recurse -MaxSize 50KB -Bash
```

- **Custom extensions and sorting:**

```powershell
Invoke-POWERcat "C:\Project" -o "C:\bundle.txt" -Extensions ".ps1",".json",".sh" -Sort Extension
Invoke-PowerCat "C:\Project" -o "C:\bundle.txt" -Extensions ".ps1",".json",".sh" -Sort Extension
```

- **Use catignore to exclude directories:**
Expand All @@ -155,14 +157,14 @@ obj/
Then run:

```powershell
Invoke-POWERcat "C:\Project" -o "C:\bundle.txt" -Recurse
Invoke-PowerCat "C:\Project" -o "C:\bundle.txt" -Recurse
```

- **View token estimation before bundling:**

```powershell
# Note: POWERcat no longer includes Markdown by default. Use `-IncludeMarkdown` to include `.md` files.
Invoke-POWERcat "C:\Project" -Recurse -Minify -Stats
# Note: PowerCat no longer includes Markdown by default. Use `-IncludeMarkdown` to include `.md` files.
Invoke-PowerCat "C:\Project" -Recurse -Minify -Stats
# See: Files processed, Total characters, Estimated tokens
# Then decide: pipe to file, adjust MaxSize, or minify further
```
Expand All @@ -171,30 +173,30 @@ Invoke-POWERcat "C:\Project" -Recurse -Minify -Stats

This repo ships both a module and a standalone script for convenience:

- **Module:** `src/POWERcat/POWERcat.psm1`, `src/POWERcat/POWERcat.psd1`
- **Script:** `scripts/POWERcat.ps1`
- **Module:** `src/PowerCat/PowerCat.psm1`, `src/PowerCat/PowerCat.psd1`
- **Script:** `scripts/PowerCat.ps1`

Module usage:

```powershell
Import-Module .\src\POWERcat\ -Force
Invoke-POWERcat . -o out.txt
Import-Module .\src\PowerCat\ -Force
Invoke-PowerCat . -o out.txt
```

Script usage:

```powershell
.\scripts\POWERcat.ps1 . -o out.txt
.\scripts\PowerCat.ps1 . -o out.txt
```

_Note:_ If you see scripts blocked, run `Set-ExecutionPolicy RemoteSigned -Scope CurrentUser` as admin or follow your org policy.

## ☄️ Why POWERcat?
## ☄️ Why PowerCat?

Because recruiters, collaborators, and LLMs don't want a directory tree—they want one file, structured and readable.
POWERcat makes your work portable, token-efficient, and a little stylish.
PowerCat makes your work portable, token-efficient, and a little stylish.

### POWERcat vs. Standard `cat`
### PowerCat vs. Standard `cat`

**Standard `cat` or `Get-Content`:**

Expand All @@ -204,10 +206,10 @@ Get-ChildItem -Recurse -Filter "*.ps1" | Get-Content
# Output: No file separators, no headers, unclear which code belongs where
```

**POWERcat:**
**PowerCat:**

```powershell
Invoke-POWERcat . -Recurse -Fence -PowerShell
Invoke-PowerCat . -Recurse -Fence -PowerShell
# Output:
# --- File: script1.ps1 ---
#
Expand All @@ -224,7 +226,7 @@ Invoke-POWERcat . -Recurse -Fence -PowerShell

**The difference:**

| Feature | `cat` | POWERcat |
| Feature | `cat` | PowerCat |
| ---------------------- | ----- | ---------------------------------------- |
| Stdout output | ✅ | ✅ (default) |
| File output (optional) | ❌ | ✅ |
Expand All @@ -238,7 +240,7 @@ Invoke-POWERcat . -Recurse -Fence -PowerShell
| Multiple extensions | ❌ | ✅ (flexible file type selection) |
| Binary safety | ❌ | ✅ (auto-skip executables, images, etc.) |

POWERcat is purpose-built for sharing code with recruiters, collaborators, and LLMs—creating readable, structured, token-aware bundles that respect context limits.
PowerCat is purpose-built for sharing code with recruiters, collaborators, and LLMs—creating readable, structured, token-aware bundles that respect context limits.

## 🛸 License

Expand Down
18 changes: 9 additions & 9 deletions ReleaseNotes.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@

### Overview

**POWERcat** is a single‑shot concatenator for bundling markdown and code into one clean text file.
**PowerCat** is a single‑shot concatenator for bundling markdown and code into one clean text file.
It’s the feline cousin of `cat`—polished for PowerShell, Markdown‑aware, and built with recruiter‑friendly ergonomics.

### Features
Expand All @@ -43,12 +43,12 @@ It’s the feline cousin of `cat`—polished for PowerShell, Markdown‑aware, a
- **Markdown fences:** Opt‑in code fencing with `-Fence` for clean LLM/GitHub sharing.
- **Extensions:** Default as Markdown plus switches (`-Bash`, `-PowerShell`, `-HTML`, `-CSS`) or custom list via `-Extensions`.
- **Sorting:** Control order with `-Sort Name|Extension|LastWriteTime|Length`.
- **Aliases:** Quick commands `POWERcat`, `pcat`, `concat` point to `Invoke-POWERcat`.
- **Native help:** Rich comment‑based help available via `Get-Help Invoke-POWERcat`.
- **Aliases:** Quick commands `PowerCat`, `pcat`, `concat` point to `Invoke-PowerCat`.
- **Native help:** Rich comment‑based help available via `Get-Help Invoke-PowerCat`.

### Added

- Initial release of POWERcat.
- Initial release of PowerCat.

## Version 1.0.6 (2025-10-25)

Expand Down Expand Up @@ -98,7 +98,7 @@ It’s the feline cousin of `cat`—polished for PowerShell, Markdown‑aware, a
- **Efficiency:** Refactored file reading loop to use single `Get-ChildItem` scan instead of per-extension loops; consolidated output into string array and write once with `Set-Content`.
- **Error handling:** Added comprehensive try-catch blocks around file I/O operations with descriptive error messages.
- **UTF-8 encoding:** Specified UTF-8 encoding for all file reads and writes for consistent cross-platform text handling (no BOM).
- **Module ergonomics:** Removed `-Help` switch from module (PowerShell-idiomatic); users rely on `Get-Help Invoke-POWERcat` for native PowerShell help discovery.
- **Module ergonomics:** Removed `-Help` switch from module (PowerShell-idiomatic); users rely on `Get-Help Invoke-PowerCat` for native PowerShell help discovery.
- **Cross-platform paths:** Added `GetUnresolvedProviderPathFromPSPath` for proper tilde (`~`) and relative path expansion on all platforms.

## Version 1.2.0 (2025-12-17)
Expand All @@ -110,9 +110,9 @@ It’s the feline cousin of `cat`—polished for PowerShell, Markdown‑aware, a

### Added

- **Stdout output:** Invoke-POWERcat now outputs concatenated content to stdout by default, enabling Unix-style piping and redirection.
- Example: `Invoke-POWERcat -s ./src | Out-File bundle.txt` (manual redirection)
- Example: `Invoke-POWERcat -s ./src -o bundle.txt` (direct file output, optional)
- **Stdout output:** Invoke-PowerCat now outputs concatenated content to stdout by default, enabling Unix-style piping and redirection.
- Example: `Invoke-PowerCat -s ./src | Out-File bundle.txt` (manual redirection)
- Example: `Invoke-PowerCat -s ./src -o bundle.txt` (direct file output, optional)

### Fixed

Expand All @@ -123,7 +123,7 @@ It’s the feline cousin of `cat`—polished for PowerShell, Markdown‑aware, a

### Breaking Changes

- **Implicit Markdown removed:** POWERcat no longer includes `.md` files by default. Users must explicitly opt-in with `-IncludeMarkdown` or `-Extensions ".md"`. This avoids accidentally bundling documentation and makes automated workflows safer.
- **Implicit Markdown removed:** PowerCat no longer includes `.md` files by default. Users must explicitly opt-in with `-IncludeMarkdown` or `-Extensions ".md"`. This avoids accidentally bundling documentation and makes automated workflows safer.

### Added

Expand Down
2 changes: 1 addition & 1 deletion src/PowerCat/PowerCat.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ Displays file count, character count, and estimated token usage (useful for AI c
Author: Matthew Poole Chicano
License: MIT

CatIgnore behavior: POWERcat looks for ignores in the following order:
CatIgnore behavior: PowerCat looks for ignores in the following order:
1. $HOME/.catignore (Global/User level)
2. Environment variable CATIGNORE_PATH (if set)
3. 'catignore' in the SourceDir (Project level)
Expand Down
Loading