A simple TypeScript-based Node.js script that lets you chat with OpenAI's API directly from your terminal β no client, no server, just pure local testing.
- Interactive CLI interface
- Sends messages to OpenAI's Chat API (
gpt-3.5-turboor custom model) - Graceful exit with
exit,quit, orq - Easy to extend and hack
-
Node.js (v16+)
-
ts-nodeandtypescript -
OpenAI API key
-
Create a .env file in the root:
OPENAI_API_KEY=your-openai-key-heregit clone git@github.com:ayak002/demoIAscript.git
cd openai-cli-test
npm installRUN
ts-node Ask.ts