March 20, 2023, 6:54 p.m. | Eric Hartford

Playing with AI erichartford.com

I thought I would try out ChatGPT's new API, so I decided to write a command line interface. My code is located here:


I wanted it to be conversational, so it will remember your conversation history as you type.


Similar to chatgpt-wrapper. https://github.com/mmabrouk/chatgpt-wrapper but in Node.


I wanted it to use TypeScript, and I wanted it to use Node's new native fetch api (which was officially promoted from "experimental" as of 18.13.0)


Example output:



I found that it's …

api chatgpt code command command line conversation conversational fetch history line node playing thought type typescript

Senior Machine Learning Engineer

@ GPTZero | Toronto, Canada

ML/AI Engineer / NLP Expert - Custom LLM Development (x/f/m)

@ HelloBetter | Remote

Werkstudent Data Architecture & Governance (w/m/d)

@ E.ON | Essen, DE

Data Architect, Data Lake, Professional Services

@ Amazon.com | Bogota, DC, COL

Data Architect, Data Lake, Professional Services

@ Amazon.com | Buenos Aires City, Buenos Aires Autonomous City, ARG

Data Architect

@ Bitful | United States - Remote