Metadata-Version: 2.4
Name: codebind
Version: 0.1.2
Summary: A minimal model loop over a persistent IPython session.
Keywords: ai,ipython,llm,repl,agents
Author: Giovanni Gravili
Author-email: Giovanni Gravili <ghovax@users.noreply.github.com>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Dist: ipython>=9.0
Requires-Dist: langchain-core>=1.0
Requires-Dist: models-provider>=0.1.0
Requires-Dist: rich>=14.0
Requires-Python: >=3.13
Project-URL: Repository, https://github.com/ghovax/codebind
Project-URL: Issues, https://github.com/ghovax/codebind/issues
Description-Content-Type: text/markdown

# Codebind

Codebind runs a model with one tool: an IPython cell executed in the session shared with the user. Conversation history belongs to a `Session`; the model is selected independently for every call.

## Installation

Run Codebind without installing it permanently:

```console
uvx codebind
```

Or install it with any Python package installer:

```console
pip install codebind
```

After installation, start the preconfigured shell from any directory:

```console
codebind
```

It opens IPython with `chat` and `Models` already available and renders a short Markdown usage guide in the terminal. It does not modify the user's global IPython profile.

```python
models = Models({"openai": "OPENAI_API_KEY"})

chat.ask(
    "Inspect this project and tell me what to implement first.",
    models.chat("openai/gpt-5", reasoning_effort="medium"),
)
```

Codebind does not load files or construct a project prompt automatically. The user states what should be loaded as context. Pass `instructions=` to `Session` only when an application needs its own system instructions.

## ChatGPT account login

Models Provider can start its OpenAI browser sign-in flow directly from IPython:

```python
import webbrowser

models = Models()
authorization = await models.sign_in("openai")
webbrowser.open(authorization.url)
await authorization.complete()

chat.ask(
    "Inspect this project.",
    models.chat("openai/gpt-5", authorization=authorization),
)
```

The authorization remains in memory for this session. Persistent credential storage belongs to the host application.

OpenAI officially supports ChatGPT subscription sign-in for Codex clients. Models Provider reproduces that account-access boundary for this library; it is separate from the public, pay-as-you-go OpenAI API and may require compatibility updates when the Codex account protocol changes.
