airewrite
Terminal-first AI rewrite assistant.
Paste text, get back an improved version, iterate.
Supports:
- OpenAI and Anthropic APIs
- Interactive persistent session (paste multi-line text)
- Multiple “modes” (proofread / rewrite / professional / concise)
- Custom modes via Markdown instruction files
- Optional persistent history (daily JSONL) with retention
Install
This project is set up for uv.
uv run airewrite --help
If you want to install it into a virtualenv as a CLI tool:
uv sync
uv run airewrite --help
Quickstart
- Set an API key:
- OpenAI
export OPENAI_API_KEY="..."
- Anthropic
export ANTHROPIC_API_KEY="..."
- Start the interactive session:
uv run airewrite
Or use the short alias:
uv run rewrite
Usage
Interactive session (persistent)
Start:
uv run airewrite
Then:
- Paste text (multi-line is fine)
- Submit with an empty line (press Enter twice)
By default, responses render with a nicer “pretty” UI using rich.
In-session commands
:mode <name>:provider openai|anthropic:model <model-name>:explain(toggle adding a short explanation after the rewritten text):pretty(toggle rich output on/off):show(print effective configuration):where(print resolved paths):quit
Non-interactive (stdin)
Pipe input:
echo "this are bad." | uv run airewrite run --mode proofread
Or:
cat draft.txt | uv run airewrite run --mode concise
Providers
OpenAI
- Credential:
OPENAI_API_KEY - Default model:
gpt-4o-mini
Example:
uv run airewrite run --provider openai --mode proofread
Anthropic
- Credential:
ANTHROPIC_API_KEY - Default model:
claude-3-5-sonnet-20241022
Example:
uv run airewrite run --provider anthropic --mode professional
Modes
Built-in modes:
proofreadrewriteprofessionalconcise
Select a mode:
uv run airewrite run --mode concise
Custom modes (Markdown)
Create a file:
~/.config/airewrite/modes/<mode>.md
Example:
mkdir -p ~/.config/airewrite/modes
cat > ~/.config/airewrite/modes/friendly.md << 'EOF'
Rewrite the text to sound friendly and approachable.
Keep it clear and professional.
Return only the rewritten text.
EOF
Then run:
uv run airewrite run --mode friendly
History
By default, history is enabled and written as JSONL (one file per day):
~/.config/airewrite/history/YYYY-MM-DD.jsonl
Each line contains:
- timestamp
- mode/provider/model
- explain
- input_text
- output_text
Retention
Default retention is 30 days.
Override:
uv run airewrite run --history-days 7
Disable history:
uv run airewrite run --no-history
Custom history location
Override the history directory:
uv run airewrite run --history-dir ~/somewhere/airewrite-history
Or via env var:
export AIREWRITE_HISTORY_DIR=~/somewhere/airewrite-history
Configuration inspection
Print effective config:
uv run airewrite show-config
Print resolved paths (config/modes/history):
uv run airewrite paths
Print config when starting run:
uv run airewrite run --print-config
Pretty output
Pretty output is enabled by default in interactive mode.
Disable:
uv run airewrite run --no-pretty
You can also toggle it in-session with :pretty.
Metadata
Release files for airewrite 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| airewrite-0.4.0.tar.gz | 57.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| airewrite-0.4.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 71.5 kB
Release files / airewrite-0.4.0.tar.gz
| Download URL | airewrite-0.4.0.tar.gz |
|---|---|
| Size | 57.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
14345dda21f25b60ac4c0e547b5f543f8387fa97c4ed67d5f5fb41b6215d5b71
|
|
BLAKE2b-256 checksum How to use checksums |
f2840ba96494070025a857682272e62cbd5bb2797af206f00825a55f8ed553d7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 18, 2026.
Transparency logRelease files / airewrite-0.4.0-py3-none-any.whl
| Download URL | airewrite-0.4.0-py3-none-any.whl |
|---|---|
| Size | 14.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
9d842fcb347566ce4e1f53f54e43595a0ee9965345e8cd789199d89f5b68de81
|
|
BLAKE2b-256 checksum How to use checksums |
dd7fdfdbb4900a19f527375f443ec69fcfd7393be1b08170029a680785ebabbc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Feb 18, 2026.
Transparency log