Skip to main content

Minimalist AI translation CLI powered by LLMs

Project description

English | 繁體中文

🌿 Mint

Minimalist AI Translation CLI — Simple. Fast. Intuitive.


Mint is a lightweight, LLM-powered translation tool for the command line. Choose your favorite LLM provider (Google Gemini, OpenAI, Anthropic, or local Ollama), and get fluent, natural translations instantly with optional smart language detection.


✨ Why Mint?

Most translation tools are either too bloated or too locked into a specific platform. Mint is built around a single philosophy: do less, do it well.

  • Minimal — One command, no noise
  • Fast — Calls the LLM API directly, no intermediate layers
  • Multi-provider — Choose between Google Gemini, OpenAI, Anthropic, or local Ollama models
  • Flexible — Supports any language pair, freely specify your target language
  • Smart detection — Optionally detect input language and auto-translate to your preference
  • Composable — Pipe-friendly stdin/stdout design, fits naturally into any workflow

📋 Installation

pipx (Python Package Index)

The simplest way to install — Mint is available on PyPI:

pipx install mint-ai

After installation, the command is mint:

mint --version

npm (Node Package Manager)

If you prefer npm:

npm install -g mint-ai

Then use:

mint --version

Automated Install (One-liner)

Downloads the latest binary automatically:

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

Features:

  • Detects your OS and architecture automatically (Linux/macOS, x86_64/arm64)
  • Verifies SHA256 checksums
  • Installs to ~/.local/bin by default (override with MINT_INSTALL_DIR)
  • Shows PATH setup hints if needed
  • Supports pinning a specific version: MINT_VERSION=v1.0.0 bash script/install.sh

go install

If you have Go 1.21+ installed:

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

The binary will be available as mint in your $GOPATH/bin directory (usually ~/go/bin).

Manual Download from GitHub Releases

Download pre-built binaries directly from GitHub Releases:

# Linux x86_64
curl -L https://github.com/min0625/mint/releases/latest/download/mint_Linux_x86_64.tar.gz \
  | tar xz && sudo mv mint /usr/local/bin/

# macOS arm64 (Apple Silicon)
curl -L https://github.com/min0625/mint/releases/latest/download/mint_Darwin_arm64.tar.gz \
  | tar xz && sudo mv mint /usr/local/bin/

# macOS x86_64 (Intel)
curl -L https://github.com/min0625/mint/releases/latest/download/mint_Darwin_x86_64.tar.gz \
  | tar xz && sudo mv mint /usr/local/bin/

# Windows x86_64 (PowerShell)
# Download mint_Windows_x86_64.zip from releases page and extract to a directory in your PATH

Verify Installation

mint --version

🚀 Quick Start

1. Choose your provider

# Google Gemini (free tier available)
export MINT_PROVIDER=google-genai
export MINT_API_KEY=your_gemini_api_key
# Get a free API key at: https://aistudio.google.com/apikey

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

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

# Local Ollama (no API key needed)
export MINT_PROVIDER=ollama
export MINT_BASE_URL=http://localhost:11434
export MINT_MODEL_NAME=llama2

2. Translate with explicit target language

# Specify a target language (BCP-47 tag) using --target or -t flag
mint --target ja "Good morning"
mint -t zh-TW "Good morning"

# Pipe from stdin
echo "The quick brown fox" | mint -t fr

# Translate a file
cat document.txt | mint -t zh-TW

3. Smart language detection (optional)

Set your target language preference using MINT_TARGET_LANG:

# Single target language
export MINT_TARGET_LANG=en
mint "早安"             # Detects Chinese → translates to en
mint "Good mooorning"  # Detects English → grammar & spelling correction

# Multiple target languages (language rotation)
export MINT_TARGET_LANG=en,zh-TW,ja

mint "Hello"         # English input → translates to zh-TW (next in rotation)
mint "你好"          # Chinese input → translates to ja (next in rotation)
mint "こんにちは"     # Japanese input → translates to en (wraps around)

The tool automatically detects the input language and applies the appropriate transformation.


🔑 Environment Variables

Variable Description Required Default
MINT_PROVIDER LLM provider: google-genai, openai, anthropic, ollama Yes
MINT_API_KEY API key for the chosen provider Conditional*
MINT_BASE_URL Custom API endpoint; required for ollama (e.g., for self-hosted or local services) Conditional* Provider default
MINT_MODEL_NAME LLM model name to use Optional Provider default**
MINT_TARGET_LANG Target language(s) - single or comma-separated (e.g. en, en,zh-TW,ja) Optional System locale or en

