RepositoryJavaScriptUSUnited States
KudoAI

KudoAI/chatgpt.js

🤖 A powerful, lightweight JavaScript library + interactive CLI for ChatGPT

2.0kstars
173forks
0issues
3views

Featured achievements

The project's latest awards

1
TINIX TRENDING·Topic: conversational-bots

#1 Repository of the week

1
TINIX TRENDING·Topic: clientside

#1 Repository of the week

6
TINIX TRENDING·Topic: conversational-ai

#6 Repository of the week




⚡ Installation

Library

Node.js:

From your project root:

npm install @kudoai/chatgpt.js

Web:

Greasemonkey:

Note To use a starter template: KudoAI/chatgpt.js-greasemonkey-starter

// @require https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@4/dist/chatgpt.min.js
// ==/UserScript==

Chrome:

Note To use a starter template: KudoAI/chatgpt.js-chrome-starter

  1. Save https://cdn.jsdelivr.net/npm/@kudoai/chatgpt.js@4/dist/chatgpt.min.js to lib

  2. In project's (V3) manifest.json, add lib/chatgpt.min.js as a web accessible resource

    "web_accessible_resources": [{
        "matches": ["<all_urls>"],
        "resources": ["lib/chatgpt.min.js"]
    }],

CLI app

Node.js:

npm install -g @kudoai/chatgpt.js

API keys

Supported providers:

OpenRouter — 300+ models, dozens free

1. Create API key: https://openrouter.ai/settings/keys

2. Add key to environment:

Windows:
setx OPENROUTER_API_KEY "sk-or-v1-8a69..."
Mac/Linux:
export OPENROUTER_API_KEY="sk-or-v1-8a69..."
Google AI — Gemini + Gemma models

1. Create API key: https://aistudio.google.com/api-keys

2. Add key to environment:

Windows:
setx GOOGLE_API_KEY "AIzaSyB..."
Mac/Linux:
export GOOGLE_API_KEY="AIzaSyB..."

💻 Usage

ES Modules (ESM):

import chatgpt from '@kudoai/chatgpt.js'

console.log(await chatgpt.send('sup'))
// e.g. => Hey! Not much—just here and ready to help. What's up with you?

CommonJS (CJS):

(async () => {
    const chatgpt = require('@kudoai/chatgpt.js')

    console.log(await chatgpt.send('sup'))
    // e.g. => Hey! What's up?
})()

Chrome:

(async () => {
    await import(chrome.runtime.getURL('lib/chatgpt.min.js'))

    await chatgpt.isLoaded()
    console.log('ChatGPT is ready!') 
})()

Terminal:

After setting an API key, control from your terminal:

chatgpt --query "sup"  # or gpt -q sup
# e.g. => Hey there! What's up?

chatgpt --ascii-art "cat"  # or gpt -a cat
# e.g. =>
#
#       |\      _,,,---,,_
# ZZZzz /,`.-'`'    -.  ;-;;,_
#      |,4-  ) )-,_. ,\ (  `'-'
#     '---''(_/--'  `-'\_)

chatgpt --commit-msg  # or gpt -g (in a git repo)
# e.g. => feat: add `--ascii-art` cli cmd

(Optional) Create .chatgpt.config.mjs (customize provider, etc.):

chatgpt init  # or gpt -i

View all CLI options:

chatgpt --help

For more options & examples, see the extended user guide:

https://github.com/KudoAI/chatgpt.js/blob/v4.14.2/docs/USERGUIDE.md



🚀 Made with chatgpt.js

AmazonGPT  

Add AI chat & product/category summaries to Amazon shopping, powered by the latest LLMs!

Greasemonkey / README / Discuss

Autoclear ChatGPT History  

Auto-clear your ChatGPT query history for maximum privacy.

Greasemonkey / README / Discuss

BraveGPT  

Add AI chat & search summaries to Brave Search, powered by the latest LLMs!

Greasemonkey / README / Discuss

ChatGPT Auto-Continue  

Automatically continue generating answers when ChatGPT responses get cut off.

Chrome / Firefox / Edge / README / Discuss


Have a library idea or request?

