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

@abhagsain/ai-cli

v1.3.0

Published

Get answers for CLI commands from GPT3 right from your terminal

Downloads

71

Readme

image

Installation

You'd need to install it globally

npm i @abhagsain/ai-cli -g

Usage

$ ai ask "Check process running on port"

You'd need to enter your own OpenAI API key Here's how you can get one

  1. Go to https://openai.com/api/login
  2. Create an account or log into your existing account
  3. Go to https://beta.openai.com/account/api-keys or
  4. Run ai auth, enter your API KEY and you're good to go!

Pricing

The current prompt length is ~800 tokens and average response length is ~40 tokens. The pricing for gpt-3.5-turbo is $0.001 per 1K input tokens and $0.002 per 1K output tokens which is ~$0.0009/command. We'll see if we can improve the response as well as reduce the per-command-cost with fine-tuning.


Add autocomplete by running ai autocomplete and follow the instructions. It's super easy.

__

Liked this project? Checkout my other side project. SlidesAI.io - AI Presentation Maker

__

Auto generated documentation

Usage

$ npm install -g @abhagsain/ai-cli
$ ai COMMAND
running command...
$ ai (--version)
@abhagsain/ai-cli/1.3.0 darwin-arm64 node-v18.0.0
$ ai --help [COMMAND]
USAGE
  $ ai COMMAND
...

Commands

ai ask [question]

Ask question to GPT3 from your terminal

USAGE
  $ ai ask [question]

ARGUMENTS
  QUESTION  Your question

DESCRIPTION
  Ask question to GPT3 from your terminal

EXAMPLES
  $ ai ask "Check running process on port 3000"

See code: dist/commands/ask.ts

ai auth

Update existing or add new OpenAI API Key

USAGE
  $ ai auth

DESCRIPTION
  Update existing or add new OpenAI API Key

EXAMPLES
  $ ai auth (Follow the prompt)

See code: dist/commands/auth.ts

ai autocomplete [SHELL]

display autocomplete installation instructions

USAGE
  $ ai autocomplete [SHELL] [-r]

ARGUMENTS
  SHELL  shell type

FLAGS
  -r, --refresh-cache  Refresh cache (ignores displaying instructions)

DESCRIPTION
  display autocomplete installation instructions

EXAMPLES
  $ ai autocomplete

  $ ai autocomplete bash

  $ ai autocomplete zsh

  $ ai autocomplete --refresh-cache

See code: @oclif/plugin-autocomplete

ai help [COMMAND]

Display help for ai.

USAGE
  $ ai help [COMMAND] [-n]

ARGUMENTS
  COMMAND  Command to show help for.

FLAGS
  -n, --nested-commands  Include all nested commands in the output.

DESCRIPTION
  Display help for ai.

See code: @oclif/plugin-help

ai model

Change model preference (default: gpt-3.5-turbo)

USAGE
  $ ai model

DESCRIPTION
  Change model preference (default: gpt-3.5-turbo)

EXAMPLES
  $ ai model (Follow the prompt)

See code: dist/commands/model.ts

ai update [CHANNEL]

update the ai CLI

USAGE
  $ ai update [CHANNEL] [-a] [-v <value> | -i] [--force]

FLAGS
  -a, --available        Install a specific version.
  -i, --interactive      Interactively select version to install. This is ignored if a channel is provided.
  -v, --version=<value>  Install a specific version.
  --force                Force a re-download of the requested version.

DESCRIPTION
  update the ai CLI

EXAMPLES
  Update to the stable channel:

    $ ai update stable

  Update to a specific version:

    $ ai update --version 1.0.0

  Interactively select version:

    $ ai update --interactive

  See available versions:

    $ ai update --available

See code: @oclif/plugin-update