npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

xtrans

v1.2.1

Published

Minimalist AI-powered terminal translator / 极简 AI 终端翻译工具

Readme

xtrans

极简主义的 AI 终端翻译工具。
支持本地大模型 (Ollama, LM Studio) 与主流在线 API。

中文 | English

Version Downloads/week License

核心亮点

  • 🔒 本地模型支持: 原生支持 OllamaLM Studio。无需联网,保护隐私。
  • 🌍 多服务商: 内置 OpenAI, DeepSeek, Kimi (Moonshot) 以及 Ollama/LM Studio 支持。
  • 🛠 高度可扩展: 轻松添加任何兼容 OpenAI 格式 的 API 服务。
  • 🤖 自动发现: 自动获取服务商的模型列表(例如读取你的 ollama list)。
  • 极简体验: 仅需输入 t <text> 即可快速翻译,或进入交互模式连续使用。

安装

npm install -g xtrans

或者使用 npx 直接运行:

npx xtrans <text>

使用指南

1. 快速翻译

全局安装后,可直接使用 txtrans 进行即时翻译;使用 npx 时请用 xtrans

t hello
# ┌───────────────────────────────────────────────────┐
# │  hello  /həˈləʊ/  int.  n.                        │
# │                                                   │
# │  int.                                             │
# │  • 你好 (用于问候、接电话或引起注意)              │
# │    - Hello, Paul. I haven't seen you for ages.    │
# │                                                   │
# │  n.                                               │
# │  • (Hello) 人名;(法)埃洛                       │
# │                                                   │
# │  Synonyms: hi, greetings                          │
# └───────────────────────────────────────────────────┘

2. 交互模式 (REPL)

不带参数运行即可进入交互式 shell(全局安装可用 txtrans;npx 请用 xtrans)。支持上下键 (↑/↓) 切换历史记录。

t
# Welcome to xtrans v1.2.0
# Provider: ollama | Model: llama3 | Target: zh
# › 

可用模式

在 REPL 内使用 /mode 切换,例如:t /mode cambridge

  • translation: 通用翻译
  • cambridge: 剑桥词典风格(学习者友好)
  • oxford: 牛津词典风格(学术/历史)
  • grammar: 语法检查

3. 管理命令

你可以在交互模式内 (输入 /) 或直接从终端运行这些命令。

| 命令 | 说明 | 示例 | |---------|-------------|---------| | /use | 切换服务商或模型 (交互式) | t /use | | /mode | 切换模式 (translation/cambridge/oxford/grammar) | t /mode oxford | | /target | 设置目标语言 | t /target ja | | /status | 检查服务状态及当前模型 | t /status | | /add | 添加自定义 OpenAI 兼容服务商 | t /add | | /remove | 移除服务商 | t /remove | | /clean | 清理历史记录/缓存 | t /clean |

支持的服务商

xtrans 为主流服务预设了配置模板:

🏠 本地 (隐私优先)

  • Ollama: 默认地址 http://localhost:11434。支持自动检测已安装模型。
  • LM Studio: 默认地址 http://localhost:1234/v1

☁️ 云端 API

  • OpenAI: 标准支持。
  • DeepSeek: 深度求索 API 支持。
  • Kimi (Moonshot): 月之暗面支持。
  • Custom (自定义): 添加任何支持 OpenAI Chat Completion 格式的服务。

配置

首次运行时,xtrans 会引导你设置首选服务商。你可以随时使用 t /use 进行切换。

如需添加自定义服务商(例如本地服务器或其他 API):

t /add

许可证

MIT