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.4.0.tar.gz (57.0 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.4.0-py3-none-any.whl (14.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for airewrite-0.4.0.tar.gz
Algorithm Hash digest
SHA256 14345dda21f25b60ac4c0e547b5f543f8387fa97c4ed67d5f5fb41b6215d5b71
MD5 a0f01516b6c2e56a039950fb18537102
BLAKE2b-256 f2840ba96494070025a857682272e62cbd5bb2797af206f00825a55f8ed553d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for airewrite-0.4.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.4.0-py3-none-any.whl.

File metadata

  • Download URL: airewrite-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 14.6 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.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9d842fcb347566ce4e1f53f54e43595a0ee9965345e8cd789199d89f5b68de81
MD5 739b4d1e29575f490f72ba6a87a3cc05
BLAKE2b-256 dd7fdfdbb4900a19f527375f443ec69fcfd7393be1b08170029a680785ebabbc

See more details on using hashes here.

Provenance

The following attestation bundles were made for airewrite-0.4.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