https://github.com/d99kris/nspell-gpt
Terminal-based spell checking using ChatGPT
https://github.com/d99kris/nspell-gpt
Last synced: 13 days ago
JSON representation
Terminal-based spell checking using ChatGPT
- Host: GitHub
- URL: https://github.com/d99kris/nspell-gpt
- Owner: d99kris
- License: mit
- Created: 2023-03-04T12:52:03.000Z (almost 3 years ago)
- Default Branch: main
- Last Pushed: 2023-03-25T01:54:32.000Z (almost 3 years ago)
- Last Synced: 2025-01-21T01:41:59.492Z (12 months ago)
- Language: Python
- Size: 284 KB
- Stars: 3
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
nspell-gpt
==========
| **Linux** | **Mac** |
|-----------|---------|
| [](https://github.com/d99kris/nspell-gpt/actions?query=workflow%3ALinux) | [](https://github.com/d99kris/nspell-gpt/actions?query=workflow%3AmacOS) |
The nspell-gpt utility utilizes OpenAI's ChatGPT to provide users with
spell and grammar checking features as well as other text editing
capabilities. Example using the **rephrase** tool:

Usage
=====
Usage:
usage: nspell-gpt [-h] [-a] [-t TOOL] [-v] FILE
Command-line Options:
-h, --help
show this help message and exit
-a, --accept
non-interactive use (accepting first suggestion)
-t TOOL, --tool TOOL
list of tools: spell, rephrase, formal, legal, short, gentle, absurd, pirate, bible,
truly, savannah, singlish, aussie, grand, airplane, idiom, vague
-v, --version
show version
FILE file to check and modify
Installation
============
**Source**
git clone https://github.com/d99kris/nspell-gpt && cd nspell-gpt
**Build**
mkdir -p build && cd build && cmake .. && make -s
**Install**
sudo make install
Supported Platforms
===================
nspell-gpt is implemented using Python 3 and tested on Linux and macOS.
Pre-requisites
==============
An OpenAI API key is needed. Sign up at [OpenAI](https://platform.openai.com/)
and go to [API keys](https://platform.openai.com/account/api-keys) and click
`Create new secret key`.
Create the file `~/.config/nspell-gpt/api.conf` containing
OPENAI_API_KEY=yourkey
Alternatively set the environment variable `OPENAI_API_KEY` to contain your
key.
Customizations
==============
You may create your own tools / prompts for ChatGPT. Create a file at
`~/.config/nspell-gpt/tools.conf` and add lines on the format
`name=ChatGPT prompt`. Example:
film=Rephrase the following sentence in {lang} using at least one famous film quote:
(Keyword `{lang}` will be replaced by the actual source language detected.)
License
=======
nspell-gpt is distributed under the MIT license. See LICENSE file.
Keywords
========
terminal, tui, spell-checker, chatgpt.