woshijing1991-cloud/dsh-english-study ↗★ 0

dsh-english-study

English Study for DeepSeek Harness: watch YouTube, log lookups, build a vocabulary book with SM-2 review, and track immersion time in a dashboard. Local-only, no remote server.

Package
dsh-english-study
Compatibility
Unverified
Version
0.1.0
License
MIT
Last updated
Nov 5, 2026

Install

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:woshijing1991-cloud/dsh-english-study

Configuration

Everything is an environment variable or a plugin config field. Nothing is required for the core features — the defaults work offline.

SettingEnv varDefaultWhat it does
Gateway portES_PORT8788Port the Python gateway listens on. Change it here and in the plugin's gateway config.
Bind addressES_HOST0.0.0.00.0.0.0 also serves your phone on the same Wi-Fi; set 127.0.0.1 to keep it local-only.
Gateway directoryES_GATEWAY_DIRthe plugin's own folderWhere start-gateway*.cmd lives (used by the auto-start).
Upstream URLES_GATEWAY (or plugin config gateway)http://127.0.0.1:8788What the DSH plugin proxies /dsh-english-study/api/* to.
AI endpointES_APIemptyOpenAI-compatible /chat/completions URL. Empty ⇒ local dictionary only.
AI modelES_MODELemptyModel name sent to the endpoint, e.g. deepseek-chat.
AI keyES_KEY (or DEEPSEEK_API_KEY)emptyRead from the environment only; never written to disk.
Python interpreterES_PYTHONpython / python3Used by the .cmd launchers and by the macOS/Linux auto-start — set a full path if python is not on your PATH.
Base pathplugin config basePath/dsh-english-studySame-origin route prefix.
Default tabplugin config defaultTabdashboardWhich panel tab opens first.
YouTube proxyES_PROXYempty (direct)e.g. http://127.0.0.1:7890; direct forces no proxy.
YouTube browse keyYT_INNERTUBE_KEYemptyWeb-client key for the InnerTube calls behind the home/search lists. Empty ⇒ those lists stay empty; subtitles and playback are unaffected.
Learning browser exeES_EDGEstandard Edge pathBrowser used for the click-to-look-up window.
Learning browser profileES_LEARN_PROFILE~/.dsh/english-study-edge-profileSeparate profile so extensions can load.
Extension folderES_LEARN_EXTthis repo's ext/Loaded unpacked into the learning browser.

Enabling AI (optional)

export ES_API=https://api.deepseek.com/chat/completions
export ES_MODEL=deepseek-chat
export ES_KEY=sk-your-own-key          # keep it in your shell profile, never in the repo
python gateway/server.py               # health now reports "ai": true

Windows cmd.exe: use set "ES_API=..." instead of export. PowerShell: $env:ES_API="...". Any OpenAI-compatible /chat/completions endpoint works — it does not have to be DeepSeek.

With AI enabled you additionally get: context-aware explanation (part of speech in this sentence, collocations, CEFR, morphology) and sentence translation. With AI disabled you still get: local dictionary lookup, vocabulary book, SM-2 review, immersion stats, dashboard — and the gateway makes zero outbound requests for those features.

Local dictionary (optional, but recommended)

data/dict.db is not shipped (it is a 26 MB generated artifact). Build it once from ECDICT (MIT):


## 配置一览

全部是环境变量或插件配置字段。**核心功能零配置**,默认值即可离线跑起来。

| 配置项 | 环境变量 | 默认值 | 作用 |
|---|---|---|---|
| 网关端口 | `ES_PORT` | `8788` | Python 网关监听端口。改这里的同时要改插件 `gateway` 配置。 |
| 监听地址 | `ES_HOST` | `0.0.0.0` | `0.0.0.0` 让同一 Wi-Fi 的手机也能访问;只想本机用就设 `127.0.0.1`。 |
| 网关目录 | `ES_GATEWAY_DIR` | 插件自身目录 | `start-gateway*.cmd` 所在目录(自愈拉起用)。 |
| 上游地址 | `ES_GATEWAY`(或插件配置 `gateway`) | `http://127.0.0.1:8788` | 插件把 `/dsh-english-study/api/*` 代理到哪。 |
| AI 端点 | `ES_API` | 空 | OpenAI 兼容的 `/chat/completions` 地址。空 ⇒ 只用本地词典。 |
| AI 模型 | `ES_MODEL` | 空 | 发给端点的模型名,例如 `deepseek-chat`。 |
| AI 密钥 | `ES_KEY`(或 `DEEPSEEK_API_KEY`) | 空 | 只从环境变量读,绝不落盘、绝不进日志。 |
| Python 解释器 | `ES_PYTHON` | `python` | `.cmd` 启动脚本用它;`python` 不在 PATH 上时填完整路径。 |
| 路由前缀 | 插件配置 `basePath` | `/dsh-english-study` | 同源路由前缀。 |
| 默认标签页 | 插件配置 `defaultTab` | `dashboard` | 打开面板先看哪一页。 |
| YouTube 代理 | `ES_PROXY` | 空(直连) | 例如 `http://127.0.0.1:7890`;`direct` 强制直连。 |
| YouTube 浏览 key | `YT_INNERTUBE_KEY` | 空 | 首页/搜索走的 InnerTube 接口需要它。空 ⇒ 这两个列表是空的;字幕与播放不受影响。 |
| 学习浏览器 | `ES_EDGE` | Edge 标准路径 | 划词学习窗口用哪个浏览器。 |
| 学习浏览器用户目录 | `ES_LEARN_PROFILE` | `~/.dsh/english-study-edge-profile` | 独立 profile,才能加载扩展。 |
| 扩展目录 | `ES_LEARN_EXT` | 本仓库的 `ext/` | 以「已解压扩展」方式加载。 |

### 启用 AI(可选)

```bash
export ES_API=https://api.deepseek.com/chat/completions
export ES_MODEL=deepseek-chat
export ES_KEY=sk-你自己的key            # 放 shell profile 里,别提交进仓库
python gateway/server.py               # health 里 "ai": true

Windows cmd.exe 用 set "ES_API=...";PowerShell 用 $env:ES_API="..."。任何 OpenAI 兼容的 /chat/completions 端点都行,不一定是 DeepSeek。

启用后多出:语境化解释(这个词在这一句里的意思、搭配、CEFR、词根词缀)、整句翻译。不启用也照样能:查本地词典、记生词、SM-2 复习、沉浸统计、看板——这些路径一个外部请求都不发。

本地词典(可选,但强烈建议)

data/dict.db 不随仓库发布(26 MB 生成物)。用 ECDICT(MIT)自己构建一次: