{"id":18076018,"url":"https://github.com/rabilrbl/gh_copilot_chat","last_synced_at":"2025-04-05T19:42:27.905Z","repository":{"id":239212055,"uuid":"798889355","full_name":"rabilrbl/gh_copilot_chat","owner":"rabilrbl","description":"Unofficial GH Copilot SDK (Reverse Engineered API)","archived":false,"fork":false,"pushed_at":"2024-05-11T05:05:29.000Z","size":47,"stargazers_count":4,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-11T17:58:53.663Z","etag":null,"topics":["copilot","copilot-chat","reverse-engineering"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rabilrbl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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-05-10T17:30:21.000Z","updated_at":"2025-01-10T04:01:11.000Z","dependencies_parsed_at":"2024-05-11T05:23:47.831Z","dependency_job_id":null,"html_url":"https://github.com/rabilrbl/gh_copilot_chat","commit_stats":null,"previous_names":["rabilrbl/gh-copilot-sdk","rabilrbl/gh_copilot_chat"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rabilrbl%2Fgh_copilot_chat","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rabilrbl%2Fgh_copilot_chat/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rabilrbl%2Fgh_copilot_chat/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rabilrbl%2Fgh_copilot_chat/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rabilrbl","download_url":"https://codeload.github.com/rabilrbl/gh_copilot_chat/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247393539,"owners_count":20931809,"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":["copilot","copilot-chat","reverse-engineering"],"created_at":"2024-10-31T11:08:25.149Z","updated_at":"2025-04-05T19:42:27.887Z","avatar_url":"https://github.com/rabilrbl.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# GitHub Copilot Chat\n\nThis is a Python SDK that provides a simple interface to interact with the GitHub Copilot API. It uses reverse engineered API, unofficial, use at your own risk. This SDK is not affiliated with GitHub. It was created for educational purposes only.\n\nTo run this project, you need to set the following environment variables:\n- `GH_TOKEN`: Generated by Official GitHub Client. You need to find this yourself and use it at your own risk. If you know what you are doing, you will know how to get this token. The developer of this project won't provide any support for this.\n\n## Example Usage\n\n```python\nfrom gh_copilot_chat import Copilot\nimport asyncio\nimport json\n\n\nasync def run():\n    async with Copilot() as cp:\n        thread_id = await cp.new_chat()\n        print(\"-----\")\n        while True:\n            question = input(\"You: \")\n            if question == \"exit\":\n                break\n            print(\"Copilot: \", end=\"\")\n            async for line in cp.ask_stream(thread_id, question):\n                response = line.replace(\"data: \", \"\")\n                try:\n                    response = json.loads(response)\n                except json.decoder.JSONDecodeError:\n                    continue\n                if response[\"type\"] == \"content\":\n                    print(response[\"body\"], end=\"\")\n                elif response[\"type\"] == \"complete\":\n                    print()\n                    break\n            print(\"-----\")\n        await cp.generate_title(thread_id)\n    return True\n\n\nasyncio.run(run())\n```\n\n## Pip Installation\n\nInstall the package using pip/any other package manager\n\n```bash\npip install gh_copilot_chat\n```\n\nThen you can use the package in your code\n\n## Poetry Project\n\nThis is a Python project that uses [Poetry](https://python-poetry.org/) for dependency management and packaging.\n\n## Getting Started\n\n1. Install Poetry by following the [official installation guide](https://python-poetry.org/docs/#installation).\n\n2. Clone this repository:\n\ngit clone https://github.com/rabilrbl/gh_copilot_sdk.git\n\n3. Navigate to the project directory:\n\ncd gh_copilot_sdk\n\n1. Set required environment variables from the `.env.example` file.\n\n2. Install the project dependencies:\n\npoetry install\n\n3. Activate the virtual environment (if required)\n\npoetry shell\n\nYou're now ready to work on the project!\n\n## Running the Project\n\nTo run the project, use the following command:\n\npoetry run python gh_copilot_sdk/main.py\n\nThis will execute the `main.py` file within the virtual environment.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frabilrbl%2Fgh_copilot_chat","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frabilrbl%2Fgh_copilot_chat","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frabilrbl%2Fgh_copilot_chat/lists"}