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.2.0.tar.gz (51.3 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.2.0-py3-none-any.whl (11.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for airewrite-0.2.0.tar.gz
Algorithm Hash digest
SHA256 f0b16b93567f92295ee9703e36ad1872a8c14ce26fe4dabb1186adc1908cb0e1
MD5 e3edfdbe2e3e949ec10461b2a8d6cab9
BLAKE2b-256 f3a8bccdece93fe8fd364316a2f0b5e062f6c6884f4510c642c722a203f58b2e

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: airewrite-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 11.7 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 31eceffd6f1fd04fcb4792076c610be9d27a85d56bbc86396796d2a65fd0a864
MD5 d636fd868b3e66be0d7afc51d8124f31
BLAKE2b-256 e236991bf7bbb8c4747780c37579e9dbcfa0b65d393d13cb18e430e7774393f1

See more details on using hashes here.

Provenance

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