Metadata-Version: 2.4
Name: gh-pydantic-ai
Version: 0.4.0
Summary: GitHub Copilot Provider for Pydantic AI
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Environment :: MacOS X
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: POSIX :: Linux
Classifier: Operating System :: Unix
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Internet
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Requires-Python: >=3.13
Requires-Dist: click>=8.2.1
Requires-Dist: httpx>=0.28.1
Requires-Dist: pydantic-ai-slim[cli,openai]>=1.2.0
Requires-Dist: pyperclip>=1.9.0
Description-Content-Type: text/markdown

# gh-copilot-pydantic-ai

[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![PyPI version](https://badge.fury.io/py/gh-pydantic-ai.svg)](https://badge.fury.io/py/gh-pydantic-ai)
[![Python Version](https://img.shields.io/pypi/pyversions/gh-pydantic-ai.svg)](https://pypi.org/project/gh-pydantic-ai)

GitHub Copilot Provider for Pydantic AI.

Inspired by [ericc-ch/copilot-api/](https://github.com/ericc-ch/copilot-api/).

## Installation

Install the package using pipx or your favorite package manager:

```bash
pip install gh-pydantic-ai
# or with uv
uv tool install gh-pydantic-ai
```

## CLI Usage

### Authentication

First, you need to authenticate with your GitHub account.

```bash
gh-clai-internal auth
```

### Query

After authentication, you can use the `gh-clai` command to interact with GitHub Copilot:

```bash
gh-clai "What is the capital of France?"
```

## Library Usage

This library also provides `GHCopilotModel` for integration with Pydantic AI.

```python
from gh_pydantic_ai import GHCopilotChatModel
from pydantic_ai import Agent

agent = Agent(
    model=GHCopilotChatModel()
)

result = agent.run_sync("What is the capital of France?")
print(result)
```

## Commands

- `gh-clai`: Main command to interact with GitHub Copilot, works same as `clai` command from `pydantic-ai`.
- `gh-clai-internal`: Internal commands for authentication and other utilities.
  - `auth`: Authenticate with GitHub.
  - `models`: List available models.
  - `usage`: Show usage information.

