Clyde is a chatbot – CLI build using JavaScript

  • Clone the project: git clone https://github.com/nandhu-44/clyde-chatbot-cli.git

  • Change directory to the project: cd clyde-chatbot-cli

  • Install dependencies: npm install

  • Run the project: npm start

Explanation

index.js

  • Importing all the libraries.

  • Clearing the console and setting up the environment variables.

  • Some animation for the first 4 seconds before starting.

  • Taking the url from env and if for some reason it doesnt exist, read from a text file env.txt .

  • Making an async function to fetch chatbot reponse from the API.

utils/inquirer.js

  • Using the inquirer module to ask the user for the input.

If you dont have an apikey get it from here

Put it in the .env file like

url=YOUR_URL

or in the env.txt file like

YOUR_URL

A sample url would look like this

http://api.brainshop.ai/get?bid={brainid}&key={apikey}&uid={uid}&msg=

You will get the values of brainid , apikey and uid from the above website.

Replace it with the sample url. (Dont use the curly braces).

The url they provide will end with a =[msg] . So make sure to remove it as we are appending it from user input.

💡 Idea by: Aadhu

GitHub

View Github