A CLI tool that generates a text-based dump of source files or a directory tree structure — ideal for processing by AI systems.
git clone https://github.com/jschwind/phpcli-ai.git
cd phpcli-ai
chmod +x runAIProject.shOptionally, add runAIProject.sh to your system’s PATH. For example, on Arch/Manjaro:
sudo ln -s $(pwd)/runAIProject.sh /usr/local/bin/runAIProjectrunAIProject [OUTPUT_FILENAME] [--tree] [--config=PATH_TO_CONFIG]By default, this command generates a text dump of the current directory’s source files and saves it to ai.txt.
- OUTPUT_FILENAME(optional): Custom name for the output file (default:- ai.txt)
- --tree(optional): Outputs a directory tree instead of dumping file contents
- --config=...(optional): Use a specific- ai.jsonconfiguration file
You can control which files and folders are included or excluded by providing an ai.json file in your project’s root directory. This will override the default rules.
{
  "exclude": {
    "extensions": ["log", "png", "jpg"],
    "folders": ["vendor", "node_modules", "tests"],
    "filenames": ["README.md", ".env"]
  },
  "include": {
    "extensions": [],
    "folders": [],
    "filenames": []
  }
}If ai.json is present and readable, its values will override the default ignore lists.
runAIProjectGenerates a file dump and writes it to ai.txt.
runAIProject ai2.txtSame as above, but writes to ai2.txt.
runAIProject --treeOutputs a directory tree structure to ai.txt.
runAIProject ai2.txt --treeOutputs a directory tree structure to ai2.txt.
runAIProject --config=./config/ai-custom.jsonUses a custom configuration to control what is included or excluded.