Pew is a simple, lightweight CLI for dumping source code or directories into a single file, makes it easier to work with LLMs.
Claude Code and Sonnet 3.7 its amazing at coding, but it lacks intelligence. So the best workflow is dump your code to Grok, asking grok to prompt claude first, create a PLAN.md, and let your fellow claude to follow it
WHAT THIS CLI CAN DO
- Convert source code files to well-formatted Markdown
- Automatically detect and skip binary files
- Tree-style directory structure visualization
- GitIgnore-style pattern matching via
.pewcconfiguration file - Auto ignore the binary files
- Smart file extension detection for proper syntax highlighting
imgae below its how the out put files looks like

Using Homebrew
brew tap yuann3/pew
brew install pewLinux
# Download and install in one command
curl -L https://raw.githubusercontent.com/yuann3/pew/main/install.sh | bashpew [flags] [files...]
Flags:
-d <directory> Directory to dump (mutually exclusive with specifying files)
-o <filename> Output Markdown file (default: "source.md")
-h Show this help message
--no-default-ignores Disable default ignore patterns for directories
Dump specific files:
pew file1.go file2.go -o output.mdDump a directory with default ignores:
pew -d /path/to/project -o project.mdDump a directory without default ignores:
pew -d /path/to/project --no-default-ignores -o project.mdCreate a .pewc file in your project directory to specify ignore patterns. The .pewc file works exactly like .gitignore:
# Lines starting with # are comments
# Ignore specific files
bla.md
README.md
*.log
*.tmp
# Ignore directories (patterns ending with /)
node_modules/
dist/
build/
# Wildcards work just like in gitignore
doc/*.txt # Ignore all .txt files in doc/ directory
test/*/data # Ignore data in subdirectories of test/
- Blank lines are ignored
- Lines starting with
#are comments - Patterns ending with
/match directories only *matches any sequence of characters except/?matches any single character except/- You can specify exact filenames like
bla.mdto ignore them
By default, pew ignores these patterns:
.*(hidden files/directories)node_modules/target/dist/build/bin/pkg/.pewc(the configuration file itself)
Use --no-default-ignores to override this behavior.
- Pew identifies text files by checking extensions and content, skipping binary files like images or executables.
- Pew-generated Markdown files are excluded from subsequent runs to avoid redundant content.
- Use the
--no-default-ignoresflag cautiously, as it may include unwanted files.
The output Markdown file contains:
- A directory structure tree (if dumping a directory)
- Code sections with proper syntax highlighting
- All text files found in the specified location(s), excluding any files that match patterns in your
.pewcfile
