Skip to content

longlongago2/chatgpt-console

Repository files navigation

ChatGPT-console

ChatGPT for terminal

Features

  • 🤖 Support command line intelliSense, you only need to describe to generate a command line and execute

  • ⏱️ Support import/export history chat log

  • 🧱 Support proxy openai service

  • ⚡ Support third-party api

  • 📷 Support image generator

  • ⛅ Support weather forecast

Usage

1. Configure environment variables

# Create .env.local file

# [Required] ChatGPT API key
OPENAI_API_KEY="xxx"

# [Optional] ChatGPT Identifier for this organization sometimes used in API requests
# ORGANIZATION_ID="org-xxx"

# [Required] Amap API key, used to query weather forecast, key application url: https://console.amap.com/dev/key/app
AMAP_KEY="xxx"

2. Enter the project root directory and install dependencies

npm install

3. Start service

npm start

4. Global install

You can use command chatgpt by installing it globally

npm link

chatgpt

Proxy

If you are in a country with a Great Firewall, such as China, please use a VPN to assist you and configure it in the .env file.

# .env file
# Take Clash as an example, note the port of Clash

HTTP_PROXY="http://127.0.0.1:7890"
HTTPS_PROXY="http://127.0.0.1:7890"

or, we support the third-party registry

# .env file
# ChatGPT registry: default is https://api.openai.com/v1, if you have a third-party registry, please change it here.

CHATGPT_REGISTRY="https://api.openai-sb.com/v1"

Screenshot

screenshot

FAQ

1. 如何申请 openaiKey

https://platform.openai.com/account/api-keys

ORGANIZATION_ID 可不用配置,必须配置 OPENAI_API_KEY

2. openai 官方文档

https://platform.openai.com/docs/introduction

3. 开启了代理仍然报网络错误

ChatGPT 生成对话失败 => Error: Client network socket disconnected before secure TLS connection was established

目前遇到的情况,一般是代理的问题,请升级 Clash 到最新版本,可以解决。

4. nsufficient_quota: You exceeded your current quota, please check your plan and billing details.

ChatGPT 生成对话失败 => insufficient_quota: You exceeded your current quota, please check your plan and billing details.

这种情况是您的账户需要付费,chatGPT该氪你金了

5. Error: Too Many Requests(429)

接口余额不足,需要绑定信用卡

6. 如何配置第三方的接口和key

key的配置方式不变,支持第三方接口配置,例如:在 .env 文件中配置 CHATGPT_REGISTRY="https://api.openai-sb.com/v1"

7. 如何查询天气

对话:今天南京天气如何?/ 南京最近几天的天气预报 / 明天天气适合出门吗?

Releases

No releases published

Packages

No packages published