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.0a12-py3-none-win_amd64.whl (3.0 MB view details)

Uploaded Python 3Windows x86-64

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

Uploaded Python 3musllinux: musl 1.2+ ARM64

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

Uploaded Python 3macOS 11.0+ ARM64

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

File metadata

  • Download URL: mint_ai-0.0.0a12-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.0a12-py3-none-win_amd64.whl
Algorithm Hash digest
SHA256 041ee9541770dfac695d2a63e7c9a012cdebaf6f29b09e3cab46ab00453381a1
MD5 2bd3f4c17eda589f7b376136c05cedf9
BLAKE2b-256 58fb28fbcc0e093d644eee0bd7c66f52025a0a1aa162d72fcb814a240641e073

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mint_ai-0.0.0a12-py3-none-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 8321ebc7bbe2b10ca5d8902f91a7623cc6f76b1f3b2db03fde31061161af30f4
MD5 01300d295794c2152fea08b695e9d32a
BLAKE2b-256 1e6387e878afb4033c13b69964bb502007361282370646e537cc44d4da8d65e7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mint_ai-0.0.0a12-py3-none-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 7416cbdb8dc72c9ff079300e1523dfc67695904b6569dea830c65e307f56cb73
MD5 f1a38b2e5ce2976ffd4438e34c080375
BLAKE2b-256 45f156d8131483e33f07c3c269d388aad0d236a84d8e9a39f8dce6a5377d793e

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mint_ai-0.0.0a12-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 1b5fb60ee9ea8ba37aa2a142c9bb8a10e0ebd0d60499a978a0156eba36aa442d
MD5 4f438bf479a27d17c24f90ebe7b714d6
BLAKE2b-256 67750a14e9836c1c55210656619432cc9f7f369588085513c7bec31e07d60623

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mint_ai-0.0.0a12-py3-none-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 e02738bd998b63f70fb7b35068d3bbe0f618faff96ee23c142b35b610c966c9b
MD5 20d9803d4b4ca17b0b3eed68bab8bf78
BLAKE2b-256 b9ae8f5f720aba43bb4f5e8b5af19d1be22d80bfb2857d0ad55ab85d203928c7

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mint_ai-0.0.0a12-py3-none-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ce81455784aa61f93d86d42fa37fa253accb3e4a862e5086591e6a46ebc1b7a5
MD5 e01062ec4a5a8da8a14aeaa4cf8b2f8c
BLAKE2b-256 605e89ebf783e6097443d3d443f65aa1147e4fcb2c8d0a6c5c9f301aae0b8c32

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for mint_ai-0.0.0a12-py3-none-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 25713482e8ff5d6e9222879551ab113e555b7198e5bd24908f0ad1ff3f3dc998
MD5 c06865e76e15e1863c0bcd422b75d263
BLAKE2b-256 3aa79cd8b746483d4de86fc0af3ba602dc4d9181f7cce4a4a2a123607e1e59b8

See more details on using hashes here.

Provenance

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