Skip to main content

Utility to apply changes to files in a directory based on AI-generated recommendations from prepdir.

Project description

applydir

A utility to apply changes to a codebase based on AI-generated recommendations from a prepped_dir.txt file (generated by prepdir). Designed for vibe coding with UI-based LLMs like Grok 3, enabling seamless integration of AI-suggested changes.

Installation

pip install applydir

Usage

  1. Generate a prepped_dir.txt file using prepdir:

    prepdir .
    
  2. Modify prepped_dir.txt (or create a modified_prepped_dir.txt) with your AI assistant, including updated file contents and additional commands.

  3. Apply changes using applydir:

    applydir modified_prepped_dir.txt --base-dir /path/to/codebase
    
    • Use --dry-run to preview changes without applying them:

      applydir modified_prepped_dir.txt --base-dir /path/to/codebase --dry-run
      
    • Specify a custom config file:

      applydir modified_prepped_dir.txt --base-dir /path/to/codebase --config custom_config.yaml
      

Configuration

The config.yaml file (default: src/applydir/config.yaml) allows customization:

apply_changes:
  auto_apply: false  # Set to true to apply changes without user confirmation
commands:
  shell_type: "bash"  # Options: "bash", "powershell", "cmd"
logging:
  level: "INFO"  # Options: "DEBUG", "INFO", "WARNING", "ERROR", "CRITICAL"
  • auto_apply: If true, applies file changes automatically without prompting.
  • shell_type: Specifies the shell for additional commands (commands are not executed automatically).
  • logging.level: Controls verbosity of logs.

Features

  • Parses prepped_dir.txt to extract file contents and additional commands.
  • Compares original and modified files, showing diffs for updates.
  • Supports creating new files and updating existing ones.
  • Configurable via config.yaml for automatic application and shell type.
  • Dry-run mode to preview changes.
  • Logging for better debugging and transparency.

Development

To set up the development environment:

git clone https://github.com/eyecantell/applydir
cd applydir
pdm install
pdm install -G test

Run tests:

pdm run pytest

Contributing

Contributions are welcome! Please open an issue or submit a pull request at https://github.com/eyecantell/applydir.

License

MIT License

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

applydir-0.1.1.tar.gz (5.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

applydir-0.1.1-py3-none-any.whl (3.4 kB view details)

Uploaded Python 3

File details

Details for the file applydir-0.1.1.tar.gz.

File metadata

  • Download URL: applydir-0.1.1.tar.gz
  • Upload date:
  • Size: 5.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.24.2 CPython/3.10.16 Linux/5.15.167.4-microsoft-standard-WSL2

File hashes

Hashes for applydir-0.1.1.tar.gz
Algorithm Hash digest
SHA256 0cb4e950605725d662638352120528a3bc51999b9a0a79eee5a5ecba9c567892
MD5 c6dc25e1af10f75195369f5e2b1a747f
BLAKE2b-256 192c83af54fe4c5bf7d325eaaa41d9dbdfdf48fed936fa9eaea4a9acc4f1f7d8

See more details on using hashes here.

File details

Details for the file applydir-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: applydir-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 3.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.24.2 CPython/3.10.16 Linux/5.15.167.4-microsoft-standard-WSL2

File hashes

Hashes for applydir-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5ad6adb10f70fddaf15c0c3ce80645c176efdaf80d797a7df6fea1cd25569a80
MD5 d62b096b03b09f150fa3cac1d86f9484
BLAKE2b-256 07e1183638e6c06fc86df9a6d3b95b1e9b93974ba263c8296e185253aaac3f90

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page