bashgpt-cli
v1.4.1
Published
A Node.js CLI tool that uses OpenAI's ChatGPT API to generate BASH command suggestions and explanations for a given task.
Downloads
5
Maintainers
Readme
BashGPT
BashGPT is a Node.js CLI tool that uses OpenAI's ChatGPT API to generate BASH command suggestions and explanations for a given task.
Prerequisites
- Node.js (v14 or higher)
- An OpenAI account and API key
Installation
- Install the BashGPT package globally using npm:
npm install -g bashgpt-cliConfiguration
You can set the OPENAI_API_KEY environmental variable in your shell, for example, at the end of your .bashrc file.
Configuration There are two ways to configure BashGPT:
- Environment Variable
You can set the OPENAI_API_KEY environmental variable in your shell, for example, at the end of your .bashrc file:
export OPENAI_API_KEY=your_api_key_here- Configuration Commands BashGPT now supports persistent configuration using the following commands:
Available configuration options:
apiKey: Your OpenAI API key model: The GPT model to use (available options: gpt-4o-2024-08-06, gpt-4o-mini-2024-07-18)
# View current configuration
bashgpt config show
# Set your API key
bashgpt config set apiKey your-api-key-here
# Set preferred model
bashgpt config set model gpt-4o-2024-08-06If OPENAI_API_KEY is not set for your environment, you will be prompted to provide it.
Usage
Run the bashgpt command followed by your query without quotes:
bashgpt list all files in the current directory