A CLI tool to parse files and create LLM prompts
Project description
F2LLM - Folder to LLM CLI Tool
A simple command-line tool for converting folder structures to JSON format for LLM processing and applying LLM-generated changes back to your project.
Installation
Requires Python 3.6+ and the pathspec library:
pip install pathspec
Usage
F2LLM has two main modes:
1. Parse Mode (Default)
Convert a folder structure into JSON format:
python f2llm.py <folder_path> <output.json>
Example:
python f2llm.py my_project project_files.json
This creates a JSON file containing all files in the folder with their content wrapped in code fences.
2. Apply Mode
Apply LLM-generated changes from JSON back to your project:
python f2llm.py --apply <changes.json> <target_folder>
Example:
python f2llm.py --apply llm_response.json my_project
JSON Schema
The tool expects/produces JSON files with this structure:
{
"modified_files": [
{
"file_path": "src/main.py",
"notes": "Updated function logic",
"content": "```python\n# file content here\n```"
}
],
"added_files": [
{
"file_path": "src/new_file.py",
"notes": "New utility module",
"content": "```python\n# new file content\n```"
}
],
"moved_files": [
{
"old_path": "old/location.py",
"new_path": "new/location.py",
"notes": "Reorganized project structure"
}
],
"unchanged_files": [
"README.md",
"package.json"
],
"deleted_files": [
{
"file_path": "obsolete_file.py",
"notes": "No longer needed"
}
]
}
Features
- Gitignore Support: Automatically respects
.gitignorefiles during parsing - File Operations: Handles create, modify, move, and delete operations
- Code Fences: Automatically wraps file content with appropriate language syntax highlighting
- Safe Paths: Creates necessary directories when applying changes
- Error Handling: Graceful handling of file read/write errors
Common Workflow
-
Extract your project for LLM analysis:
python f2llm.py my_project prompt.json
-
Send
prompt.jsonto your LLM with instructions -
Apply the LLM's response back to your project:
python f2llm.py --apply llm_response.json my_project
Notes
- The tool preserves file permissions and creates directories as needed
- Binary files or files that can't be read as UTF-8 will show an error message in their content
- When moving files, the tool creates necessary parent directories automatically
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file f2llm-0.1.6.tar.gz.
File metadata
- Download URL: f2llm-0.1.6.tar.gz
- Upload date:
- Size: 7.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6db54f5ee37d2ed6ab2b3cfdf8ea8928cfb7c683f148687c1cddfa0a09e9561f
|
|
| MD5 |
d2dcf38353871a48d78e5fc0ff02a42f
|
|
| BLAKE2b-256 |
7b76558157d5b0e4022aa16e8738da17774aa41dd245bd9c07cd6951a2f9f3ca
|
Provenance
The following attestation bundles were made for f2llm-0.1.6.tar.gz:
Publisher:
release.yml on mattdravucz/f2llm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
f2llm-0.1.6.tar.gz -
Subject digest:
6db54f5ee37d2ed6ab2b3cfdf8ea8928cfb7c683f148687c1cddfa0a09e9561f - Sigstore transparency entry: 709860247
- Sigstore integration time:
-
Permalink:
mattdravucz/f2llm@19dbb310ebdd9b0eb4cf30d03af8a01e3356495f -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/mattdravucz
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@19dbb310ebdd9b0eb4cf30d03af8a01e3356495f -
Trigger Event:
push
-
Statement type:
File details
Details for the file f2llm-0.1.6-py3-none-any.whl.
File metadata
- Download URL: f2llm-0.1.6-py3-none-any.whl
- Upload date:
- Size: 6.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d1f48502c003308ce9edf95651eb912f78f726734d9f327ce5ae84b922ccb743
|
|
| MD5 |
ef0cac812490643db5d72ceea4f5b1d8
|
|
| BLAKE2b-256 |
c0982984d5de84deea2c17e5d7f8cc5542ef0f7b31d5f3b2c8fdbca2e1da6fe2
|
Provenance
The following attestation bundles were made for f2llm-0.1.6-py3-none-any.whl:
Publisher:
release.yml on mattdravucz/f2llm
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
f2llm-0.1.6-py3-none-any.whl -
Subject digest:
d1f48502c003308ce9edf95651eb912f78f726734d9f327ce5ae84b922ccb743 - Sigstore transparency entry: 709860249
- Sigstore integration time:
-
Permalink:
mattdravucz/f2llm@19dbb310ebdd9b0eb4cf30d03af8a01e3356495f -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/mattdravucz
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@19dbb310ebdd9b0eb4cf30d03af8a01e3356495f -
Trigger Event:
push
-
Statement type: