Crate tl_cli

Crate tl_cli 

Source
Expand description

§tl - Streaming Translation CLI

tl is a command-line tool for translating text using OpenAI-compatible API endpoints. It supports streaming output, caching, and multiple provider configurations.

§Features

  • Streaming translations: See translations as they arrive
  • Caching: Avoid redundant API calls with SQLite-based caching
  • Multiple providers: Configure and switch between different API providers
  • Interactive mode: Chat-style translation sessions with tl chat

§Quick Start

# Translate a file
tl ./notes.md

# Translate from stdin
cat report.md | tl

# Override target language
tl --to ja ./notes.md

# Interactive chat mode
tl chat

§Configuration

Settings are stored in ~/.config/tl/config.toml:

[tl]
provider = "ollama"
model = "gemma3:12b"
to = "ja"

[providers.ollama]
endpoint = "http://localhost:11434"
models = ["gemma3:12b", "llama3.2"]

Modules§

cache
Translation cache management using SQLite.
chat
Interactive chat mode for translation sessions. Interactive chat mode for translation sessions.
cli
Command-line interface definitions and handlers. Command-line interface definitions and handlers.
config
Configuration file management and provider settings.
fs
File system utilities. File system utilities.
input
Input reading from files and stdin.
paths
XDG-style path utilities for configuration and cache. XDG-style path utilities for configuration and cache directories.
style
Translation style management (presets and custom styles). Translation style management.
translation
Translation client for OpenAI-compatible APIs.
ui
Terminal UI components (spinner, colors).