{
 "schema_version": 1,
 "generated": "2026-10-20",
 "id": "bilibili-index-translate--translate-text-from-command-line",
 "repo": "bilibili/Index-Translate",
 "repo_url": "https://github.com/bilibili/Index-Translate",
 "repo_slug": "bilibili-index-translate",
 "title": "Translate a text string from the command line",
 "page_title": "How to translate a text string from the command line with Index Translate",
 "summary": "Send a sentence to the free API and get a translation back in one command.",
 "who": "A developer or writer who needs a quick translation while working in a terminal and has no local GPU.",
 "problem": "Setting up a local translation model needs GPUs and model downloads, which is too much for a single short sentence.",
 "outcome": "A translated sentence printed in the terminal, produced by the free hosted model.",
 "steps": [
  "Clone the repo with `git clone https://github.com/bilibili/Index-Translate` and open a terminal in the folder. (inferred, check the README)",
  "Run `python inference/llm/call_api.py \"Hello, world!\" --target zh` to translate a sentence to Chinese.",
  "Replace the sentence and the `--target` value with the text and language you need.",
  "Check the output for the meaning and for any terminology that must stay fixed."
 ],
 "agent_prompt": "Use the repo at https://github.com/bilibili/Index-Translate. Run `python inference/llm/call_api.py \"<text>\" --target <language_code>` and return the translated output. Verify that the output is in the requested language and keeps the meaning of the source text.",
 "agents": [
  "any"
 ],
 "difficulty": "Beginner",
 "time": "15 minutes",
 "basis": "readme",
 "caveat": "The free API is a hosted service, so text you send leaves your machine, which may not suit confidential material.",
 "category": "Content",
 "tags": [
  "Content"
 ],
 "lang": "python",
 "requirements": [
  "Python installed to run inference/llm/call_api.py",
  "Internet access to call the free public API at index-translate.bilibili.com",
  "A local image file (PNG or JPG) or text you want translated"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [],
 "best": false,
 "score": 0.9,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/bilibili-index-translate/translate-text-from-command-line/",
 "md": "https://dedupedai.com/use-cases/bilibili-index-translate/translate-text-from-command-line/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/bilibili-index-translate--translate-text-from-command-line.json",
 "api_version": "v1"
}
