Skip to main content

Terminal-first AI rewrite assistant

Project description

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

  1. Set an API key:
  • OpenAI
export OPENAI_API_KEY="..."
  • Anthropic
export ANTHROPIC_API_KEY="..."
  1. 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:

  • proofread
  • rewrite
  • professional
  • concise

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.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

airewrite-0.3.0.tar.gz (56.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

airewrite-0.3.0-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file airewrite-0.3.0.tar.gz.

File metadata

  • Download URL: airewrite-0.3.0.tar.gz
  • Upload date:
  • Size: 56.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for airewrite-0.3.0.tar.gz
Algorithm Hash digest
SHA256 6dcbdafb263d0a4b70f8a7f945440299d806be7243c8caed681ceaf845d87efa
MD5 adb54ce3a272d1d23a5b19e023f2d182
BLAKE2b-256 ae61175c57682f7b0d79b750306f5c2dc953a3627047b1f2e4fce693ad17144f

See more details on using hashes here.

Provenance

The following attestation bundles were made for airewrite-0.3.0.tar.gz:

Publisher: ci.yaml on timmyb824/airewrite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file airewrite-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: airewrite-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for airewrite-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ff9501114fde074b34abe72f7fc7e3bcad42adf1ac27c47b452bc76bfe25d179
MD5 e273186f5a2951f9b018418ffae5b4da
BLAKE2b-256 e6ae2b2c150cb4e873479af6fc72fed43b48c9a3c1cd8de02e863fe19fcca2d8

See more details on using hashes here.

Provenance

The following attestation bundles were made for airewrite-0.3.0-py3-none-any.whl:

Publisher: ci.yaml on timmyb824/airewrite

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page