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.0.1.tar.gz (50.7 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.0.1-py3-none-any.whl (11.5 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for airewrite-0.0.1.tar.gz
Algorithm Hash digest
SHA256 c6ac35151693ede2aaa3ab0e378469a90ac058d80bc4d777086cb81575d3a901
MD5 097caf6c778a4d5ac7a0f63c0491f82f
BLAKE2b-256 8ab7e3a8b7d86bfd32ca05089fbadf27ac89ba096609e787e116f17fa8aaed8a

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: airewrite-0.0.1-py3-none-any.whl
  • Upload date:
  • Size: 11.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.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b4b21da4d3b9a6361d6d017bd92482272280390fc4d6d20549971cd754cf6460
MD5 e980f8abb539fe7fe251318300e65de4
BLAKE2b-256 f3d128234b0830bfb5788fbc5c8bf965ab35c745a37fae46e8526c194f6d55e8

See more details on using hashes here.

Provenance

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