CopyAI-d.it: Copyediting with AI from a CLI
==============================================

AI, such as OpenAI [GPT](https://en.wikipedia.org/wiki/Generative_pre-trained_transformer)
[Large Language Models](https://en.wikipedia.org/wiki/Large_language_model) (LLMs),
are capable of frequent, rapid, and very inexpensive
[copyediting](https://en.wikipedia.org/wiki/Copy_editing).
CopyAI-d is an open-source command line interface (CLI) for using the OpenAI API to
copyedit source text files.

Features
--------

* Supports text in LaTeX, Markdown, and HTML formats.
* Use with text file comparison tools like vimdiff to review and merge AI revisions.
* Customize the exact copy-editing instructions sent to OpenAI.
* Perform simultaneous file comparisons across multiple AI revisions.
* Customize which programs are automatically run on AI revisions.

<div class="action-band" markdown>
[Get Started](start.md){ .md-button .md-button--primary }
</div>

Examples
--------

### Simple Example

```bash
$ echo "Use [this software](http://copyaid.it) to write English well." > doc.md
$ copyaid stomp doc.md
OpenAI request for doc.md
Saving to /tmp/copyaid
$ cat doc.md
Use [this software](http://copyaid.it) to write English well.
```

### Vimdiff Example

Your configuration file `~/.config/copyaid/copyaid.toml` can be customized
for many workflows and many OpenAI prompts. The following examples work
from the default configuration file installed.

If you like to use `vimdiff`, consider

```bash
$ echo "Use [this software](http://copyaid.it) to write English well." > doc.md
$ copyaid it doc.md
OpenAI request for doc.md
Saving to /tmp/copyaid
2 files to edit
```
Vimdiff will be run on the original source and revisions after the OpenAI request.

### Workflow Example

An example workflow of multiple steps:

```bash
$ echo "Use [this software](http://copyaid.it) to write English well." > doc.md
$ copyaid check doc.md
OpenAI request for doc.md
Saving to /tmp/copyaid
Files doc.md and /tmp/copyaid/R1/doc.md differ
$ copyaid diff doc.md 
1c1
< Use [this software](http://copyaid.it) to write English well.
---
> Use [this software](http://copyaid.it) to write English well.
$ copyaid replace doc.md 
$ cat doc.md
Use [this software](http://copyaid.it) to write English well.
```

Related
-------

Inspired and heavily influenced by:

* [manubot-ai-editor](https://github.com/greenelab/manubot-ai-editor/)
* [A publishing infrastructure for AI-assisted academic authoring](https://doi.org/10.1101/2023.01.21.525030)

If you have a CLI tool you would like mentioned here,
contact [Castedo Ellerman](https://castedo.com).