Metadata-Version: 2.1
Name: applydir
Version: 0.1.1
Summary: Utility to apply changes to files in a directory based on AI-generated recommendations from prepdir.
Keywords: ai,artificial intelligence,apply changes,code review,directory traversal,file content,project documentation,code sharing,developer tools,large language models,llm,project structure
Author-Email: eyecantell <paul@pneuma.solutions>
License: MIT
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Utilities
Classifier: Topic :: Text Processing :: Markup
Classifier: Development Status :: 4 - Beta
Project-URL: Repository, https://github.com/eyecantell/applydir
Project-URL: Issues, https://github.com/eyecantell/applydir/issues
Project-URL: Documentation, https://github.com/eyecantell/applydir#readme
Requires-Python: >=3.8
Requires-Dist: typing-extensions>=4.7.1; python_version < "3.11"
Requires-Dist: importlib-resources>=5.0; python_version < "3.9"
Requires-Dist: pyyaml>=6.0
Requires-Dist: prepdir>=0.9.0
Provides-Extra: test
Requires-Dist: pytest>=7.4.4; extra == "test"
Requires-Dist: pytest-cov>=4.1.0; extra == "test"
Requires-Dist: coverage>=7.2.7; extra == "test"
Description-Content-Type: text/markdown

# 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

```bash
pip install applydir
```

## Usage

1. Generate a `prepped_dir.txt` file using `prepdir`:
   ```bash
   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`:
   ```bash
   applydir modified_prepped_dir.txt --base-dir /path/to/codebase
   ```

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

   - Specify a custom config file:
     ```bash
     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:

```yaml
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:

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

Run tests:

```bash
pdm run pytest
```

## Contributing

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

## License

MIT License