Skip to main content

A cross-platform CLI tool to fix typos using LLM.

Project description

typofix

A cross-platform CLI tool to fix typos and improve text with an LLM.

  • Default behavior: typofix <TEXT> runs typo-fixing (no subcommand needed).
  • Extra modes: --suggest (suggest improvements + reasons), --rewrite (rewrite alternatives).
  • Clipboard: in default fix mode, the final text is copied to clipboard.

Requirements

  • Python: >= 3.9

Installation

Local (recommended for development)

pip install -e .

Regular install (from a source checkout)

pip install .

Quickstart

  1. Configure API key and (optionally) model:
typofix config --api-key YOUR_KEY
# optional:
typofix config --model gpt-4o-mini
  1. Fix a sentence:
typofix "Helo world"

Usage

Default (fix)

Fix grammar/typos with minimal changes.

typofix "这是一段可能由语病的测试"

The output is also copied to clipboard in fix mode.

Suggest improvements (with explanations)

Gives prioritized suggestions and brief reasons. Output is in Chinese if input is Chinese; in English if input is English.

typofix --suggest "This sentence have a problem."

Rewrite

Provides 2–3 rewritten alternatives.

typofix --rewrite "帮我把这句话写得更自然一点"

From stdin (pipes)

echo "Helo world" | typofix

Help

typofix --help shows the default command help. Configuration is available as a command:

typofix config --help

Configuration

Configuration is stored under your home directory (JSON). You can always re-run the config command to update values.

Set / view configuration

typofix config

Set model

typofix config --model gpt-4o-mini

List available models

Lists models available to your API key (and the configured base URL).

typofix config --list

Use an OpenAI-compatible provider (base URL)

This tool supports OpenAI-compatible APIs by configuring --base-url.

Example (DashScope compatible mode):

typofix config --base-url https://dashscope.aliyuncs.com/compatible-mode/v1
# then set provider key + model

typofix config --api-key YOUR_PROVIDER_KEY

typofix config --model qwen-plus

Switch back to OpenAI:

typofix config --base-url https://api.openai.com/v1

Troubleshooting

  • "API key not configured": run typofix config --api-key YOUR_KEY.
  • "No such command '
  • Model list fails: verify --base-url and --api-key are correct for your provider.

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

typofix-0.1.1.tar.gz (7.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

typofix-0.1.1-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

Details for the file typofix-0.1.1.tar.gz.

File metadata

  • Download URL: typofix-0.1.1.tar.gz
  • Upload date:
  • Size: 7.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for typofix-0.1.1.tar.gz
Algorithm Hash digest
SHA256 632b2d36200593afe4182c49e34b0bed4671e112d403e967aab98a73107ccc5e
MD5 852a6a172422d473a2d776f544e2723d
BLAKE2b-256 4590dd4bf8397f68757a3f267bd0fc37b084ffd2d08c87b0faeac3c32816f06c

See more details on using hashes here.

File details

Details for the file typofix-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: typofix-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 7.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.4

File hashes

Hashes for typofix-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 55e6fd01d3843c5a6c96ed9da2e6da224bea7c9f84dde9b568fdd3dc79e84650
MD5 8333140ff568a85743e0f8461ea88cbf
BLAKE2b-256 da9adb6700ebacd45367c6f9a96a21fa2b33585d7c76adaaa7511cc5233ce2e5

See more details on using hashes here.

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