{"id":21318472,"url":"https://github.com/gauge-sh/chatpdb","last_synced_at":"2025-07-12T02:33:22.035Z","repository":{"id":233705318,"uuid":"787678697","full_name":"gauge-sh/chatpdb","owner":"gauge-sh","description":"Chat with your Python debugger","archived":false,"fork":false,"pushed_at":"2024-05-02T23:43:53.000Z","size":682,"stargazers_count":22,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2024-11-16T18:20:22.098Z","etag":null,"topics":["ai","chat-gpt","cli","debugger","developer-tools","devtools","ipdb","open-source","openai","pdb","python"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gauge-sh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-04-17T01:17:20.000Z","updated_at":"2024-10-26T07:20:41.000Z","dependencies_parsed_at":"2024-05-02T23:34:22.413Z","dependency_job_id":"86ef492d-5912-408e-95aa-d5c1f5b1c443","html_url":"https://github.com/gauge-sh/chatpdb","commit_stats":null,"previous_names":["never-over/chatpdb","gauge-sh/chatpdb"],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gauge-sh%2Fchatpdb","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gauge-sh%2Fchatpdb/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gauge-sh%2Fchatpdb/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gauge-sh%2Fchatpdb/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gauge-sh","download_url":"https://codeload.github.com/gauge-sh/chatpdb/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225787446,"owners_count":17524108,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["ai","chat-gpt","cli","debugger","developer-tools","devtools","ipdb","open-source","openai","pdb","python"],"created_at":"2024-11-21T19:13:39.884Z","updated_at":"2024-11-21T19:13:40.518Z","avatar_url":"https://github.com/gauge-sh.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"[![image](https://img.shields.io/pypi/v/chatpdb.svg)](https://pypi.python.org/pypi/chatpdb)\n[![image](https://img.shields.io/pypi/l/chatpdb.svg)](https://pypi.python.org/pypi/chatpdb)\n[![image](https://img.shields.io/pypi/pyversions/chatpdb.svg)](https://pypi.python.org/pypi/chatpdb)\n[![image](https://github.com/Never-Over/chatpdb/actions/workflows/ci.yml/badge.svg)](https://github.com/Never-Over/chatpdb/actions/workflows/ci.yml)\n[![Checked with pyright](https://microsoft.github.io/pyright/img/pyright_badge.svg)](https://microsoft.github.io/pyright/)\n[![Ruff](https://img.shields.io/endpoint?url=https://raw.githubusercontent.com/astral-sh/ruff/main/assets/badge/v2.json)](https://github.com/astral-sh/ruff)\n# chatpdb\n\n`chatpdb` is a drop-in replacement for [ipdb](https://github.com/gotcha/ipdb) or [pdb](https://docs.python.org/3/library/pdb.html) that lets you ask questions while debugging.\n\n![](https://raw.githubusercontent.com/Never-Over/chatpdb/main/assets/chatpdb_demo.gif)\n\n`chatpdb` meets you where you are - AI tooling that's only invoked when you need it.\n\n## Installation\n```bash\npip install chatpdb\n```\nEnsure that you have `OPENAI_API_KEY` set in your environment.\n```bash\nexport OPENAI_API_KEY=...```\n\n## Usage\nIn your code:\n```python3\nimport chatpdb; chatpdb.set_trace()\n```\nSimply type `y` to receive a summary of the current code and stack trace.\n```python3\n\u003e /Programming/test-chatpdb/lib.py(2)echo_platform()\n      1 def echo_platform(platform: str):\n----\u003e 2     print(\"You are running on:\" + platform)\n      3\nipdb\u003e y \nThe exception occurred because the function `echo_platform` tries to concatenate the string \"You are running on:\" with the `platform` variable, which is `None`. [...]\n```\n\nType `y \"prompt\"` to ask a question. \n\n```python3\n\u003e /Programming/test-chatpdb/lib.py(2)echo_platform()\n      1 def echo_platform(platform: str):\n----\u003e 2     print(\"You are running on:\" + platform)\n      3\nipdb\u003e y \"Why is platform coming through as None?\"\nThe variable `platform` is coming through as `None` because the environment variable `\"PLATFORM\"` is not set in your system's environment variables. [...]\n```\n\n\n## How does it work?\n`chatpdb` uses the OpenAI API to generate responses to your questions. It uses the `gpt-4-turbo` model by default.\n\n`chatpdb` will automatically include relevant context from the current frame and stack trace, as well as\nexception information if one has been raised.\n\n\n### Advanced Usage\n\nJust like [ipdb](https://github.com/gotcha/ipdb) and [pdb](https://docs.python.org/3/library/pdb.html), `chatpdb` supports many different entrypoints.\n\nRunning code:\n```python3\nimport chatpdb; chatpdb.run('print(\"hello\")')\nimport chatpdb; chatpdb.runcall(lambda x: x + 1, 1)\n```\nAs a decorator:\n```python3\n\n@chatpdb.cex\ndef sample_cex_function():\n    raise # any exception within the decorated function will trigger chatpdb\n```\nAs a context manager:\n```python3\nwith chatpdb.launch_chatpdb_on_exception():\n    raise # any exception within the with block will trigger chatpdb\n```\nOn files:\n```bash\npython3 -m chatpdb file.py\n```\npost-mortem support:\n```python3\nchatpdb.pm()\n```\n\nSee the documentation of [ipdb](https://github.com/gotcha/ipdb) or [pdb](https://docs.python.org/3/library/pdb.html) for the full api.\n\n### Configuration\nYou can use more specific environment variables to configure an OpenAI key and preferred model\nfor chatpdb. The following environment variables are supported:\n- `CHAT_PDB_OPENAI_API_KEY`: Your OpenAI API key\n- `CHAT_PDB_OPENAI_MODEL`: The model to use for chatpdb. Default is 'gpt-4-turbo'\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgauge-sh%2Fchatpdb","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgauge-sh%2Fchatpdb","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgauge-sh%2Fchatpdb/lists"}