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 that supports both Chinese and English.

  • 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.
  • Supports OpenAI-compatible providers.

Requirements

  • Python: >= 3.9

Installation

Local (recommended for development)

pip install -e .

Regular install

pip install typofix

Quickstart

  1. Configure API key and (optionally) model:
typofix config --api-key YOUR_KEY
# optional:
typofix config --model MODEL_NAME
  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.

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 MODEL_NAME

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.2.tar.gz (7.8 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.2-py3-none-any.whl (7.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: typofix-0.1.2.tar.gz
  • Upload date:
  • Size: 7.8 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.2.tar.gz
Algorithm Hash digest
SHA256 a6a3d64a6ff2d84ba79bd689abe5a77d8e16d72f9bc6433a97947672b9d9d08e
MD5 f46e7892072ce02c0ccd7fd8e756afe7
BLAKE2b-256 7a66f17d8c34aa3711ac3723f8b32fae98074dd95d98f603e6b1914e171e7ecf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: typofix-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e5ee6e9d88cf24691bdef64d79425fe3f9f8aa43bc05fc6b2c3debecfc67ca74
MD5 c071071d43ffee85323e999aa94173c4
BLAKE2b-256 efbd42e19a8ec28be2dcbe02ae6222d2327762ab6b2af90cbae9c979ced6afec

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