dump_dir command - github.com/fargusplumdoodle/dump_dir - Go Packages

dump_dir

command module
v1.0.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 18, 2024 License: MIT Imports: 2 Imported by: 0

README ΒΆ

πŸš€ dump_dir πŸ“‚βœ¨

Copy a bunch of files into your clipboard to provide context for LLMs

🌟 Functionality

  • πŸ” Search for files with specific extensions or all files
  • πŸ“‹ Automatically copy file contents to clipboard
  • 🚫 Skip specified directories
  • πŸ“ Respects .gitignore rules by default
  • πŸš€ Fast! Can copy 1.6 million tokens in ~0.8 seconds

πŸš€ Usage

dump_dir <file_extension> <directory1> [directory2] ... [-s <skip_directory1>] [-s <skip_directory2>] ...

Use 'any' as file_extension to match all files.

πŸ“š Examples

Get all JS files, ignoring your node_modules and dist directories:

dump_dir js ./project -s ./project/node_modules -s ./project/dist

Get all files in your project directory of all types

dump_dir any ./project 

Get all Go, JavaScript, and Python files in your project:

dump_dir go,js,py ./project

Get all files, including those normally ignored (e.g., files in .gitignore):

dump_dir any ./project --include-ignored

This repo:

dump_dir any .
Skipping ignored directory: .git
Skipping ignored directory: .idea
Skipping ignored directory: gitignore

πŸ” Matching files:
  - dump_dir
  - src/colors.go
  - README.md
  - .gitignore
  - main.go
  - go.mod
  - src/ignore.go
  - src/file_processing.go
  - src/output.go
  - go.sum
  - .goreleaser.yaml
  - src/types.go
  - src/args.go
  - .github/workflows/release.yml

πŸ“š Total files found: 14
πŸ“ Total lines across all files: 710

βœ… File contents have been copied to clipboard.

πŸ”’ Gitignore Behavior

By default, dump_dir respects your project's .gitignore rules. This means:

Files and directories listed in your project's .gitignore will not be included in the output. The tool also respects your global gitignore file. Common version control directories (like .git) are automatically ignored.

To include ignored files, use the --include-ignored flag as shown in the examples above.

πŸ› οΈ Installation

Mac and Linux

You can easily install the latest version of dump_dir using curl. Run the following command in your terminal:

curl -sfL https://raw.githubusercontent.com/fargusplumdoodle/dump_dir/main/install.sh | sh

This script will:

  • Detect your operating system and architecture
  • Download the latest release of dump_dir
  • Install it to /usr/local/bin (you may need to use sudo for this)

Alternatively, you can manually download the latest release from the GitHub Releases page and place it in a directory in your PATH.

Windows

For Windows users, please download the latest release from the GitHub Releases page and add it to your PATH manually.

πŸ’‘ Tips for LLM Development

  • πŸ“ Use dump_dir to quickly gather context from multiple project files
  • 🧠 Paste the copied content directly into your LLM conversation
  • πŸ”„ Easily update context by re-running dump_dir with different parameters

🀝 Contributing

Raise an issue or make a PR, I whipped this up real quick so there's probably a lot of room for improvement.

πŸ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.


Happy coding! πŸŽ‰πŸ‘¨β€πŸ’»πŸ‘©β€πŸ’»

Documentation ΒΆ

The Go Gopher

There is no documentation for this package.

Directories ΒΆ

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL