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.1.0.tar.gz (51.1 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.1.0-py3-none-any.whl (11.6 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for airewrite-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5daa48c88ff3e2505796e47c37e7dcc5d05ee89a81d839d1c517ce2dd1947b16
MD5 ec6e91394fadbf761e9402a1063bc28d
BLAKE2b-256 92af52256a0e4ecebdba64db66bc42575cc764fa3d5696e2a43dd522a17d28b6

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: airewrite-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 11.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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d9c6ddd8ddf88b2b5a158ab1c189944a22cd78bab5ee09d2b207ac198d44563
MD5 3cebc1451786177b35f9e44abf545179
BLAKE2b-256 dbc9613b34f250839851a81476943c491acfcdc542643ec414e7e2adad85b59f

See more details on using hashes here.

Provenance

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