Conditional: MINT_API_KEY required for google-genai, openai, anthropic; not needed for ollama. MINT_BASE_URL required for ollama. Default models: google-genai: gemini-3.1-flash-lite, openai: gpt-4o-mini, anthropic: claude-haiku-4-5; ollama: none (must specify).

Language Resolution Priority

The tool uses the following priority order to determine the target language(s):

  1. Flag: --target / -t CLI flag (highest priority)
  2. Config: MINT_TARGET_LANG environment variable
  3. System: Operating system locale
  4. Default: en (lowest priority)

🎯 Design Principles

Mint follows the Unix philosophy — do one thing, and do it well.

Principle Description
Zero-dependency install Single binary, works out of the box
Multi-provider Supports major LLM services plus local alternatives
Composability Pairs seamlessly with grep, sed, xargs, and friends
Transparent output Results go to stdout, errors go to stderr
Environment-friendly API keys managed via environment variables, no config file pollution

🗺 Roadmap

  • Multi-LLM provider support (Google Gemini, OpenAI, Anthropic, Ollama)
  • Smart language detection and multi-language rotation via MINT_TARGET_LANG
  • Explicit target language via --target / -t flag
  • 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 file 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.0a11-py3-none-win_amd64.whl (3.0 MB view details)

Uploaded Python 3Windows x86-64

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

Uploaded Python 3musllinux: musl 1.2+ ARM64

mint_ai-0.0.0a11-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.0a11-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.0a11-py3-none-macosx_11_0_arm64.whl (2.7 MB view details)

Uploaded Python 3macOS 11.0+ ARM64

mint_ai-0.0.0a11-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.0a11-py3-none-win_amd64.whl.

File metadata

  • Download URL: mint_ai-0.0.0a11-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.0a11-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 9edc18edf656fb7fc0dc334756410056ad9a41656424bacb3c25f05151332a6c
MD5 a630b9228aa3572da4cc3fd2885f2be0
BLAKE2b-256 db155e7dc3408ac8e35e2ea2a2c4dd0866e65b00078cea22bf7db5b3c3e1eda6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mint_ai-0.0.0a11-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 01d618ef8b6b8a970718941744f75ff34f53066e605a4065115de326313e5279
MD5 f1d61f4d56f6ead0e5ca8bb300ecd09e
BLAKE2b-256 bdf96a5037d2c90222ef40904889459dca1f2feb78e343b84463a95fa6c44e90

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mint_ai-0.0.0a11-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 2e52afa37e2b361b5e8dfec1758119870e8f0754cf829187f7d76afe4a110282
MD5 da6c124b165751cb70fac08da2bfa3da
BLAKE2b-256 9a622649cb53ca62664a413c67c0962550c5e8f2e2183bb9949526572b6a1569

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mint_ai-0.0.0a11-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 901022f7c3d62fd6b84c8a6862e942f0abb2e242e49a8cb6b5a0c35edeecd8ae
MD5 ce7d2a8b594fd4860776169386704f68
BLAKE2b-256 77277a81f1e70d509e0f02e860c7508a57462dd40adb1c51a3f843c8b27396a4

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mint_ai-0.0.0a11-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 f1107bfe9c7ca862fd94776cd17ec9e11c2669cc0a4abc160d9589cd54402c9d
MD5 216af1209a95e698a37202898364a157
BLAKE2b-256 a5d6788612d9b02eceb10d5525e03e0730d663f49a07fd3aba4053942e4f10f3

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mint_ai-0.0.0a11-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d7f63f9ba75f76fc8243d492b245393b2093d1748e7059b7f5222f7a6a33c8c6
MD5 bbcbbf80c446afd166efb834cd069501
BLAKE2b-256 b2e8260d972a105b30313fd4663fc3da5823bbf87e35b2d5ae5ca464f8711c75

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mint_ai-0.0.0a11-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 b3545ef1520a8f08f1bea24ee3d48533a8de8f8a3fc2d2f160984e1710dc872f
MD5 73fdd96d2590ddc238a145167cae3d88
BLAKE2b-256 4c72aa6ace4e8499c3ff95a8112376c9a34cbf0feb370840e893ec2bf6353510

See more details on using hashes here.

Provenance

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