{"id":13646200,"url":"https://github.com/emacs-openai/chatgpt","last_synced_at":"2025-04-21T17:32:24.560Z","repository":{"id":144629932,"uuid":"615972712","full_name":"emacs-openai/chatgpt","owner":"emacs-openai","description":"Use ChatGPT inside Emacs","archived":false,"fork":false,"pushed_at":"2025-02-24T18:14:38.000Z","size":5374,"stargazers_count":204,"open_issues_count":8,"forks_count":21,"subscribers_count":7,"default_branch":"master","last_synced_at":"2025-02-24T19:25:48.664Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Emacs Lisp","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/emacs-openai.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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},"funding":{"github":["emacs-openai","jcs090218"],"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2023-03-19T08:30:49.000Z","updated_at":"2025-02-24T18:14:41.000Z","dependencies_parsed_at":"2023-11-13T00:21:04.017Z","dependency_job_id":"5b4a7d54-ff50-495b-b596-c457e35c4468","html_url":"https://github.com/emacs-openai/chatgpt","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emacs-openai%2Fchatgpt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emacs-openai%2Fchatgpt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emacs-openai%2Fchatgpt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/emacs-openai%2Fchatgpt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/emacs-openai","download_url":"https://codeload.github.com/emacs-openai/chatgpt/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250100678,"owners_count":21374984,"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":[],"created_at":"2024-08-02T01:02:50.428Z","updated_at":"2025-04-21T17:32:24.547Z","avatar_url":"https://github.com/emacs-openai.png","language":"Emacs Lisp","funding_links":["https://github.com/sponsors/emacs-openai","https://github.com/sponsors/jcs090218","https://www.paypal.me/jcs090218","https://www.patreon.com/jcs090218"],"categories":["Others"],"sub_categories":[],"readme":"\u003cpicture\u003e\n  \u003csource media=\"(prefers-color-scheme: light)\" srcset=\"https://raw.githubusercontent.com/emacs-openai/openai/master/etc/light\"\u003e\n  \u003csource media=\"(prefers-color-scheme: dark)\" srcset=\"https://raw.githubusercontent.com/emacs-openai/openai/master/etc/dark.png\"\u003e\n  \u003cimg width=\"15%\" src=\"\" align=\"right\"\u003e\n\u003c/picture\u003e\n\n[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)\n[![JCS-ELPA](https://raw.githubusercontent.com/jcs-emacs/badges/master/elpa/v/chatgpt.svg)](https://jcs-emacs.github.io/jcs-elpa/#/chatgpt)\n\n# chatgpt\n\u003e Use ChatGPT inside Emacs\n\n[![CI](https://github.com/emacs-openai/chatgpt/actions/workflows/test.yml/badge.svg)](https://github.com/emacs-openai/chatgpt/actions/workflows/test.yml)\n\nThis Emacs Code extension allows you to use the official OpenAI API to generate\ncode or natural language responses from OpenAI's [ChatGPT](https://openai.com/blog/chatgpt)\nto your questions, right within the editor.\n\n*P.S. This plugin focuses on experience with making conversations with ChatGPT!*\n\n\u003cp align=\"center\"\u003e\n\u003cimg alt=\"demo\" src=\"./etc/demo.gif\"/\u003e\n\u003c/p\u003e\n\n## 💾 Installation\n\n#### package.el\n\nThis package is available from [JCS-ELPA](https://jcs-emacs.github.io/jcs-elpa/).\nInstall from these repositories then you should be good to go!\n\nNormally, you don't need to add `(require 'chatgpt)` to your configuration since\nmost `'chatgpt` commands are autoload and can be called without loading the module!\n\n#### use-package\n\nIf you are using [use-package](https://www.emacswiki.org/emacs/UsePackage),\nadd the following to your `init.el` file:\n\n```elisp\n(use-package chatgpt :ensure t)\n```\n\nor with `straight.el`:\n\n```elisp\n(use-package chatgpt\n  :straight (chatgpt :type git :host github :repo \"emacs-openai/chatgpt\"))\n```\n\n#### Manual installation\n\nCopy all `.el` files in this repository to `~/.emacs.d/lisp` and add the following:\n\n```elisp\n(add-to-list 'load-path \"~/.emacs.d/lisp/\")\n(require 'chatgpt)\n```\n\n## 🔑 Obtaining API key\n\nTo use this extension, you will need an API key from OpenAI. To obtain one,\nfollow these steps:\n\n1. Go to [OpenAI's website](https://beta.openai.com/account/api-keys). If you\ndon't have an account, you will need to create one or sign up using your Google\nor Microsoft account.\n2. Click on the `Create new secret key` button.\n3. Copy the key and paste into the 'API Key' field under the 'openai' custom group settings.\n\nWhen you create a new account, you receive $18 in free credits for the API which\nyou must use in the first 90 days. You can see pricing information\n[here](https://openai.com/api/pricing/). 1000 tokens are about 700 words, and\nyou can see the token count for each request at the end of the response in the\nsidebar.\n\n## 🔨 Usage\n\nBefore you can use this package you will need to [set up your API key](https://github.com/emacs-openai/openai#-usage) for openai library.\n\nTo start this package:\n\n```\nM-x chatgpt\n```\n\nYou will then be asked to insert your response; in this window, you press\n\u003ckbd\u003ereturn\u003c/kbd\u003e to send the message, and \u003ckbd\u003eShift\u003c/kbd\u003e+\u003ckbd\u003ereturn\u003c/kbd\u003e\nto insert a newline like a normal browser!\n\n## 📝 Customization\n\n#### 🧪 Variables\n\n- `chatgpt-model` - ID of the model to use. (Default: `\"gpt-3.5-turbo\"`)\n- `chatgpt-max-tokens` - The maximum number of tokens to generate in the completion. (Default: `2000`)\n- `chatgpt-temperature` - What sampling temperature to use. (Default: `1.0`)\n- `chatgpt-input-method` - The method to receive input. (Default: `'window`)\n- `chatgpt-display-method` - The method to display buffer. (Default: `nil`)\n- `chatgpt-spinner-type` - Type of the spinner. (Default: `'moon`)\n- `chatgpt-display-tokens-info` - Non-nil we display tokens information for each request. (Default: `t`)\n- `chatgpt-animate-text` - Display text gradually instead of output it all at once. (Default: `t`)\n- `chatgpt-animate-fps` - Frame per seconds to display text animation. (Default: `5`)\n\n## 🔗 References\n\n- [ChatGPT.el](https://github.com/joshcho/ChatGPT.el)\n- [gptel](https://github.com/karthink/gptel)\n\n## 🛠️ Contribute\n\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](http://makeapullrequest.com)\n[![Elisp styleguide](https://img.shields.io/badge/elisp-style%20guide-purple)](https://github.com/bbatsov/emacs-lisp-style-guide)\n[![Donate on paypal](https://img.shields.io/badge/paypal-donate-1?logo=paypal\u0026color=blue)](https://www.paypal.me/jcs090218)\n[![Become a patron](https://img.shields.io/badge/patreon-become%20a%20patron-orange.svg?logo=patreon)](https://www.patreon.com/jcs090218)\n\nIf you would like to contribute to this project, you may either\nclone and make pull requests to this repository. Or you can\nclone the project and establish your own branch of this tool.\nAny methods are welcome!\n\n### 🔬 Development\n\nTo run the test locally, you will need the following tools:\n\n- [Eask](https://emacs-eask.github.io/)\n- [Make](https://www.gnu.org/software/make/) (optional)\n\nInstall all dependencies and development dependencies:\n\n```sh\neask install-deps --dev\n```\n\nTo test the package's installation:\n\n```sh\neask package\neask install\n```\n\nTo test compilation:\n\n```sh\neask compile\n```\n\n**🪧 The following steps are optional, but we recommend you follow these lint results!**\n\nThe built-in `checkdoc` linter:\n\n```sh\neask lint checkdoc\n```\n\nThe standard `package` linter:\n\n```sh\neask lint package\n```\n\n*📝 P.S. For more information, find the Eask manual at https://emacs-eask.github.io/.*\n\n## ⚜️ License\n\nThis program is free software; you can redistribute it and/or modify\nit under the terms of the GNU General Public License as published by\nthe Free Software Foundation, either version 3 of the License, or\n(at your option) any later version.\n\nThis program is distributed in the hope that it will be useful,\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\nGNU General Public License for more details.\n\nYou should have received a copy of the GNU General Public License\nalong with this program.  If not, see \u003chttps://www.gnu.org/licenses/\u003e.\n\nSee [`LICENSE`](./LICENSE.txt) for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femacs-openai%2Fchatgpt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Femacs-openai%2Fchatgpt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Femacs-openai%2Fchatgpt/lists"}