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

agpt

v1.1.0

Published

A command line tool to interact with OpenAI's chat completion API

Downloads

10

Readme

AGPT

AGPT (Assistant with GPT) is a command line tool for interacting with OpenAI's GPT chat completion API. It allows you to ask questions and receive generated answers from OpenAI's GPT models. AGPT saves your questions and answers locally for easy reference.

Installation

Git

  1. Make sure you have Node.js installed on your machine.
  2. Download or clone this repository.
  3. Navigate to the repository folder in your terminal or command prompt.
  4. Run npm install to install the necessary dependencies.

NPM

  1. Make sure you have Node.js installed on your machine.
  2. Run npm install agpt (optionally with -g)

Usage

To use AGPT, navigate to the repository folder in your terminal or command prompt and run:

node index.js [options] ["question"]

Options:

  -h, --help                     Show help message
  --set-api-key                  Set API key in the config file
  --set-questions-directory      Set questions directory in the config file
  --set-model                    Set model in the config file
  -c, --config                   Set config file path for this run only
  -m, --model                    Use supplied model for this run only
  -s, --system-prompt            Set the system prompt for this question
  -n, --question-name            Set question name (should not contain spaces)
  --setup                        Only setup the question, don't query the API
  --no-context                   Don't use context from previous questions

Configuration

Before using AGPT, you need to set your OpenAI API key. You can obtain your API key from the OpenAI Developer Dashboard.

Set your API key by running:

node index.js --set-api-key "your_api_key_here"

You can also configure the questions directory to store your questions and answers:

node index.js --set-questions-directory "/path/to/your/questions/directory"

If you want to use a different GPT model (e.g. gpt-4), you can set it using:

node index.js --set-model "model_name"

Example

Ask a question:

node index.js -n "meaning-of-life" "What is the meaning of life?"

Ask a followup question to the answer you just received (by leaving out the -n):

node index.js "Who said it was 42?"

Set a system prompt:

node index.js -n "meaning-of-life" -s "Please provide a philosophical answer." "What is the meaning of life?"

For more examples and detailed usage instructions, you can check the help message with:

node index.js --help

Author

Stef Dunlap

License

MD GPL