Create a new Issue: https://github.com/KudoAI/chatgpt.js/issues/new


ChatGPT Auto Refresh ↻  

Keeps ChatGPT sessions fresh, eliminating chat time limits + network errors + Cloudflare checks.

Greasemonkey / README / Discuss

ChatGPT Auto-Talk 📣  

Auto-play ChatGPT responses.

Greasemonkey / README / Discuss

ChatGPT Infinity  

Generate endless answers powered by ChatGPT (on any topic!)

Chrome / Firefox / Edge / Greasemonkey / README / Discuss

ChatGPT Widescreen  

Enhances ChatGPT with wide/full/tall-screen + spamblock modes. Also works on poe.com!

Chrome / Firefox / Edge / Greasemonkey / README / Discuss

DuckDuckGPT  

Add AI chat & search summaries to DuckDuckGo, powered by the latest LLMs!

Greasemonkey / README / Discuss

GoogleGPT  

Add AI chat & search summaries to Google Search, powered by the latest LLMs!

Greasemonkey / README / Discuss

ThunderAI  [Rated 5-stars]

Use ChatGPT in Thunderbird to enhance your emails, even with a free account!
Install / README / Support


🧠 Contributors



All contributions are welcome!


🏛️ License

MIT License

Copyright © 2023–2026 KudoAI & contributors.

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Similar Projects

Discover other similar projects and AI models.

RepositoryMDX
f/prompts.chat

f.k.a. Awesome ChatGPT Prompts. Share, discover, and collect prompts from the community. Free and open source — self-host for your organization with complete privacy.

179.0k
Dec 1, 2026
RepositoryPython
Significant-Gravitas/AutoGPT

AutoGPT is the vision of accessible AI for everyone, to use and to build on. Our mission is to provide the tools, so that you can focus on what matters.

188.2k
Nov 29, 2026
RepositoryJupyter Notebook
microsoft/AI-For-Beginners

12 Weeks, 24 Lessons, AI for All!

71.5k
Nov 15, 2026
Dataset
fka/prompts.chat

a.k.a. Awesome ChatGPT Prompts This is a Dataset Repository mirror of prompts.chat — a social platform for AI prompts. 📢 Notice This Hugging Face dataset is a mirror. For the latest prompts, features, and community contributions, please visit: 🌐 Website: prompts.chat 📦 GitHub: github.com/f/awesome-chatgpt-prompts About prompts.chat is an open-source platform where users can share, discover, and collect AI prompts from the community. The project can… See the full description on the dataset page: https://huggingface.co/datasets/fka/prompts.chat.

♥0
24.6k
Nov 30, 2026
RepositoryPython
NousResearch/hermes-agent

The agent that grows with you

267.7k
Dec 2, 2026
RepositoryTypeScript
thedotmack/claude-mem

Persistent Context Across Sessions for Every Agent – Captures everything your agent does during sessions, compresses it with AI, and injects relevant context back into future sessions. Works with Claude Code, OpenClaw, Codex, Gemini, Hermes, Copilot, OpenCode + More

121.3k
Dec 2, 2026
RepositoryPython
asgeirtj/system_prompts_leaks

Leaked system prompts of ChatGPT, Claude, Gemini and more. The hidden system prompt of every popular chatbot, in full, every version since May 2025. Also Anthropic Claude Code, OpenAI Codex, Google Antigravity, xAI Grok, Meta Muse, Moonshot Kimi, Alibaba Qwen, Z.ai GLM ZCode, MiniMax, Cursor, Perplexity, DeepSeek and 30+ others. Updated daily.

73.9k
Nov 29, 2026
RepositoryPython
RasaHQ/rasa

💬 Open source machine learning framework to automate text- and voice-based conversations: NLU, dialogue management, connect to Slack, Facebook, and more - Create chatbots and voice assistants

21.4k
Jul 24, 2026
RepositoryPython
sfyc23/EverydayWechat

微信助手:1.每日定时给好友(女友)发送定制消息。2.机器人自动回复好友。3.群助手功能(例如:查询垃圾分类、天气、日历、电影实时票房、快递物流、PM2.5等)

10.4k
Jun 22, 2021