From 793edbb492c4cbf5767aa5fbdb757d5c485ae352 Mon Sep 17 00:00:00 2001 From: Anurag Bhagsain Date: Wed, 16 Nov 2022 01:40:04 +0530 Subject: [PATCH] =?UTF-8?q?refactor:=20=F0=9F=9B=A0=EF=B8=8F=20remove=20@o?= =?UTF-8?q?clif/plugins?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 331 +++----------------------------------------- package.json | 6 +- src/commands/ask.ts | 2 +- 3 files changed, 21 insertions(+), 318 deletions(-) diff --git a/README.md b/README.md index 774b007..ac6a944 100644 --- a/README.md +++ b/README.md @@ -1,338 +1,43 @@ # GPT3 Powered CLI -Get answers from GPT3 right from your terminal. +Get answers from GPT3 right inside your terminal. [![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io) -[![Version](https://img.shields.io/npm/v/oclif-hello-world.svg)](https://npmjs.org/package/oclif-hello-world) -[![CircleCI](https://circleci.com/gh/oclif/hello-world/tree/main.svg?style=shield)](https://circleci.com/gh/oclif/hello-world/tree/main) -[![Downloads/week](https://img.shields.io/npm/dw/oclif-hello-world.svg)](https://npmjs.org/package/oclif-hello-world) -[![License](https://img.shields.io/npm/l/oclif-hello-world.svg)](https://github.com/oclif/hello-world/blob/main/package.json) +[![Version](https://img.shields.io/npm/v/@abhagsain/ai-cli.svg)](https://npmjs.org/package/@abhagsain/ai-cli) +[![Downloads/week](https://img.shields.io/npm/dw/@abhagsain/ai-cli.svg)](https://npmjs.org/package/@abhagsain/ai-cli) -* [GPT3 Powered CLI](#gpt3-powered-cli) -* [Usage](#usage) -* [Commands](#commands) + +- [GPT3 Powered CLI](#gpt3-powered-cli) +- [Usage](#usage) +- [Commands](#commands) # Usage -```sh-session + +```sh $ npm install -g @abhagsain/ai-cli -$ ai COMMAND +$ ai ask COMMAND running command... $ ai (--version) @abhagsain/ai-cli/0.0.1-0 darwin-x64 node-v14.18.3 + $ ai --help [COMMAND] + USAGE $ ai COMMAND + $ ai ask "Check if the remote port is open" + nc -vz ... ``` + # Commands -* [`ai ask [question]`](#ai-ask-question) -* [`ai auth`](#ai-auth) -* [`ai help [COMMAND]`](#ai-help-command) -* [`ai plugins`](#ai-plugins) -* [`ai plugins:install PLUGIN...`](#ai-pluginsinstall-plugin) -* [`ai plugins:inspect PLUGIN...`](#ai-pluginsinspect-plugin) -* [`ai plugins:install PLUGIN...`](#ai-pluginsinstall-plugin-1) -* [`ai plugins:link PLUGIN`](#ai-pluginslink-plugin) -* [`ai plugins:uninstall PLUGIN...`](#ai-pluginsuninstall-plugin) -* [`ai plugins:uninstall PLUGIN...`](#ai-pluginsuninstall-plugin-1) -* [`ai plugins:uninstall PLUGIN...`](#ai-pluginsuninstall-plugin-2) -* [`ai plugins update`](#ai-plugins-update) - -## `ai ask [question]` - -Get answers from GPT3 right from your terminal - -``` -USAGE - $ ai ask [question] - -ARGUMENTS - QUESTION Your question - -DESCRIPTION - Get answers from GPT3 right from your terminal - -EXAMPLES - $ ai ask "Check running process on port 3000" -``` - -_See code: [dist/commands/ask.ts](https://github.com/abhagsain/ai-cli/blob/v0.0.1-0/dist/commands/ask.ts)_ - -## `ai auth` - -Add existing or new OpenAI API Key - -``` -USAGE - $ ai auth - -DESCRIPTION - Add existing or new OpenAI API Key - -EXAMPLES - $ ai auth (Follow the prompt) -``` - -_See code: [dist/commands/auth.ts](https://github.com/abhagsain/ai-cli/blob/v0.0.1-0/dist/commands/auth.ts)_ - -## `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](https://github.com/oclif/plugin-help/blob/v5.1.17/src/commands/help.ts)_ - -## `ai plugins` - -List installed plugins. - -``` -USAGE - $ ai plugins [--core] - -FLAGS - --core Show core plugins. - -DESCRIPTION - List installed plugins. - -EXAMPLES - $ ai plugins -``` - -_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v2.1.6/src/commands/plugins/index.ts)_ - -## `ai plugins:install PLUGIN...` - -Installs a plugin into the CLI. - -``` -USAGE - $ ai plugins:install PLUGIN... - -ARGUMENTS - PLUGIN Plugin to install. - -FLAGS - -f, --force Run yarn install with force flag. - -h, --help Show CLI help. - -v, --verbose - -DESCRIPTION - Installs a plugin into the CLI. - Can be installed from npm or a git url. - - Installation of a user-installed plugin will override a core plugin. - - e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command - will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in - the CLI without the need to patch and update the whole CLI. - - -ALIASES - $ ai plugins add - -EXAMPLES - $ ai plugins:install myplugin - - $ ai plugins:install https://github.com/someuser/someplugin - - $ ai plugins:install someuser/someplugin -``` - -## `ai plugins:inspect PLUGIN...` - -Displays installation properties of a plugin. - -``` -USAGE - $ ai plugins:inspect PLUGIN... - -ARGUMENTS - PLUGIN [default: .] Plugin to inspect. - -FLAGS - -h, --help Show CLI help. - -v, --verbose - -DESCRIPTION - Displays installation properties of a plugin. - -EXAMPLES - $ ai plugins:inspect myplugin -``` - -## `ai plugins:install PLUGIN...` - -Installs a plugin into the CLI. - -``` -USAGE - $ ai plugins:install PLUGIN... - -ARGUMENTS - PLUGIN Plugin to install. - -FLAGS - -f, --force Run yarn install with force flag. - -h, --help Show CLI help. - -v, --verbose - -DESCRIPTION - Installs a plugin into the CLI. - Can be installed from npm or a git url. - - Installation of a user-installed plugin will override a core plugin. - - e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command - will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in - the CLI without the need to patch and update the whole CLI. - - -ALIASES - $ ai plugins add - -EXAMPLES - $ ai plugins:install myplugin - - $ ai plugins:install https://github.com/someuser/someplugin - - $ ai plugins:install someuser/someplugin -``` - -## `ai plugins:link PLUGIN` - -Links a plugin into the CLI for development. - -``` -USAGE - $ ai plugins:link PLUGIN - -ARGUMENTS - PATH [default: .] path to plugin - -FLAGS - -h, --help Show CLI help. - -v, --verbose - -DESCRIPTION - Links a plugin into the CLI for development. - Installation of a linked plugin will override a user-installed or core plugin. - - e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello' - command will override the user-installed or core plugin implementation. This is useful for development work. - - -EXAMPLES - $ ai plugins:link myplugin -``` - -## `ai plugins:uninstall PLUGIN...` - -Removes a plugin from the CLI. - -``` -USAGE - $ ai plugins:uninstall PLUGIN... - -ARGUMENTS - PLUGIN plugin to uninstall - -FLAGS - -h, --help Show CLI help. - -v, --verbose - -DESCRIPTION - Removes a plugin from the CLI. - -ALIASES - $ ai plugins unlink - $ ai plugins remove -``` - -## `ai plugins:uninstall PLUGIN...` - -Removes a plugin from the CLI. - -``` -USAGE - $ ai plugins:uninstall PLUGIN... - -ARGUMENTS - PLUGIN plugin to uninstall - -FLAGS - -h, --help Show CLI help. - -v, --verbose - -DESCRIPTION - Removes a plugin from the CLI. - -ALIASES - $ ai plugins unlink - $ ai plugins remove -``` - -## `ai plugins:uninstall PLUGIN...` - -Removes a plugin from the CLI. - -``` -USAGE - $ ai plugins:uninstall PLUGIN... - -ARGUMENTS - PLUGIN plugin to uninstall - -FLAGS - -h, --help Show CLI help. - -v, --verbose - -DESCRIPTION - Removes a plugin from the CLI. - -ALIASES - $ ai plugins unlink - $ ai plugins remove -``` - -## `ai plugins update` - -Update installed plugins. - -``` -USAGE - $ ai plugins update [-h] [-v] - -FLAGS - -h, --help Show CLI help. - -v, --verbose - -DESCRIPTION - Update installed plugins. -``` - - [`ai ask [question]`](#ai-ask-question) - [`ai auth`](#ai-auth) @@ -340,7 +45,7 @@ DESCRIPTION ## `ai ask [question]` -Get answers from GPT3 right from your terminal +Get answers from GPT3 right inside your terminal ``` USAGE @@ -356,7 +61,7 @@ EXAMPLES $ ai ask "Check running process on port 3000" ``` -_See code: [dist/commands/ask.ts](https://github.com/abhagsain/ai-cli/blob/v1.0.0/dist/commands/ask.ts)_ +_See code: [dist/commands/ask.ts](https://github.com/abhagsain/ai-cli/blob/v0.0.1-0/dist/commands/ask.ts)_ ## `ai auth` @@ -373,7 +78,7 @@ EXAMPLES $ ai auth (Follow the prompt) ``` -_See code: [dist/commands/auth.ts](https://github.com/abhagsain/ai-cli/blob/v1.0.0/dist/commands/auth.ts)_ +_See code: [dist/commands/auth.ts](https://github.com/abhagsain/ai-cli/blob/v0.0.1-0/dist/commands/auth.ts)_ ## `ai help [COMMAND]` diff --git a/package.json b/package.json index d80d2fa..8271a7d 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,6 @@ "dependencies": { "@oclif/core": "^1.19.1", "@oclif/plugin-help": "^5", - "@oclif/plugin-plugins": "^2.1.6", "chalk": "^4.1.2", "clipboardy": "^3.0.0", "fs-extra": "^10.1.0", @@ -53,8 +52,7 @@ "dirname": "ai", "commands": "./dist/commands", "plugins": [ - "@oclif/plugin-help", - "@oclif/plugin-plugins" + "@oclif/plugin-help" ], "topicSeparator": " ", "topics": { @@ -80,4 +78,4 @@ "oclif" ], "types": "dist/index.d.ts" -} +} \ No newline at end of file diff --git a/src/commands/ask.ts b/src/commands/ask.ts index 08eb3ec..63b6b3e 100644 --- a/src/commands/ask.ts +++ b/src/commands/ask.ts @@ -5,7 +5,7 @@ import { getDefaultCommandPrompt, getOpenAIKey } from "../helpers/index"; const { Configuration, OpenAIApi } = require("openai"); export default class AI extends Command { - static description = "Get answers from GPT3 right from your terminal"; + static description = "Ask question to GPT3 from your terminal"; static usage = "ask [question]"; static help = `ai ask "Check if a remote port is open"`;