Skip to main content

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 .gitignore files 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

  1. Extract your project for LLM analysis:

    python f2llm.py my_project prompt.json
    
  2. Send prompt.json to your LLM with instructions

  3. 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

Metadata

Release files for f2llm 0.1.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for f2llm 0.1.6
File Size Uploaded Provenance
f2llm-0.1.6.tar.gz 7.4 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for f2llm 0.1.6
File Interpreter ABI Platform
f2llm-0.1.6-py3-none-any.whl Python 3 none any Details

Total release size: 13.4 kB

Release files / f2llm-0.1.6.tar.gz

Download URL f2llm-0.1.6.tar.gz
Size 7.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6db54f5ee37d2ed6ab2b3cfdf8ea8928cfb7c683f148687c1cddfa0a09e9561f
BLAKE2b-256 checksum
How to use checksums
7b76558157d5b0e4022aa16e8738da17774aa41dd245bd9c07cd6951a2f9f3ca
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2025.

Transparency log

Release files / f2llm-0.1.6-py3-none-any.whl

Download URL f2llm-0.1.6-py3-none-any.whl
Size 6.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d1f48502c003308ce9edf95651eb912f78f726734d9f327ce5ae84b922ccb743
BLAKE2b-256 checksum
How to use checksums
c0982984d5de84deea2c17e5d7f8cc5542ef0f7b31d5f3b2c8fdbca2e1da6fe2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2025.

Transparency log

Security for f2llm 0.1.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for f2llm-0.1.6.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 20, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page