npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

get-response

v1.10.1

Published

Ask any questions to AI, and get your response right at your terminal

Downloads

46

Readme

Get Response - A terminal-based AI chat-bot

Get-Response is a node.js based command-line interface (CLI) created by Swapnoneel Saha tool that interacts with the Google's Gemini API to generate content based on the user input. This tool allows you to ask questions directly or provide context from files, images or directories, and get the response in a simple and easy to understand interface. Also, you can automate some terminal commands by prompting for the task. And additionally, we also have support for responses from Stack Exchange sites like Stack Overflow

Installation

To install this package, you need to have node.js and npm installed in your machine. If you don't have them installed, you can refer to this article. Once that's done, you can install the package globally by using this command in your terminal:

npm i get-response -g

Usage

Simple Usage

To ask a question directly from the command line (context is not stored for further questions):

npx get-response "<Ask your question>"

Using a File as the Context

To provide additional context about your question, you can use the -f or --file flag followed by the file path:

npx get-response "<Ask your question>" -f ./path/to/your/file.js

Using a PDF as the Context

To provide additional context about your question, you can use the -p or --pdf flag followed by the file path:

npx get-response "<Ask your question>" -p ./path/to/your/pdf.pdf

Using a Directory as the Context

To provide additional context about your question, you can use the -d or --directory flag followed by the name of the directory:

npx get-response "<Ask your question>" -d ./path/to/your/directory

Using an Image as the Context

To provide additional context about your question, you can use the -i or --image flag followed by the name of the image file:

npx get-response "<Ask your question>" -i ./path/to/your/image.png

Note: The image must contain texts, for valid responses!

Chat Mode

In the context-based chat mode, you can ask multiple questions in a session:

npx get-response -c

Alternatively, you can also use:

npx get-response --chat-mode

In the chat mode, the prompt Type your message: will appear, indicating that the tool is ready for you to type your question or command.

To exit the chat mode, type exit and press Enter, also you can access the Stack Exchange mode anytime you want by typing stack and hitting enter.

Also, you can use the chat mode in association with the file, directory and PDF file as the context, using the -f, -d and -p flags respectively.

Terminal Mode

In the terminal mode, you can ask the AI to perform some specific actions and it will automatically execute the commands in your terminal based on your permission:

npx get-response "<Mention your task>" -t

Alternatively, you can also use:

npx get-response "<Mention your task>" --terminal

Get Response from Stack Exchange

You can also ask a question to Stack Exchange and get the response based on the most relevant conversations based on that topic, also you can limit the number of links that you want to see from the response.

npx get-response "Mention your question/problem" -s "maximum number of links"

Alternatively, you can also use:

npx get-response "Mention your question/problem" --search-stack "maximum number of links"

Other than this, we also have a Stack Exchange interface in the live chat mode, and you can switch to it whenever you want by typing stack as a response, while you are on the chat mode. And you will be able to have a conversation with the StackAI. To switch back to the AI chat mode, you can simply type chat as a response, and you'll be back on the interactive chat mode with the context of the previous interactions of the current session!

Generate Workflow of the codebase

Using the mermaid code generator, you can generate the entire workflow of the codebase in a single image file. For that, you can use:

npx get-response -m -f index.js

Alternatively, you can also give directory as a context,

npx get-response -m -d ./src

Example

Asking a Simple Question

npx get-response "What is the currency of South Africa?"

Asking a Question with File Context

npx get-response "Tell me, what is the function of the variable named toggleMode" -f ./index.js

Alternatively, you can also use:

npx get-response "Tell me, what is the function of the variable named toggleMode" --file ./index.js

Asking a Question with PDF Context

npx get-response "What is the summary of the story" -p ./sample.pdf

Alternatively, you can also use:

npx get-response "What is the summary of the story" --pdf ./sample.pdf

Asking a Question with Directory Context

npx get-response "Write unit test cases for each of the functions" -d ./sample-app

Alternatively, you can also use:

npx get-response "Write unit test cases for each of the functions" --directory ./sample-app

Entering the Chat Mode with a File, Directory or PDF Context

npx get-response -c -f ./index.js

Or,

npx get-response -c -d ./sample-app

Or,

npx get-response -c -p ./sample.pdf

Asking to Create a React Application

npx get-response "Create a React application named get-response" -t

Or,

npx get-response "Create a directory named 'hello' and a text file named 'hi' inside it" --terminal

Asking for the solution to a problem from Stack Exchange

npx get-response "How to shutdown a PC from the terminal?" -s 3

Or,

npx get-response "How to copy a file from one directory to another?" --search-stack 10

Contributing

If you want to contribute to this project, please go ahead!! Open an issue or submit a pull request for any improvements, bug fixes or feature implementations.

Bug Reporting

For any questions, suggestions or issues, please open an issue in the GitHub repository.