Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>ChatGPTNew to Visual Studio Code? Get it now.

ChatGPT

zhang-renyang

|
10,189 installs
| (7) | Free
A ChatGPT integration for VS Code
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

ChatGPT

  • This is a ChatGPT Visual Studio Code extension
  • It can be installed from the marketplace

Commands:

  • ChatGPT: Query (will provide you with a prompt for you to ask a question)
  • ChatGPT: Can you add tests for this code? (will generate test code based on file/text selection)
  • ChatGPT: Why is this code broken? (will analyze your code and highlight any logical/syntax - errors)
  • ChatGPT: Can you explain what this code does?
  • ChatGPT: Can you refactor this code and explain what\'s changed?
  • ChatGPT: Update APIKey
  • ChatGPT: Set language

All content except for resetting the API key and querying is also accessible from the context menu by right-clicking anywhere in the editor.

How to Use

Obtaining API keys

  • To get the OpenAI API key, you will need to first register for an account on the OpenAI website. Once you have registered, you can log in to your account and find the API keys section on the https://beta.openai.com/account/api-keys page. Here you can generate a new API key or view existing ones.
  • Ctrl+Shift+P is a common shortcut in Visual Studio Code for opening the command palette. The command palette is a pop-up window that allows you to access various commands in Visual Studio Code. To update the APIKey, you can enter the command ChatGPT: Update APIKey, and then enter your new APIKey.

ChatGPT(中文)

  • 这是一个 ChatGPT Visual Studio Code 扩展
  • 可以从插件市场安装

命令:

  • ChatGPT: 查询(将为您提供一个提示,让您提出问题)
  • ChatGPT: 你能为这段代码添加测试吗?(将根据文件/文本选择生成测试代码)
  • ChatGPT: 为什么这段代码坏了?(将分析您的代码并突出显示任何逻辑/语法错误)
  • ChatGPT: 你能解释一下这段代码做什么吗?
  • ChatGPT: 你能重构这段代码并解释改变了什么吗?
  • ChatGPT: 更新 APIKey
  • ChatGPT: 设置语言

除了重置 API 密钥和查询之外,右键单击编辑器中的任何位置均可从上下文菜单中访问所有内容。

使用方法

获取API keys

  • 要获取 OpenAI 的 API 密钥,您需要先在 OpenAI 网站上注册账号。注册完成后,您可以登录到您的账户并在https://beta.openai.com/account/api-keys设置页面中找到API 密钥部分。您可以在这里生成新的 API 密钥,或者查看已有的密钥
  • Ctrl+Shift+P 是 Visual Studio Code 中常用的快捷键,用于打开命令面板。命令面板是一个弹出窗口,用于访问 Visual Studio Code 中的各种命令,如果想要更新APIKey的可以输入命令ChatGPT: 更新APIKey,输入新的APIKey即可

交流方式

QQ群

  • QQ扫描加群一起讨论,备注为 ChatGPT

微信

  • 扫描微信可以加好友拉入微信交流群一起讨论,备注为 ChatGPT

  • Contact us
  • Jobs
  • Privacy
  • Terms of use
  • Trademarks
© 2023 Microsoft