https://github.com/alwalxed/context-dump
An interactive CLI tool to create AI-friendly context from selected files.
https://github.com/alwalxed/context-dump
ai cli cli-tool dumper file-dump file-merger interactive javascript nodejs
Last synced: about 2 months ago
JSON representation
An interactive CLI tool to create AI-friendly context from selected files.
- Host: GitHub
- URL: https://github.com/alwalxed/context-dump
- Owner: alwalxed
- License: mit
- Created: 2024-12-21T11:21:21.000Z (6 months ago)
- Default Branch: main
- Last Pushed: 2024-12-21T12:24:03.000Z (6 months ago)
- Last Synced: 2025-04-16T01:12:34.093Z (about 2 months ago)
- Topics: ai, cli, cli-tool, dumper, file-dump, file-merger, interactive, javascript, nodejs
- Language: TypeScript
- Homepage: https://npmjs.com/package/context-dump
- Size: 167 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Context Dump for AI
An interactive CLI tool to generate AI-friendly context from selected files, making project data easily consumable for AI models.
## Features
- **Interactive File Selection**: Choose files using a checkbox interface.
- **Intelligent File Filtering**: Automatically ignores common files and directories (e.g., `node_modules`, `.git`).
- **`.gitignore` Compliance**: Respects `.gitignore` rules to streamline file selection.
- **Structured JSON Output**: Outputs a JSON file containing the project structure and file contents.## Installation
Install the tool globally with:
```bash
npm install -g context-dump
```## Usage
### Basic Command
Run the tool with a simple command:
```bash
context-dump
```By default, the output is saved to `ai_context.json` in the current directory.
### Options
#### Specify Output File
Use the `-o` or `--output` option to specify a custom output file:
```bash
context-dump -o custom_output.json
```#### Exclude Specific Files or Folders
Use the `-e` or `--exclude` option to exclude specific files or folders (comma-separated):
```bash
context-dump -e foo,bar
```## Screenshots

## Output Structure
The output JSON file contains two main sections:
- **`project_structure`**: A list of file paths included in the output.
- **`file_contents`**: A dictionary where keys are file paths, and values include the file content and extension.### Example Output
```json
{
"project_structure": ["example.js"],
"file_contents": {
"example.js": {
"content": "console.log('Hello, World!');",
"extension": "js"
}
}
}
```## Contributing
Submit issues or pull requests to help improve this tool.
## License
This project is licensed under the MIT License. See the [LICENSE](https://github.com/alwalxed/context-dump/blob/main/LICENSE) file for details.