Skip to main content

Minimalist AI translation CLI powered by LLMs

Project description

English | 繁體中文

🌿 Mint

Minimalist AI Translation CLI — Simple. Fast. Intuitive.

GitHub Release PyPI npm

Mint is a single-binary, LLM-powered translation CLI. Set two environment variables and translate anything from the command line — files, piped output, or inline text. Built-in language detection, grammar correction, streaming output, and multi-language rotation.

export MINT_PROVIDER=google-genai
export MINT_API_KEY=your_key

mint -t ja "Good morning"         # おはようございます
echo "早安" | mint -t en          # Good morning
cat document.txt | mint -t fr     # translate a whole file

✨ Why Mint?

  • Zero-config — Single binary; API keys via env vars, no config file pollution
  • Multi-provider — Google Gemini, OpenAI, Anthropic, or local Ollama / LM Studio
  • Smart detection — Auto-detects language on every call; language-neutral content (numbers, symbols) passes through unchanged
  • Smart correction — Same-language input? Auto-corrects grammar & spelling instead of translating
  • Streaming — Output streams in real-time, no waiting for long translations
  • Composable — Pipe-friendly stdin/stdout; pairs seamlessly with grep, sed, xargs, and friends

📋 Installation

Homebrew (macOS / Linux)

brew install min0625/tap/mint-ai

pipx

pipx install mint-ai

npm

npm install -g mint-ai

Automated install

macOS / Linux

/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/min0625/mint/main/script/install.sh)"

Auto-detects OS and architecture (Linux/macOS, x86_64/arm64), installs to ~/.local/bin. Override with MINT_INSTALL_DIR or pin a version with MINT_VERSION=v1.0.0.

Windows (PowerShell)

irm https://raw.githubusercontent.com/min0625/mint/main/script/install.ps1 | iex

Auto-detects architecture (x86_64/arm64) and installs to $HOME\.local\bin. Override with $env:MINT_INSTALL_DIR or pin a version with $env:MINT_VERSION = 'v1.0.0'.

go install

go install github.com/min0625/mint/cmd/mint@latest

Requires Go 1.26+. Binary lands in $GOPATH/bin (usually ~/go/bin).

Manual download

Pre-built binaries are available at GitHub Releases

mint --version

🚀 Quick Start

1. Set your provider

# Google Gemini (free tier available — https://aistudio.google.com/apikey)
export MINT_PROVIDER=google-genai
export MINT_API_KEY=your_gemini_api_key

# OpenAI
export MINT_PROVIDER=openai
export MINT_API_KEY=sk-...

# Anthropic
export MINT_PROVIDER=anthropic
export MINT_API_KEY=sk-ant-...

# Ollama (no API key needed)
export MINT_PROVIDER=openai
export MINT_BASE_URL=http://localhost:11434
export MINT_MODEL_NAME=qwen2.5:7b  # use any model loaded in Ollama

# LM Studio (no API key needed)
export MINT_PROVIDER=openai
export MINT_BASE_URL=http://localhost:1234
export MINT_MODEL_NAME=lmstudio-community/Qwen2.5-7B-Instruct-GGUF  # use any model loaded in LM Studio

2. Translate

mint --target ja "Good morning"
mint -t zh-TW "Good morning"

echo "The quick brown fox" | mint -t fr
cat document.txt | mint -t zh-TW

Use --verbose / -v to print diagnostic info (detected language, provider, model) to stderr:

mint -t ja -v "Good morning"
# [mint] provider=google-genai model=gemini-3.1-flash-lite detected=en target=ja
# おはようございます

3. Smart language detection

Translation with auto-detection:

export MINT_TARGET_LANG=en

mint "早安"   # Detects Chinese → Good morning

Grammar & spelling correction — when input language matches the target, Mint corrects instead of translates:

export MINT_TARGET_LANG=en

