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:
- Reads text from your system clipboard (or from a direct argument)
- Sends the text to an LLM with a prompt to perform only technical corrections
- 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
| Option | Default | Description |
|---|---|---|
--llm-provider | ollama | The LLM provider to use ('ollama', 'openai', 'gemini'). |
LLM: Ollama
| Option | Default | Description |
|---|---|---|
--llm-ollama-model | gemma3:4b | The Ollama model to use. Default is gemma3:4b. |
--llm-ollama-host | http://localhost:11434 | The Ollama server host. Default is http://localhost:11434. |
LLM: OpenAI-compatible
| Option | Default | Description |
|---|---|---|
--llm-openai-model | gpt-5-mini | The 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
| Option | Default | Description |
|---|---|---|
--llm-gemini-model | gemini-3-flash-preview | The 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
| Option | Default | Description |
|---|---|---|
--log-level | warning | Set logging level. |
--log-file | - | Path to a file to write logs to. |
--quiet, -q | false | Suppress console output from rich. |
--json | false | Output result as JSON (implies --quiet and --no-clipboard). |
--config | - | Path to a TOML configuration file. |
--print-args | false | Print 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
- Select and copy text with errors
- Press your hotkey (e.g., Cmd+Shift+A)
- Paste the corrected text