{"id":37229680,"url":"https://github.com/d2verb/tl","last_synced_at":"2026-01-18T06:47:13.602Z","repository":{"id":331589614,"uuid":"1131526532","full_name":"d2verb/tl","owner":"d2verb","description":null,"archived":false,"fork":false,"pushed_at":"2026-01-10T16:37:44.000Z","size":148,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-11T02:11:38.362Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/d2verb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":"AGENTS.md","dco":null,"cla":null}},"created_at":"2026-01-10T07:18:49.000Z","updated_at":"2026-01-10T16:37:48.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/d2verb/tl","commit_stats":null,"previous_names":["d2verb/tl"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/d2verb/tl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d2verb%2Ftl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d2verb%2Ftl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d2verb%2Ftl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d2verb%2Ftl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/d2verb","download_url":"https://codeload.github.com/d2verb/tl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/d2verb%2Ftl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28442288,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-15T00:55:22.719Z","status":"online","status_checked_at":"2026-01-15T02:00:08.019Z","response_time":62,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-15T03:34:04.352Z","updated_at":"2026-01-15T03:34:05.095Z","avatar_url":"https://github.com/d2verb.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# tl – streaming, cached translation CLI\n\n[![CI](https://github.com/d2verb/tl/actions/workflows/ci.yml/badge.svg)](https://github.com/d2verb/tl/actions/workflows/ci.yml)\n[![Crates.io](https://img.shields.io/crates/v/tl-cli.svg)](https://crates.io/crates/tl-cli)\n[![docs.rs](https://docs.rs/tl-cli/badge.svg)](https://docs.rs/tl-cli)\n\n`tl` is a small CLI that streams translations through any OpenAI-compatible endpoint (local or remote). Configure multiple providers with their own endpoints, API keys, and models, then switch between them as needed.\n\n## Install\n\n### Using cargo (recommended)\n\n```sh\ncargo install tl-cli\n```\n\n### Using installer scripts\n\n**macOS/Linux:**\n```sh\ncurl --proto '=https' --tlsv1.2 -LsSf https://github.com/d2verb/tl/releases/latest/download/tl-cli-installer.sh | sh\n```\n\n**Windows (PowerShell):**\n```powershell\nirm https://github.com/d2verb/tl/releases/latest/download/tl-cli-installer.ps1 | iex\n```\n\n### From source\n\n```sh\ngit clone https://github.com/d2verb/tl.git\ncd tl\ncargo install --path .\n```\n\n## Getting Started\n\n### 1. Add a provider\n\n```sh\ntl providers add\n```\n\nFollow the prompts to configure your first provider. Example for local Ollama:\n\n```\nProvider name: ollama\nEndpoint URL: http://localhost:11434\nAPI key method: None (no auth required)\nModels: gemma3:12b, llama3.2\n```\n\n### 2. Set defaults\n\n```sh\ntl configure\n```\n\nSelect your default provider, model, and target language.\n\n### 3. Translate\n\n```sh\necho \"Hello, world!\" | tl\n```\n\nYou should see the translation stream in real-time.\n\n## Usage\n\n```sh\ntl ./notes.md                       # translate a file\ncat report.md | tl                   # translate stdin\ntl --to ja ./notes.md                # override target language\ntl --provider openrouter ./notes.md  # use a specific provider\ntl --model gpt-4o ./notes.md         # use a specific model\ntl --style casual ./notes.md         # use a translation style\ntl --no-cache ./notes.md             # bypass cache\ntl -w ./notes.md                     # overwrite file with translation\n```\n\nTranslations are cached (keyed on input, language, model, endpoint, and prompt) so rerunning the same source is fast and cheap.\n\n## Managing Providers\n\n```sh\ntl providers                        # list all providers\ntl providers add                    # add a new provider interactively\ntl providers edit \u003cname\u003e            # edit an existing provider\ntl providers remove \u003cname\u003e          # remove a provider\n```\n\n## Translation Styles\n\nStyles control the tone and manner of translations. Four preset styles are available:\n\n| Style | Description |\n|-------|-------------|\n| `casual` | Casual, conversational tone |\n| `formal` | Formal, business-appropriate |\n| `literal` | Literal, close to source |\n| `natural` | Natural, idiomatic expressions |\n\n```sh\ntl styles                           # list all styles (presets + custom)\ntl styles show \u003cname\u003e               # show style details (description + prompt)\ntl styles add                       # add a custom style interactively\ntl styles edit \u003cname\u003e               # edit a custom style\ntl styles remove \u003cname\u003e             # remove a custom style\n```\n\nUse styles with the `--style` option:\n\n```sh\ntl --style formal ./email.md\ntl --style casual ./chat.txt\n```\n\n## Chat Mode\n\nFor interactive translation sessions:\n\n```sh\ntl chat                              # start with config defaults\ntl chat --to ja                      # override target language\ntl chat --provider openrouter        # use a specific provider\n```\n\nType text and press Enter to translate. Available commands:\n\n| Command | Description |\n|---------|-------------|\n| `/help` | Show available commands |\n| `/config` | Show current configuration |\n| `/set style \u003cname\u003e` | Set translation style (or clear with `/set style`) |\n| `/set to \u003clang\u003e` | Change target language |\n| `/set model \u003cname\u003e` | Change model |\n| `/quit` | Exit chat mode |\n\n## Configuration Reference\n\nSettings are stored in `~/.config/tl/config.toml`:\n\n```toml\n[tl]\nprovider = \"ollama\"\nmodel = \"gemma3:12b\"\nto = \"ja\"\nstyle = \"casual\"                     # optional default style\n\n[providers.ollama]\nendpoint = \"http://localhost:11434\"\nmodels = [\"gemma3:12b\", \"llama3.2\"]\n\n[providers.openrouter]\nendpoint = \"https://openrouter.ai/api\"\napi_key_env = \"OPENROUTER_API_KEY\"\nmodels = [\"anthropic/claude-3.5-sonnet\", \"openai/gpt-4o\"]\n\n[styles.ojisan]\ndescription = \"Middle-aged man texting style\"\nprompt = \"Translate with excessive emoji, overly familiar tone, and random punctuation.\"\n\n[styles.keigo]\ndescription = \"Polite Japanese honorifics\"\nprompt = \"Translate using polite Japanese with appropriate keigo (honorific language).\"\n```\n\n### Provider options\n\n- `endpoint` (required) – OpenAI-compatible API endpoint\n- `api_key_env` (optional) – environment variable name for API key\n- `api_key` (optional) – API key in config (not recommended)\n- `models` (optional) – available models for this provider\n\n### Custom style options\n\n- `description` (required) – short description shown in `tl styles` list\n- `prompt` (required) – instruction appended to the system prompt for the LLM\n\nCLI options always override config file values.\n\n## Troubleshooting\n\n- Run `tl languages` to see supported ISO 639-1 language codes.\n- Pressing `Ctrl+C` while streaming aborts without polluting the cache.\n- Use `--no-cache` to force a fresh API request.\n- API key issues? Ensure the environment variable specified in `api_key_env` is set.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd2verb%2Ftl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fd2verb%2Ftl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fd2verb%2Ftl/lists"}