tl_cli/
lib.rs

1//! # tl - Streaming Translation CLI
2//!
3//! `tl` is a command-line tool for translating text using OpenAI-compatible API endpoints.
4//! It supports streaming output, caching, and multiple provider configurations.
5//!
6//! ## Features
7//!
8//! - **Streaming translations**: See translations as they arrive
9//! - **Caching**: Avoid redundant API calls with SQLite-based caching
10//! - **Multiple providers**: Configure and switch between different API providers
11//! - **Interactive mode**: Chat-style translation sessions with `tl chat`
12//!
13//! ## Quick Start
14//!
15//! ```bash
16//! # Translate a file
17//! tl ./notes.md
18//!
19//! # Translate from stdin
20//! cat report.md | tl
21//!
22//! # Override target language
23//! tl --to ja ./notes.md
24//!
25//! # Interactive chat mode
26//! tl chat
27//! ```
28//!
29//! ## Configuration
30//!
31//! Settings are stored in `~/.config/tl/config.toml`:
32//!
33//! ```toml
34//! [tl]
35//! provider = "ollama"
36//! model = "gemma3:12b"
37//! to = "ja"
38//!
39//! [providers.ollama]
40//! endpoint = "http://localhost:11434"
41//! models = ["gemma3:12b", "llama3.2"]
42//! ```
43
44/// Translation cache management using `SQLite`.
45pub mod cache;
46
47/// Interactive chat mode for translation sessions.
48pub mod chat;
49
50/// Command-line interface definitions and handlers.
51pub mod cli;
52
53/// Configuration file management and provider settings.
54pub mod config;
55
56/// Input reading from files and stdin.
57pub mod input;
58
59/// Translation client for OpenAI-compatible APIs.
60pub mod translation;
61
62/// Terminal UI components (spinner, colors).
63pub mod ui;