npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

prompt-packer

v0.0.3

Published

Pack projects into a single text file for AI prompts

Downloads

20

Readme

Prompt Packer

Prompt Packer is a command-line tool that simplifies the process of sharing project files with AI models. It packs your files into a single, structured text file that AI assistants can easily parse and understand.

The primary use case is packing programming projects into a single text file. However, you can use it to pack anything, such as Notion exports, Obsidian vaults, etc.

📖 Usage

  1. Install Node.js if you haven't already. You can download it here.
  2. Install Prompt Packer globally:
    npm install -g prompt-packer
  3. Navigate to your project directory:
    cd /path/to/your/project
  4. Run Prompt Packer
    prompt-packer "My project"
  5. Use the output .txt file as needed for your AI assistant

🛠 Options

  • <project-name> - specify the project name (required)
  • -e, --exclude <patterns...> - file patterns to exclude, e.g. -e *.md src/**/utils
  • -o, --output-dir <directory> - specify the output directory
  • -i, --include <patterns...> - file patterns to include in order to okverride the default exclusions, e.g. -i .gitignore .idea/**

📂 Default File Exclusions

Prompt Packer comes with a comprehensive list of default file exclusions to help you get started quickly. These exclusions cover common files and directories that are typically not needed for AI analysis, such as version control files, dependencies, build outputs, and more.

You can find the complete list of default exclusions in the defaultExclusions.ts file.

If you need to exclude additional files or directories, you can use the -e, --exclude option when running Prompt Packer.

📄 Example Output

--- BEGIN PROMPT FOR AI ---
This file contains 5 files from the project "My project". Each file is represented in the following format:

--- BEGIN FILEPATH ---
(filepath here)
--- BEGIN FILE CONTENTS ---
(file contents here)
--- END FILE CONTENTS ---

List of all files:
src/index.ts
src/utils.ts
tsconfig.json
package.json
README.md

Instructions for AI:
1. When analyzing or discussing files, refer to them by their filepath.
2. Treat the content between "BEGIN FILE CONTENTS" and "END FILE CONTENTS" as the entire content of the file.
3. Ignore the "BEGIN FILEPATH", "BEGIN FILE CONTENTS", and "END FILE CONTENTS" markers in your analysis; they are not part of the actual file contents.
4. If asked to modify a file, provide only the modified contents without any separators or markers.
5. When showing modified or new file contents, use the following format:

ˋˋˋfiletype
(modified or new file contents here)
ˋˋˋ

6. Be aware of file extensions and treat files accordingly (e.g., .js for JavaScript, .py for Python, etc.).
7. When adding new files, suggest an appropriate filepath based on the project structure.

Please parse and analyze the contents of these files as needed, following the above instructions.
--- END PROMPT FOR AI ---


--- BEGIN FILEPATH ---
src/index.js
--- BEGIN FILE CONTENTS ---
console.log('Hello, World!');
--- END FILE CONTENTS ---

...

📜 License

This project is licensed under the MIT License.