A npm package that uses OpenAI + Langchain to perform convenient commands in the terminal.
Ensure that typescript is installed globally npm install -g typescript
.
To get started with the project clone the repository and run npm i & npm run build & npm install -g .
within the project root.
Mac or Linux users may have to run sudo
before some of these commands.
Calling the gptcli
command from the command-line will run the CLI.
For updates simply run git pull & npm i & npm run build
within the project root.
It is important to set your keys to expect full functionality. run the gptcli config
command for more information.
gptcli config openai <key>
The following is a list of commands currently configured within the gptcli
:
gptcli config
: Configures environment variables required to run programs within the CLI, it is recommended that you set any required variables through this command before using the CLI.gptcli summary
: Summarizes text and webpage contents, uses map reduce to ensure no limits are encountered for the textgptcli translate
: Translates the input text to a desired language.gptcli understand
: Parses a webpage and allows the user to ask questions about its contents in chat format.gptcli chat
: Runs a chat interface, limited to 1 step of reasoning per message.gptcli prompt
: Answers a single prompt with no history. Can perform complex multi-step reasoning.
Additional envrionment variables can be set to enabled agents with the following functionalities:
- Search Functionality: Provided thorugh
SerpAPI
orValueSerp
- Live Stock Price Functionality: Provided thorugh
Finnhub
The following commands can be improved by setting Environment Tools:
gptcli prompt
gptcli chat
Envrionment Variables:
# Sets the SERPAPI_API_KEY, enables search functionality
> gptcli config serpapi <key>
# Sets the VALUESERP_API_KEY, enables search functionality
> gptcli config valueserp <key>
# Sets the FINNHUB_API_KEY, enables live stock price functionality
> gptcli config finnhub <key>
For more information run the gptcli help
command.