Skip to content

loki980/rewriteText

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

rewriteText

rewriteText is a lightweight clipboard helper that sends whatever you copy to the Codex CLI, rewrites it with your preferred voice, and drops the polished text back on the clipboard. It is handy for quickly tightening up release notes, status updates, or any other short-form writing without opening an editor.

Prerequisites

  • Codex CLI installed and logged in. Follow the Codex CLI installation instructions for your platform, then run codex whoami to confirm authentication before using this script.
  • Clipboard utilities. wl-paste/wl-copy on Wayland, or xclip on X11.
  • GNU userland. A POSIX shell with standard tools (bash, sed, printf, etc.).

Installation

  1. Clone or download this repository.
  2. Make the script executable: chmod +x rewrite.sh.
  3. (Optional) Add it somewhere on your $PATH or wire it up to a desktop shortcut/launcher.

Usage

  1. Highlight the text you want rewritten and copy it (the script can also fire Ctrl+C for you if one of the auto-copy tools above is available).
  2. Run ./rewrite.sh from a terminal or launcher. The tool sends the clipboard text through codex exec and writes the response to a temporary file.
  3. The rewritten text is placed on your clipboard and a confirmation message (plus notify-send notification when available) lets you know it succeeded.

If the clipboard is empty or required tools are missing, the script exits early with a helpful error.

Launch from a desktop shortcut

If you are on KDE Plasma, open System Settings → Shortcuts → Custom Shortcuts, add a new command, point it at the absolute path of rewrite.sh, and pick a key combo. On GNOME, use Settings → Keyboard → View and Customize Shortcuts → Custom Shortcuts to add the same command and shortcut. Once bound, highlight any paragraph, press your shortcut, and the script grabs the selection, rewrites it in the voice defined in your style file, and places the result back on the clipboard. You will be notified via a system notification when the request is complete.

Customize the writing style

  • The script reads its rewriting guidance from writingStyle.md. Edit that file (Markdown works fine even though Codex only sees the text) to describe the tone, structure, and constraints you want.
  • Prefer to keep your own style file elsewhere? Set WRITING_STYLE_FILE=/path/to/myStyle.md before running ./rewrite.sh and that file will be used instead.
  • Version-control different style files or swap them via launcher scripts if you frequently switch voices (e.g., “status update” vs. “release notes”).

About

Uses Codex CLI to rewrite selected text

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages