prompt-concator
v1.4.0
Published
A tool to concatenate and watch files with bidirectional sync support
Maintainers
Readme
Prompt Concator
prompt-concator concatenates matched files into input-prompt.txt for quick sharing with LLMs or other tooling. It supports glob patterns, exclusions, watch mode, and TextEdit on macOS.
Features
- Glob-based inclusion with exclude lists
- Respects
.gitignoreby default (use--ignore-gitignoreto skip) - Watch mode keeps
input-prompt.txtand source files in sync - Optional TextEdit open on macOS
Installation
npm install -g prompt-concatorCLI Usage
Run once:
npx prompt-concator -prompt "Your custom prompt here"Watch mode:
npx prompt-concator -prompt "Your custom prompt here" --watchOpen in TextEdit:
npx prompt-concator -prompt "Your custom prompt here" --textEditIgnore .gitignore rules:
npx prompt-concator -prompt "Your custom prompt here" --ignore-gitignoreProgrammatic API
const { promptConcator, watchAndConcatenate } = require('prompt-concator');
promptConcator('Your prompt text here', {
excludeFolders: ['node_modules', 'dist'],
excludeFiles: ['README.md'],
patterns: [{ src: './src/**/*.js' }],
textEdit: true
});
watchAndConcatenate('Your prompt text here', {
excludeFolders: ['node_modules', 'dist'],
excludeFiles: ['README.md'],
patterns: [{ src: './src/**/*.js' }],
textEdit: true
});Configuration File (CLI)
Create prompt.config.json in the project root to set defaults for the CLI:
{
"excludeFolders": ["node_modules", "dist"],
"excludeFiles": ["README.md"],
"patterns": [{ "src": "./src/**/*.js" }],
"textEdit": true,
"ignoreGitignore": false
}Options
| Option | Type | Description |
|-------------------|-----------|-------------|
| excludeFolders | Array | Folder names or paths to exclude. |
| excludeFiles | Array | File name or path globs to exclude. |
| patterns | Array | Glob patterns to include. |
| textEdit | Boolean | Open input-prompt.txt in TextEdit (macOS). |
| ignoreGitignore | Boolean | Skip .gitignore filtering (default: false). |
Notes
--onlyPathstreats all following args as literal files/folders and skips globbing.- CLI
--excludeFolders/--excludeFilesare merged with defaults and config. input-prompt.txtis the generated output file.
License
Buy Me a Beer License
Feel free to use this tool for personal and commercial purposes. If you find it helpful, you can buy me a beer. Cheers!
