Skip to content

Generate a text-based dump of source files or a directory tree structure, suitable for AI processing.

License

Notifications You must be signed in to change notification settings

jschwind/phpcli-ai

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PHPCLI-AI

Generate a text-based dump of source files or a directory tree structure, suitable for AI processing.

Installation

git clone https://github.com/jschwind/phpcli-ai.git
cd phpcli-ai
chmod +x runAIProject.sh

Add runAIProject.sh to your PATH or create a symlink, e.g., on Arch/Manjaro Linux via ~/.bashrc:

sudo ln -s $(pwd)/runAIProject.sh /usr/local/bin/runAIProject

Usage

runAIProject [OUTPUT_FILENAME] [--tree]

Generates a dump of relevant project files or a directory tree. By default, the output is written to ai.txt in the current directory.

Options

  • OUTPUT_FILENAME: Optional. Name of the output file (default: ai.txt)
  • --tree: Optional. Generates a directory tree instead of a file dump

ai.json Support

You can customize which files and folders are excluded from the output by placing an ai.json file in the root of your project. This overrides the default ignore rules.

Example ai.json:

{
  "ignoreExtensions": ["log", "png", "jpg"],
  "ignoreFolders": ["vendor", "node_modules", "tests"],
  "ignoreFilenames": ["README.md", ".env"]
}

Priority

If ai.json is present and readable in the target directory, its values will be used instead of the default ignore lists.

Examples

runAIProject

Dumps source content into ai.txt.

runAIProject ai2.txt

Same as above, output goes to ai2.txt.

runAIProject --tree

Generates a directory tree and saves it to ai.txt.

runAIProject ai2.txt --tree

Generates a directory tree and saves it to ai2.txt.

About

Generate a text-based dump of source files or a directory tree structure, suitable for AI processing.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published