mint "Good mooorning"          # Detects English → Good morning
mint "She don't know nothing"  # Detects English → She doesn't know anything
mint "i luv coding"            # Detects English → I love coding

Language rotation — translates to the next language in the list, wrapping around:

# Two languages
export MINT_TARGET_LANG=en,zh-TW
mint "Hello"   # en → zh-TW: 你好
mint "你好"    # zh-TW → en: Hello

# Three languages
export MINT_TARGET_LANG=en,zh-TW,ja
mint "Hello"       # en → zh-TW: 你好
mint "你好"        # zh-TW → ja: こんにちは
mint "こんにちは"   # ja → en: Hello

🔑 Environment Variables

Variable Description Default
MINT_PROVIDER google-genai | openai | anthropic — (required)
MINT_API_KEY API key; required when using the default endpoint; optional when MINT_BASE_URL is set (proxy handles auth)
MINT_BASE_URL Custom API base URL (domain only; each provider appends its own path); use with openai to target Ollama (http://localhost:11434), LM Studio (http://localhost:1234), or any other OpenAI-compatible endpoint Provider default
MINT_MODEL_NAME Model to use gemini-3.1-flash-lite / gpt-4o-mini / claude-haiku-4-5
MINT_TARGET_LANG Target language(s), e.g. en or en,zh-TW,ja System locale

🗺 Roadmap

  • Multi-LLM provider support (Google Gemini, OpenAI, Anthropic, local via Ollama / LM Studio)
  • Smart language detection and multi-language rotation via MINT_TARGET_LANG
  • Explicit target language via --target / -t flag
  • Streaming output
  • GoReleaser multi-platform binary release (Linux / macOS / Windows)
  • Batch translation mode
  • Glossary / custom dictionary support
  • Output format options (plain text, JSON, Markdown)
  • Caching for repeated translations

📄 License

Apache License 2.0 — see LICENSE for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

mint_ai-0.0.5-py3-none-win_arm64.whl (2.7 MB view details)

Uploaded Python 3Windows ARM64

mint_ai-0.0.5-py3-none-win_amd64.whl (3.0 MB view details)

Uploaded Python 3Windows x86-64

mint_ai-0.0.5-py3-none-musllinux_1_2_x86_64.whl (3.0 MB view details)

Uploaded Python 3musllinux: musl 1.2+ x86-64

mint_ai-0.0.5-py3-none-musllinux_1_2_aarch64.whl (2.7 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

mint_ai-0.0.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.0 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ x86-64

mint_ai-0.0.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (2.7 MB view details)

Uploaded Python 3manylinux: glibc 2.17+ ARM64

mint_ai-0.0.5-py3-none-macosx_11_0_arm64.whl (2.8 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

mint_ai-0.0.5-py3-none-macosx_10_9_x86_64.whl (3.0 MB view details)

Uploaded Python 3macOS 10.9+ x86-64

File details

Details for the file mint_ai-0.0.5-py3-none-win_arm64.whl.

File metadata

  • Download URL: mint_ai-0.0.5-py3-none-win_arm64.whl
  • Upload date:
  • Size: 2.7 MB
  • Tags: Python 3, Windows ARM64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mint_ai-0.0.5-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 540cf006013d139cfb07a18a43f36ec82e9d96a2a2f8d456145f8f71d36d1ccd
MD5 5fdf2204ba635a46e2bcae21d926a8b9
BLAKE2b-256 fa56c8fead0ff492f311b7ceb87cd825941c6a12b2cf56ee1478c4ebc7ad4ddc

See more details on using hashes here.

Provenance

The following attestation bundles were made for mint_ai-0.0.5-py3-none-win_arm64.whl:

Publisher: publish-pypi.yml on min0625/mint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mint_ai-0.0.5-py3-none-win_amd64.whl.

File metadata

  • Download URL: mint_ai-0.0.5-py3-none-win_amd64.whl
  • Upload date:
  • Size: 3.0 MB
  • Tags: Python 3, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mint_ai-0.0.5-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 55144990d990d69731bd3c7cc1c5dd5daa8c097b336ba10d3b6eb15e5725dc93
MD5 bf52ff9899867c375d619b54c59bb09f
BLAKE2b-256 f824fa2127599212acc48d42f6729bb49b93ea31b971d1686722c321800527d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for mint_ai-0.0.5-py3-none-win_amd64.whl:

Publisher: publish-pypi.yml on min0625/mint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mint_ai-0.0.5-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for mint_ai-0.0.5-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 26364cc561ac9f4e67fd96fe7f97d2100a25d98cf98fcf592b5c326296bfaf63
MD5 99fff0c8b0a52ae4533db777a81efdb6
BLAKE2b-256 4bb2c9e6b7f24d60bcf50ab3b7046ec08389bdd6c3cef0a5291aed09b7c0d308

See more details on using hashes here.

Provenance

The following attestation bundles were made for mint_ai-0.0.5-py3-none-musllinux_1_2_x86_64.whl:

Publisher: publish-pypi.yml on min0625/mint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mint_ai-0.0.5-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for mint_ai-0.0.5-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 afc50c069fd0e465d868c7e6e455edba2a62d03042707f17230840ea2e3b3485
MD5 7615f398cfa76850dcc3ca220e271b48
BLAKE2b-256 c0e2c366adfb1ea795f280db9e46ce4b5edb6ae380c5ecebc8a212c27212ad97

See more details on using hashes here.

Provenance

The following attestation bundles were made for mint_ai-0.0.5-py3-none-musllinux_1_2_aarch64.whl:

Publisher: publish-pypi.yml on min0625/mint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mint_ai-0.0.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mint_ai-0.0.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 d715f9f0f8842c38842af83177e067ede82e8dcabad3304a5af842923150fc83
MD5 899b9dd61ed4dcc71aa6613538be7c53
BLAKE2b-256 a711133a6225e96968aca4faf6a9d49c01b6a27c844e2112665685820c48d32c

See more details on using hashes here.

Provenance

The following attestation bundles were made for mint_ai-0.0.5-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: publish-pypi.yml on min0625/mint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mint_ai-0.0.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mint_ai-0.0.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 256f7f86837751fd6e1a841c5c242df92f60e3db4a1a882f16348317d98ddc95
MD5 5c84a37d010ca1c5d169c370a4cf47c8
BLAKE2b-256 f47f09d5b6584c1fdf2815d18fc4c4c74317704580e6e359960d3ea72e7a9191

See more details on using hashes here.

Provenance

The following attestation bundles were made for mint_ai-0.0.5-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: publish-pypi.yml on min0625/mint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mint_ai-0.0.5-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mint_ai-0.0.5-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fa4a259bf0cee89bd1de3968e4d039657c39c36e85c2eddb9a2e891e8bb6dcb9
MD5 8a124ff7dfbc8ce441a8f08324ca8f5d
BLAKE2b-256 091e5a2d557cbf38bf3de85cbbb44794984878ef645666fd5d9de5312a1302ff

See more details on using hashes here.

Provenance

The following attestation bundles were made for mint_ai-0.0.5-py3-none-macosx_11_0_arm64.whl:

Publisher: publish-pypi.yml on min0625/mint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mint_ai-0.0.5-py3-none-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for mint_ai-0.0.5-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 7f96a54e0ab4bc83204cb2d586d38d898e4fb3e022e9907ece12953f3343e095
MD5 34d335079b807382e9cd0b8148866ddf
BLAKE2b-256 e1897986e9ea71734c2e049520359ef5782324915b99fe67a185168b5a1c24d2

See more details on using hashes here.

Provenance

The following attestation bundles were made for mint_ai-0.0.5-py3-none-macosx_10_9_x86_64.whl:

Publisher: publish-pypi.yml on min0625/mint

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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