Metadata-Version: 2.2
Name: navvy
Version: 2.0.1
Summary: Automation tool for managing Git repositories with LLMs.
Author-email: Rofly António <mitangerofly@gmail.com>
License: MIT License
        
        Copyright (c) 2024 Rofly António
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Homepage, https://github.com/itsrofly/navvy-package
Keywords: automation,ai,openai,git,code
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: annotated-types==0.7.0
Requires-Dist: anyio==4.6.2.post1
Requires-Dist: certifi==2024.8.30
Requires-Dist: distro==1.9.0
Requires-Dist: gitdb==4.0.11
Requires-Dist: GitPython==3.1.43
Requires-Dist: h11==0.14.0
Requires-Dist: httpcore==1.0.7
Requires-Dist: httpx==0.27.2
Requires-Dist: idna==3.10
Requires-Dist: jiter==0.7.1
Requires-Dist: openai==1.63.2
Requires-Dist: pydantic==2.10.6
Requires-Dist: pydantic-core==2.27.2
Requires-Dist: smmap==5.0.1
Requires-Dist: sniffio==1.3.1
Requires-Dist: tqdm==4.67.0
Requires-Dist: typing_extensions==4.12.2
Requires-Dist: pydantic-ai==0.0.24

# Navvy

The navvy package is a Python-based automation tool for managing Git repositories. It utilizes the [PydanticAI](https://ai.pydantic.dev/) framework, enabling compatibility with any provider or model while maintaining structure and most of the wording. It facilitates tasks like evaluating, editing, creating, and deleting files within a repository.

## Installation

You can install the Navvy package using pip:

```sh
pip install navvy
```

## Usage

```python
from navvy import Navvy
from pydantic_ai import Agent

# Create an agent using pydantic_ai, accordance with the user's preferences.
agent = Agent(  
    'openai:gpt-4o-mini',
    system_prompt=(
        'You are a software engineer working on a project. You have made some changes to the codebase and committed them. '
    ),
)
# Create a Navvy instance
navvy = Navvy(agent, "./snake_game")

# Run the agent, accordance with the user's preferences.
result = agent.run_sync("Create a snake game.")

print(result.data) # Agent response
print(navvy.get_all_commits()) # Show all commits made by Navvy
```

Here is an example of how to undo a commit using the Navvy package:

```python
# Undo the last commit
navvy.undo_commit_changes()

# Undo the last commit using commit id
commit_id: str
navvy.undo_commit_changes(commit_id)
```

## API 
```python
Navvy(
    agent: Agent, # LLM https://ai.pydantic.dev/agents/
    project_path: str, # Repository path, if no repository is found a new one will be created
    project_url: str = None, # If provided, it will be used to clone a repository from the URL to the specified project_path
    author: str = "Navvy", # Commit author name
    author_address: str = "github.com/itsrofly/navvy-package" # Commit author address
)
```

## Requirements

Git            
Python 3.8 or higher.
