A CLI tool for selectively copying files from your project directory tree.
Partial Tree Copy is a terminal-based utility that allows you to browse through your directory structure, select specific files, and copy their contents to your clipboard in a well-formatted manner. Perfect for code reviews, documentation, and sharing specific parts of your project.
- Terminal-based UI for easy navigation and file selection
- Tree-structured file browser
- Multi-file selection capabilities
- Formatted clipboard output with file headers
- Intuitive keyboard controls
- Efficient directory navigation
❯ partial-tree-copy
Path: /src/update.go Selected Files (8):
... 1. .git/COMMIT_EDITMSG
📁 logs 2. .git/FETCH_HEAD
📁 objects 3. .git/HEAD
[ ] packed-refs 4. .git/ORIG_HEAD
📁 refs 5. .git/config
[ ] .gitignore 6. src/commands.go
[ ] LICENSE 7. src/main.go
[ ] README.md 8. src/models.go
📁 demo
[ ] go.mod
[ ] go.sum
[ ] partial-tree-copy
📂 src
[✓] commands.go
[✓] main.go
[✓] models.go
> [ ] update.go
How to use
Press 'w'/Ctrl+'c' to quit and copy, 'Space' to select file, 'Enter' to expand/collapse dir
Navigation: 'h'/'l' to switch panels, 'j'/'k' to move up/down, 'J'/'K' to jump between directories-
Start the tool:
partial-tree-copy
-
Controls:
Enter- Expand/collapse directoryj/k- Move up/downJ/K- Jump between directoriesh/l- Switch between panelsworCtrl+c- Copy selected files and exit
git clone git@github.com:makinzm/partial-tree-copy.git
cd partial-tree-copy
go build -o partial-tree-copy ./cmd/partial-tree-copy# Copy to a location in your PATH
cp partial-tree-copy ~/.local/bin/
# Or
sudo cp partial-tree-copy /usr/local/bin/- Share relevant files during code reviews
- Extract code snippets for technical documentation
- Share problematic code sections with team members or AI
- Collect selected files from multiple repositories
Contributions are welcome! Feel free to submit bug reports, feature requests, or pull requests.
- Japanese Document : Go言語で「複数ファイルの内容をクリップボードへコピー」するCLIを作りました #Go - Qiita