An open API service indexing awesome lists of open source software.

https://github.com/patricktrainer/pbtree

Like `pbcopy` but for LLM prompt building đŸ—ī¸
https://github.com/patricktrainer/pbtree

chatgpt claude-ai cli llm prompt-engineering

Last synced: 3 months ago
JSON representation

Like `pbcopy` but for LLM prompt building đŸ—ī¸

Awesome Lists containing this project

README

          

# đŸŒŗ PBTree

PBTree is like `pbcopy`, but supercharged. 🚀

## ✨ Features

- đŸ–Ĩī¸ Interactive file navigation
- 🔍 Quick search
- ✅ Multi-select files and folders
- 📋 Copy selected content to clipboard as XML

## đŸŽ¯ Perfect for adding context to Claude

PBTree generates XML output, making it ideal for [crafting prompts for Claude AI](https://docs.anthropic.com/en/docs/build-with-claude/prompt-engineering/use-xml-tags)! Claude loves structured data in XML tags. đŸ¤–â¤ī¸

## đŸ› ī¸ Build & install

1. Clone the repo:
```bash
git clone https://github.com/patricktrainer/pbtree.git
cd pbtree
```

2. Install dependencies:
```bash
npm install
```

3. Build the project:
```bash
npm run build
```

4. Link the package globally:
```bash
npm link
```

Alternatively, you can use the [rebuild script](./scripts/rebuild.js) to do all of the above:

```bash
npm run rebuild
```

## đŸ•šī¸ How to use

After building and linking, simply run `pbtree` in your terminal:

```bash
pbtree
```

- âŒ¨ī¸ Type to search.
- âŦ†ī¸ âŦ‡ī¸ Move up and down the list
- âŦ…ī¸ âžĄī¸ Navigate back and forth between folders
- space Select or deselect the current item (file or folder)
- ⏎ return Copy selected content to the clipboard and exit.

## 👨‍đŸ’ģ Development

To run PBTree in development mode:

```bash
npm run dev
```

This uses `ts-node` to run the TypeScript files directly.

## đŸ“Ļ Dependencies

- [react](https://www.npmjs.com/package/react) and [ink](https://www.npmjs.com/package/ink) for the CLI interface
- [clipboardy](https://www.npmjs.com/package/clipboardy) for clipboard operations

Check `package.json` for the full list of dependencies and their versions.

## 🤝 Contribute

Contributions welcome! 🎉

1. Fork the repo
2. Create your feature branch: `git checkout -b my-new-feature`
3. Commit your changes: `git commit -am 'Add some feature'`
4. Push to the branch: `git push origin my-new-feature`
5. Submit a pull request

đŸĒ‚ **Enjoy!**