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.6-py3-none-win_arm64.whl (2.7 MB view details)

Uploaded Python 3Windows ARM64

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

Uploaded Python 3Windows x86-64

mint_ai-0.0.6-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.6-py3-none-musllinux_1_2_aarch64.whl (2.7 MB view details)

Uploaded Python 3musllinux: musl 1.2+ ARM64

mint_ai-0.0.6-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.6-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.6-py3-none-macosx_11_0_arm64.whl (2.8 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

mint_ai-0.0.6-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.6-py3-none-win_arm64.whl.

File metadata

  • Download URL: mint_ai-0.0.6-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.6-py3-none-win_arm64.whl
Algorithm Hash digest
SHA256 a24f09720816b4d6fca8d0c9a84c2d9810244dffc77d3b0b9a55a50e521f70aa
MD5 48ab848c15f62fffa30ae0b089e6a83e
BLAKE2b-256 16964efc83fb69c0a89080e0b7bd5e79cc771b6f3ff95fcc29f35771846e4343

See more details on using hashes here.

Provenance

The following attestation bundles were made for mint_ai-0.0.6-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.6-py3-none-win_amd64.whl.

File metadata

  • Download URL: mint_ai-0.0.6-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.6-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 bef1029cb2b87e5dc90695afd88af9d4119d3d50aef5fc084a15c559ee561c21
MD5 cca8b06e9eed764db1a9a7ea27f189a0
BLAKE2b-256 e3d4f1fcc9b20b173e23d98973aab6419012dd4a4f931c3516ec39c1ba77e3fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for mint_ai-0.0.6-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.6-py3-none-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for mint_ai-0.0.6-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 9e8a65b84718ccd9ae780cd477804e7a3a0e08d4454bb34254c1208e4c4b720e
MD5 83651044477b2342038eea881d4f7819
BLAKE2b-256 2d4e253d22aece2c008ac6436df889e951a65f93f5bc8d7a6a90ba512bbbf690

See more details on using hashes here.

Provenance

The following attestation bundles were made for mint_ai-0.0.6-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.6-py3-none-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for mint_ai-0.0.6-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 525bc2799e1b96ecb202ef8211b56dfc253d56587b780e128ef48d210970f8f3
MD5 cfdf270fe187ec968176fa5bb242de6a
BLAKE2b-256 67fc47cb5f082df3038b6eada933bdde262ae39c496d14e1a3c318480146db7d

See more details on using hashes here.

Provenance

The following attestation bundles were made for mint_ai-0.0.6-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.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mint_ai-0.0.6-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 189f144bacfc31b968ad49f3bbd13d915179552428d4e14a04f1e66dfbf30f1f
MD5 213dd3fa1a21869a05512ac76d6fe7f9
BLAKE2b-256 78596982c190118b55123278d1974176de8df1bea7a702ba0e3bee10c7b55740

See more details on using hashes here.

Provenance

The following attestation bundles were made for mint_ai-0.0.6-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.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mint_ai-0.0.6-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 ec1a0d9899014999d5b3f8ef4b80b16dbc15c71fb8b5770b75fbb35c338e90a6
MD5 a9209091b2d82d07c8ee92ed9d082ba9
BLAKE2b-256 da3d3e6d36c264142ee1897e0272f0396e2a9e93620b972e0d5db5257cce3671

See more details on using hashes here.

Provenance

The following attestation bundles were made for mint_ai-0.0.6-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.6-py3-none-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mint_ai-0.0.6-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 241c3f13f38a33589fd0e70254a3107689672e94fd15fc7415772fbc47c67ad9
MD5 b0ca6a560f880c8ed7988ce9f925439b
BLAKE2b-256 11a52ee65d996d8b140f08dffc58eba52862dd5d3a32a9e8df8614c0e5400908

See more details on using hashes here.

Provenance

The following attestation bundles were made for mint_ai-0.0.6-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.6-py3-none-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for mint_ai-0.0.6-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 bfaa49e800c568b2a4141227f79da964d1ed223dece798e01924cb5e01db1d67
MD5 61212d223a891898c4ea2f390b5639d4
BLAKE2b-256 22888c84a802c394fe943e07d6d3d187011d93012f2a93c8b845aaade5eef05c

See more details on using hashes here.

Provenance

The following attestation bundles were made for mint_ai-0.0.6-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