mint

module
v0.0.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 8, 2026 License: Apache-2.0

README ยถ

English | ็น้ซ”ไธญๆ–‡

๐ŸŒฟ Mint

Minimalist AI Translation CLI โ€” Simple. Fast. Intuitive.

GitHub Release PyPI npm

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


โœจ Why Mint?

  • Minimal โ€” One command, no noise
  • Multi-provider โ€” Google Gemini, OpenAI, Anthropic, or local Ollama
  • Flexible โ€” Any language pair; smart auto-detection optional
  • Composable โ€” Pipe-friendly stdin/stdout, fits any workflow

๐Ÿ“‹ 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

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.21+. Binary lands in $GOPATH/bin (usually ~/go/bin).

Manual download

Pre-built binaries are available at GitHub Releases

Verify installation
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-...

# Local Ollama (no API key needed)
export MINT_PROVIDER=ollama
export MINT_BASE_URL=http://localhost:11434
export MINT_MODEL_NAME=llama2
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
3. Smart language detection
export MINT_TARGET_LANG=en
mint "ๆ—ฉๅฎ‰"             # Detects Chinese โ†’ translates to en
mint "Good mooorning"  # Detects English โ†’ corrects grammar & spelling

# Rotate across multiple targets
export MINT_TARGET_LANG=en,zh-TW,ja
mint "Hello"       # โ†’ zh-TW
mint "ไฝ ๅฅฝ"        # โ†’ ja
mint "ใ“ใ‚“ใซใกใฏ"   # โ†’ en

๐Ÿ”‘ Environment Variables

Variable Description Default
MINT_PROVIDER google-genai | openai | anthropic | ollama โ€” (required)
MINT_API_KEY API key (required for all providers except ollama) โ€”
MINT_BASE_URL Custom endpoint (required for ollama) Provider default
MINT_MODEL_NAME Model to use gemini-3.1-flash-lite / gpt-4o-mini / claude-haiku-4-5 / none
MINT_TARGET_LANG Target language(s), e.g. en or en,zh-TW,ja System locale or en

๐ŸŽฏ Design Principles

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 to stdout, errors to stderr
Environment-friendly API keys via env vars, 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 for details.

Directories ยถ

Path Synopsis
cmd
mint command
internal
provider
Package provider manages LLM provider configuration and initialization.
Package provider manages LLM provider configuration and initialization.
provider/anthropic
Package anthropic provides Anthropic Claude LLM client for text translation.
Package anthropic provides Anthropic Claude LLM client for text translation.
provider/googlegenai
Package googlegenai provides Google Gemini LLM client for text translation.
Package googlegenai provides Google Gemini LLM client for text translation.
provider/ollama
Package ollama provides Ollama local LLM client for text translation.
Package ollama provides Ollama local LLM client for text translation.
provider/openai
Package openai provides OpenAI GPT LLM client for text translation.
Package openai provides OpenAI GPT LLM client for text translation.
translator
Package translator defines the Translator interface for LLM translation backends.
Package translator defines the Translator interface for LLM translation backends.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL