prompt-concator
v1.4.2
Published
A tool to concatenate and watch files with bidirectional sync support
Maintainers
Readme
Prompt Concator
prompt-concator concatenates matched files into a configurable output file for quick sharing with LLMs or other tooling. By default it writes ./input-prompt.txt. 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 the configured output file and source files in sync
- Optional TextEdit open on macOS
- Configurable output
path
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-gitignoreSet the output file location:
npx prompt-concator -prompt "Your custom prompt here" --path ./prompts/agent-prompt.txtIf path points to a folder, the output file defaults to input-prompt.txt inside that folder. If it points to a file, that exact file is used.
Programmatic API
const { promptConcator, watchAndConcatenate } = require('prompt-concator');
promptConcator('Your prompt text here', {
excludeFolders: ['node_modules', 'dist'],
excludeFiles: ['README.md'],
patterns: [{ src: './src/**/*.js' }],
path: './prompts/agent-prompt.txt',
textEdit: true
});
watchAndConcatenate('Your prompt text here', {
excludeFolders: ['node_modules', 'dist'],
excludeFiles: ['README.md'],
patterns: [{ src: './src/**/*.js' }],
path: './prompts/agent-prompt.txt',
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" }],
"path": "./prompts/agent-prompt.txt",
"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. |
| path | String | Output folder or file path, default: ./ -> input-prompt.txt. |
| textEdit | Boolean | Open the output file 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. - The generated output file is excluded automatically from the source glob so the tool does not include its own output.
- For agent workflows, keep the output file in a stable, dedicated location by setting
pathexplicitly.
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!
