autocorrect

January 30, 2026 · View on GitHub

Correct grammar and spelling in text using a local or remote LLM.

Usage

agent-cli autocorrect [TEXT]

Description

This is a simple, one-shot command that:

  1. Reads text from your system clipboard (or from a direct argument)
  2. Sends the text to an LLM with a prompt to perform only technical corrections
  3. Copies the corrected text back to your clipboard, replacing the original

This tool is ideal for integrating with a system-wide hotkey.

Examples

# Correct text from clipboard
agent-cli autocorrect

# Correct text from argument
agent-cli autocorrect "this text has an eror"

Options

Provider Selection

OptionDefaultDescription
--llm-providerollamaThe LLM provider to use ('ollama', 'openai', 'gemini').

LLM: Ollama

OptionDefaultDescription
--llm-ollama-modelgemma3:4bThe Ollama model to use. Default is gemma3:4b.
--llm-ollama-hosthttp://localhost:11434The Ollama server host. Default is http://localhost:11434.

LLM: OpenAI-compatible

OptionDefaultDescription
--llm-openai-modelgpt-5-miniThe OpenAI model to use for LLM tasks.
--openai-api-key-Your OpenAI API key. Can also be set with the OPENAI_API_KEY environment variable.
--openai-base-url-Custom base URL for OpenAI-compatible API (e.g., for llama-server: http://localhost:8080/v1).

LLM: Gemini

OptionDefaultDescription
--llm-gemini-modelgemini-3-flash-previewThe Gemini model to use for LLM tasks.
--gemini-api-key-Your Gemini API key. Can also be set with the GEMINI_API_KEY environment variable.

General Options

OptionDefaultDescription
--log-levelwarningSet logging level.
--log-file-Path to a file to write logs to.
--quiet, -qfalseSuppress console output from rich.
--jsonfalseOutput result as JSON (implies --quiet and --no-clipboard).
--config-Path to a TOML configuration file.
--print-argsfalsePrint the command line arguments, including variables taken from the configuration file.

Workflow Integration

System-Wide Hotkey

Set up a hotkey to run autocorrect on your clipboard:

=== "macOS (skhd)"

```
cmd + shift + a : /path/to/agent-cli autocorrect
```

=== "Linux (Hyprland)"

```
bind = SUPER SHIFT, A, exec, agent-cli autocorrect
```

Typical Usage

  1. Select and copy text with errors
  2. Press your hotkey (e.g., Cmd+Shift+A)
  3. Paste the corrected text