0.1.1 • Published 8 months ago

openai-sh v0.1.1

Weekly downloads
-
License
-
Repository
github
Last release
8 months ago

OPENAI-SH

Fast ChatGPT CLI powered by Azure OpenAI.

Setup

The minimum supported version of Node.js is v14

  1. Install openai-sh:
npm install -g openai-sh
  1. Follow the config steps when first run:
ai

Usage

ai <system prompt>?

With this command, you can engage in a conversation with the AI and receive helpful responses in a natural, conversational manner directly through the CLI:

┌  Starting new conversation
│
◇  You:
│  how do I serve a redirect in express
│
◇  AI Shell:

In Express, you can use the `redirect()` method to serve a redirect. The `redirect()` method takes one argument, which is the URL that you want to redirect to.

Here's an example:

\`\`\`js
app.get('/oldurl', (req, res) => {
  res.redirect('/newurl');
});
\`\`\`

Set Language

The AI Shell's default language is English, but you can easily switch to your preferred language by using the corresponding language keys, as shown below:

LanguageKey
Englishen
Simplified Chinesezh-Hans
Traditional Chinesezh-Hant
Spanishes
Japanesejp
Koreanko
Frenchfr
Germande
Russianru
Ukrainianuk
Vietnamesevi
Arabicar
Portuguesept
Turkishtr

For instance, if you want to switch to Simplified Chinese, you can do so by setting the LANGUAGE value to zh-Hans:

ai config set LANGUAGE=zh-Hans

This will set your language to Simplified Chinese.

Credit