1.1.3 • Published 7 months ago
node-gpt-cli v1.1.3
Node GPT CLI
A powerful CLI tool for GPT-4 prompts written in JavaScript. Requires Node.js 20+
Install
npm i -g node-gpt-cliAdd your API key
Create an OpenAI API key and assign it to OPENAI_API_KEY environment variable:
export OPENAI_API_KEY=<YOUR-API-KEY>Optional: If you have multiple organizations, you can set your organization ID:
export OPENAI_ORG_ID=<YOUR-ORG-ID>Pass prompts to it
gpt3 what is best in life?Pipe in prompts
echo "what is my name?" | gpt3Configuration
On install, default parameters are written to ~/.node-gpt-config.json. You can modify them there:
{
"url": "https://api.openai.com/v1/chat/completions",
"model": "gpt-4-turbo-preview",
"max_tokens": 2048,
"temperature": 0,
"top_p": 1,
"frequency_penalty": 0,
"presence_penalty": 0
}Configuration Parameters
model: The GPT model to use (currently set to GPT-4 Turbo for faster, more capable responses)max_tokens: Maximum number of tokens in the responsetemperature: Controls randomness (0 = more focused, 1 = more creative)top_p: Controls diversity via nucleus samplingfrequency_penalty: Reduces likelihood of repeating the same informationpresence_penalty: Encourages the model to talk about new topics
Features
- Uses the latest GPT-4 Turbo model
- Native ESM support
- Improved error handling and validation
- Support for organization ID
- Modern Node.js features and best practices