https://github.com/zewebdev1337/gpt-cli-helper
Ever forget a command's name, syntax or options and just want to get it done quickly without RTFM or even whipping out a browser? Ask an LLM from your CLI!
https://github.com/zewebdev1337/gpt-cli-helper
Last synced: 11 months ago
JSON representation
Ever forget a command's name, syntax or options and just want to get it done quickly without RTFM or even whipping out a browser? Ask an LLM from your CLI!
- Host: GitHub
- URL: https://github.com/zewebdev1337/gpt-cli-helper
- Owner: zewebdev1337
- License: mit
- Created: 2023-11-25T19:27:23.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2024-10-21T18:29:48.000Z (over 1 year ago)
- Last Synced: 2025-02-07T11:16:51.568Z (about 1 year ago)
- Language: Python
- Homepage:
- Size: 36.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# GPT Command Line Helper
Ever forget a command's name, syntax, or options and just want to get it done quickly without [RTFM](https://en.wikipedia.org/wiki/RTFM) or even whipping out a browser? Ask GPT from your CLI!
## Installation
```bash
git clone git@github.com:zewebdev1337/gpt-cli-helper.git
cd gpt-cli-helper
chmod +x install.sh
sudo ./install.sh
```
The `install.sh` script will perform the following actions:
1. Create and activate a virtual Python environment.
2. Install pip dependencies.
3. Use PyInstaller to create a standalone executable.
4. Move the executable to `/usr/local/bin/` for easy access.
5. Clean up the build and venv directories.
## Requirements
- Python 3.6 or higher
- OpenAI/Anthropic/Mistral/Codestral/Gemini API Key
## Usage
After installation, you can use the `gpt` command to ask questions.
## Commands
- **Basic command:**
```bash
gpt
```
Example:
```bash
$ gpt format in github markdown for a link?
`[link text](URL)`
```
- **Ask a Question:**
```bash
gpt [] [--temp=] [--verbose] [--system=] [--max_tokens=]
```
Default models: `3.5, 4, 4-turbo, 4o, 7b, 8x7b, 8x22b, mistral-small, mistral-medium, mistral-large, codestral, gemini-pro, gemini-flash, claude-3-5, sonnet, opus, haiku`
Example:
```bash
$ gpt 3.5 How to change directory in Linux?
cd
$ gpt 7b How to list files in current directory in Linux?
ls
```
**NOTICE:**
If your question contains quotes, be sure to wrap it with another type of quote, otherwise it will mess up with the syntax and return an error.
Example:
```bash
$ gpt "what's the command to list all files in cd"
ls
$ gpt 'say "hello, world!" in Japanese'
こんにちは世界!
```
- **Add Model:**
```bash
gpt add_model
```
Example:
```bash
$ gpt add_model 4-turbo-preview gpt-4-turbo-preview
```
- **Set Default Model:**
```bash
gpt default_model
```
Example:
```bash
$ gpt default_model 4-turbo-preview
```
- **Set Default Temperature:**
```bash
gpt default_temp
```
Example:
```bash
$ gpt default_temp 0.5
```
- **Set Default Max Tokens:**
```bash
gpt default_max_tokens=
```
Example:
```bash
$ gpt default_temp 0.5
```
- **Set Default System Message:**
```bash
gpt default_system_message=""
```
Example:
```bash
$ gpt default_system_message="You're a PowerShell assistant."
```
- **Toggle Verbose Mode:**
```bash
gpt default_verbose
```
Example:
```bash
$ gpt default_verbose
Verbose mode enabled
```
Example output with verbose mode:
```bash
$ gpt exit from active python venv?
Model: gpt-4o, Temperature: 0
deactivate
```
- **Show Current Config:**
```bash
gpt current_config
```
Example output:
```bash
$ gpt current_config
{
"default_model": "4o",
"default_temp": 0,
"verbose": false,
"models": {
"3.5": "gpt-3.5-turbo",
"4": "gpt-4",
"4-turbo": "gpt-4-turbo",
"4o": "gpt-4o"
}
}
```
## Configuration
### Configuration file location
The configuration file is located at `~/.gpt-cli`
### Configuration options
Starting from v2.0 you can configure several options:
- **Default Model:** Change the default model used.
- **Default Temperature:** Change the default temperature for responses.
- **Verbose Mode:** Enable or disable verbose mode.
- **Add Model:** Add a new model to the model list.
### Default settings
- **Default model:** `gpt-4o`
- **Default temperature:** `0`
- **Verbose mode:** `Disabled`
- **Available models:**
- `gpt-3.5-turbo`
- `gpt-4`
- `gpt-4-turbo`
- `gpt-4o`
- `open-mistral-7b`
- `open-mixtral-8x7b`
- `open-mixtral-8x22b`
- `mistral-small-latest`
- `mistral-medium-latest`
- `mistral-large-latest`
- `codestral-latest*`
- `gemini-1.5-pro-latest`
- `gemini-1.5-flash-latest`
- `claude-3-5-sonnet-20240620`
- `claude-3-sonnet-20240229`
- `claude-3-opus-20240229`
- `claude-3-haiku-2024030`
### Modify defaults
Modify `default_config.json` before running the install script.
## Compatibility
The tool is designed for Linux and support for other OSes is not planned.
If you want support for other OS, please fork or mirror the repo.
PRs and issues regarding support for other OSes will be closed as `Will not implement`
## License
This project is licensed under the MIT License - see the LICENSE file for details.