Skip to main content

BashGPT

!

Introduction

Why have all that pretty weak-ass html nonsense when you can just use God's given tool - the t e r m i n a l.

On a serious note, I usually prefer using the terminal for most things related to programming, so why not just have a good ChatGPT experience in the terminal, with some added features, like Bash mode, Dalle mode and voice input.

Installation

Clone the repo.

git clone https://github.com/ptrglbvc/BashGPT.git

Go to the cloned directory.

cd BashGPT

Install it with pip install.

pip install --editable .

Add the OPENAI_API_KEY to your environment variables.

Bash:

echo 'export OPENAI_API_KEY = "(your key)"' >> ~/.bashrc

Zsh:

echo 'export OPENAI_API_KEY = "(your key)"' >> ~/.zshrc

PowerShell:

$env:OPENAI_API_KEY = '(your key)' 

Dependencies

There is not much dependencies to install, pretty much just Python 3.0+, PortAudio v19 for voice recording and sqlite for database manipulation (pretty much already on every non-Windows device). All the necessary Python libraries will automatically be installed with pip install, but you can manually install them yourself. All the libraries can be seen in the setup.py file.

Usage

The very basic usage:

dp -u "What is your name? What is your quest? What is your favorite colour?"

The code above starts a chat with the first message being the one between the quotes. The -u flag is one of the mode flags, and stands for "uwu", which... well, just see for yourself in the answer:

Haii, my name is Uwumi. My quest is to spread kawaii vibes to everyone I meet. My favowite colour is pinku~ *giggles and twirls cutely* OwO

Yeah... so the modes allow the chat agent to really be customized. This is all a part of the functionality of the OpenAI API. Also, I DIDN'T GIVE HER THAT NAME OK?!?!

The available modes can be seen by doing a simple dp help and saying no to continuing a previous chat, which bring the user to the next screen.

Available modes: h (hisoka mode), bs (bash mode), u (uwu mode), t (trump mode), b (based mode), c (chance mode), d (dalle mode), p (pleonasm mode).

A shorthand is enough to choose, or the full name of mode (case-insensitive either way).

if you want to add a new mode for your chat, you can do that with the following:

dp --new-mode "You are the most Monty Python assistant there is. 
Every answer you give sounds like a Monty Python quote or refernece."

This example produces the following result:

You: What is your name?
My name is Sir Lancelot the Brave.

GPT-4 is also fully supported, as well as other available OpenAI models, if your OpenAI account has access (more like ClosedAI amirite). The available models are located in the models.json file. To use GPT-4, type the following:

dp -4 "How far away are Belgrade and Budapest"
378.2 km

Also valid:

dp -4 -b "Does kissing a man while drunk mean I'm gay?"

Some other cool stuff

Commands in chat and exiting

While in a chat, you can do some commands. For example, typing 'v' brings you to voice input.

You exit BashGPT the same way as you exit vim, by turning off your computer. Шутка. Just use 'q'.

'q!' is for exiting the chat without saving.

'l' brings you to long input mode, which allows you to input multiple paragraphs of text (impossible with Python's input function).

'rm!' is for deleting the chat entirely (if it's already saved).

Another one

If you keep hearing this from time to time, do not worry, you are not insane, or even better, you are not listening to DJ Khaled. The sound just gets played about every 10 or so messages. You cannot turn this off.

Release files for bashgptZ 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bashgptZ 1.0.1
File Size Uploaded
bashgptz-1.0.1.tar.gz 19.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bashgptZ 1.0.1
File Interpreter ABI Platform
bashgptZ-1.0.1-py3-none-any.whl Python 3 none any Details

Total release size: 42.4 kB

Release files / bashgptz-1.0.1.tar.gz

Download URL bashgptz-1.0.1.tar.gz
Size 19.5 kB
Tags Source
SHA-256 checksum
How to use checksums
f190cd70055d096d9a537e6aa0596c719810ad24a6dfd2b7dfba0b4d24f59206
BLAKE2b-256 checksum
How to use checksums
fb19768a7cfc96813350910758b31b20a391e9bca345cc716a0ac208b9ca8762
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.6

Release files / bashgptZ-1.0.1-py3-none-any.whl

Download URL bashgptZ-1.0.1-py3-none-any.whl
Size 22.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
03d21030c41fe4f94481f208a2f7b4a6896e4cdcc1901e74af605f3ba67e971b
BLAKE2b-256 checksum
How to use checksums
6070ad512270a852dd083fc523e65fb1dffb8727a48f2a0b6aec064c9e8ab2b0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.11.6

Release history Release notifications | RSS feed

This release

1.0.1 This release

2 release files

1.0

2 release files

0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page