Skip to main content

TermQ

License: MIT unstable

A minimal GPT chat client in the terminal. A toy experiment with OpenAI's GPT API.

All code have only tested on macOS, not guaranteed to work on other platforms.

Prerequisites

export OPENAI_API_KEY=<your key>
python -m termq-venv
source termq-venv/bin/activate
pip install -r requirements.txt
# Optional, for PDF OCR if you want multi-language support
# Read more here: https://github.com/ocrmypdf/OCRmyPDF#languages
brew install tesseract-lang

Running

Usage: python script.py [OPTIONS]

Options:
  -c, --load-character FILE     Specify a character file location.
  --stream                      Enable streaming mode.
  -e, --load-engine TYPE        Specify an engine type, default is `gpt-3.5-turbo`.
  --tts                         Enable text-to-speech.
  -q, --question                Ask a question to the chatbot and get an answer directly.
  --help                        Show this message and exit.

Chat with GPT

Config setup

On first run, termq creates this config layout automatically:

~/.config/termq/
  characters/   # built-in presets copied from the package
  history/      # chat_history-YYYYMMDD-HHMMSS.json files

You can pass either a preset name (for example -c hal9000) or a full path to a custom character file.

Default Assistant

python chat.py
🎬 Example usage

https://github.com/tommyjtl/termchat/assets/1622557/fb5d111b-42fb-4899-aeb6-c97202847a6f

Specifiy a personality

python chat.py -c <character>
🎬 Example usage

https://github.com/tommyjtl/termchat/assets/1622557/9d4ae7d7-d62b-4e28-b428-6b676d3780aa

On-demand Terminal Q&A

python chat.py -q
🎬 Example usage

https://github.com/tommyjtl/termchat/assets/1622557/8b25b39f-3145-4ad8-886e-a39e3d165b9f

Chat with PDF

# Normal usage
python pdf.py -f <file>

# Add --ocr if your PDF doesn't have text layer, default OCR language is English
python pdf.py -f <file> --ocr

# Add --ocr-lang to specify OCR language
# For <lang>, use 3-digit ISO 639-2 Code, see more here: https://github.com/tesseract-ocr/tessdata
python pdf.py -f <file> --ocr --ocr-lang <lang>
🎬 Example usage

https://github.com/tommyjtl/termchat/assets/1622557/40162508-3263-406b-bb7e-27558ae8d618

Acknowledgments

Metadata

Release files for termq 0.1.8

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

Source distribution (sdist)

Source distribution for termq 0.1.8
File Size Uploaded Provenance Actions
termq-0.1.8.tar.gz 14.5 kB Without provenance Details for termq-0.1.8.tar.gz

Built distribution (wheel)

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

Total release size: 30.1 kB

Release files / termq-0.1.8.tar.gz

Download URL termq-0.1.8.tar.gz
Size 14.5 kB
Tags Source
SHA-256 checksum
How to use checksums
7f67347c8e59e36486aa45f05eff58ae4dafd08938c7312219f17ec64fb5beb6
BLAKE2b-256 checksum
How to use checksums
2b5be2b873a5a4d490994f102bea1a7419301ab1356e1e6c27584ea24e05597b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Release files / termq-0.1.8-py3-none-any.whl

Download URL termq-0.1.8-py3-none-any.whl
Size 15.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1bede18185f05847f86f52fa412e7ef714d77fdf0f5448082fe4612ee4b50521
BLAKE2b-256 checksum
How to use checksums
88ae62d8e120ff6d83e7deeb01618602d5f3be1b4b1ebd2eae194a0680a40bbf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.2

Security for termq 0.1.8

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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