TL;DR –
rpcpis a one‑shot clipboard copier for codebases. It walks a folder, excludes junk (.git,node_modules, binaries, etc.), redacts secrets you define, then puts the result on your clipboard ready to paste into an AI assistant or chat.
Sometimes you’re pair‑programming with an LLM (ChatGPT, Claude, Copilot Chat etc.) and you need to give it your entire repo or a large sub‑directory for context. Copy‑pasting file‑by‑file gets old fast – repocopy does it in a single command while letting you:
- redact sensitive tokens (
ACME→ClientName) - skip whole directories or globs
- honour a max file‑size
- view exactly which files were included
# 1. Clone with submodules & jump in
git clone --recurse-submodules https://github.com/dickymoore/repocopy.git
cd repocopy
# 2. Add rpcp to your PATH
$env:PATH += ';' + (Get-Location) # (current session)
if ($([Environment]::GetEnvironmentVariable('PATH','User')) -split ';' -notcontains $((Get-Location).Path)) {[Environment]::SetEnvironmentVariable('PATH',"$([Environment]::GetEnvironmentVariable('PATH','User'));$((Get-Location).Path)",'User')} # (future sessions)
# 3. Copy the *current* folder (default)
rpcp
# 4. Copy another repo, verbose
rpcp -RepoPath 'C:\src\my-project' -VerboseClipboard helper – uses the built‑in Set‑Clipboard cmdlet (no extra installs).
# 1. Clone with submodules & add rpcp to your PATH
git clone --recurse-submodules https://github.com/dickymoore/repocopy.git
export PATH="$PATH:$(pwd)/repocopy"
# 2. Copy the *current* folder (default)
rpcp
# 3. Copy another repo, verbosely
rpcp --repo-path ~/src/my-project --verboseClipboard helpers –
• Linux: requiresxclip
• macOS: usespbcopy
• WSL: usesclip.exe
- Bash 4+ or PowerShell 7+
jq– for the Bash version (auto‑installed ifautoInstallDeps = true)- A clipboard tool (
pbcopy,xclip,clip.exe, orpwsh)
Every CLI switch overrides the matching JSON field – handy when you just
need to bump --max-file-size for one run.
# basic
rpcp
# disable size filter
rpcp -MaxFileSize 0
# different folder, quiet output
rpcp -RepoPath C:\Code\Foo -Verbose:$false# basic
rpcp
# disable size filter & summary
rpcp --max-file-size 0 --show-copied-files=false
# different folder
rpcp --repo-path ~/Code/Foo# one‑time: fetch the helper submodules
git submodule update --init --recursive
# Bash tests
sudo apt install bats jq xclip # linux example
bats tests/bash
# PowerShell tests
pwsh -Command 'Install-Module Pester -Scope CurrentUser -Force'
pwsh -Command 'Invoke-Pester tests/powershell'- Shell files are expected to use LF endings.
A.gitattributesis provided so Windows Git converts on checkout. - CI runs both Pester (PowerShell) and Bats (Bash) on ubuntu‑latest and windows‑latest runners.
- Want to contribute? See CONTRIBUTING.md.
MIT © 2025 Dicky Moore
{ // folder to scan – “.” = working directory "repoPath": ".", // ignore folders / files (globs ok) "ignoreFolders": ["build", ".git", "node_modules"], "ignoreFiles": ["manifest.json", "*.png"], // max bytes per file (0 = unlimited) "maxFileSize": 204800, // string replacements applied to every file (So in this case, ACME will be replaced with Company_name) "replacements": { "ACME": "Company_name" }, // print a summary afterwards? "showCopiedFiles": true, // let rpcp.sh auto‑install jq if missing "autoInstallDeps": true }