Skip to content

dmarulli/process_text_utility

Repository files navigation

Process Text

A macOS right-click menu utility that processes selected text using a local LLM (Ollama). Select text anywhere, describe how you want it transformed, and get the result in your clipboard.

Built for analysts, data engineers, and anyone who frequently copies data from spreadsheets, DB viewers, or websites and needs to reformat it into lists, tuples, SQL queries, etc. Also works for any other simple LLM transformation you want to make without leaving your current context.

Currently set up for Mac + local LLM, but can be easily configured for other OSs and API-based LLMs for more intelligence/speed.

Process Text Demo

Features

  • Appears in right-click menu when text is selected
  • Natural language prompts (e.g., "make this formal", "fix grammar", "translate to Spanish")
  • Runs locally with Ollama - no API keys or costs
  • Results copied to clipboard

Prerequisites

Installation

  1. Install Ollama and pull a model:

    brew install ollama
    brew services start ollama
    ollama pull llama3.2
  2. Clone and install:

    git clone https://github.com/dmarulli/process_text_utility.git
    cd process_text_utility
    ./install.sh
  3. Refresh the Services menu:

    /System/Library/CoreServices/pbs -flush

    Or log out and back in.

Usage

  1. Select text in any application
  2. Right-click → ServicesProcess Text
  3. Enter your instruction (e.g., "summarize this", "make it shorter")
  4. Result is copied to clipboard - just paste

Keyboard Shortcut

You can assign a keyboard shortcut for faster access:

  1. Open System SettingsKeyboardKeyboard Shortcuts
  2. Click Services in the sidebar
  3. Scroll to TextProcess Text
  4. Click "Add Shortcut" and press your desired keys

Suggested shortcuts:

  • ⌃⌥P (Ctrl+Option+P)
  • ⌃⌥T (Ctrl+Option+T)
  • ⇧⌘P (Shift+Cmd+P)

Example Use Cases

Input Prompt Output
hello world, how are you "remove excess whitespace" hello world, how are you
foo
bar
baz
"put in a list" ["foo", "bar", "baz"]
report.csv
Sales Data.xlsx
notes.docx
"postgres query for my_table where filename matches these" SELECT * FROM my_table WHERE filename IN ('report.csv', 'Sales Data.xlsx', 'notes.docx');
their going to the store "fix grammar" they're going to the store
hey can u help me out "make formal" Hello, could you please assist me?
good morning "translate to Spanish" buenos días

Troubleshooting

"Ollama Not Running" error:

brew services start ollama

Service not appearing in menu:

/System/Library/CoreServices/pbs -flush

First-time permissions: macOS may ask for Automator/System Events permissions. Allow these in System Settings → Privacy & Security.

Using a Different Model

Edit ~/Library/Scripts/ProcessText/process_text.sh and change the model name:

"model": "llama3.2",  # Change to gemma2:2b, phi3:mini, etc.

Smaller models (gemma2:2b, phi3:mini) are faster but less accurate.

Uninstall

./uninstall.sh

License

MIT

About

A macOS right-click menu utility that processes selected text using a local LLM (Ollama)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •  

Languages