Turn your phone into a full-featured camera and portable session terminal for dsh (requires the open-source Android companion app — install the plugin and scan the QR code it shows to download the APK): 1. Live viewfinder over LAN or USB, injectable into the chat or savable to a folder. 2. Callable tools let the dsh model take photos, zoom, and switch lenses on demand mid-conversation, so in fully automated workflows the model can actively "see" the physical world. 3. Full zoom/flash, crop, and annotation. 4. Work (Beta): the phone joins dsh sessions directly — live conversation with Markdown/LaTeX rendering, approval & question cards, slash commands, @ references, session fork/archive, and artifact downloads; multiple phones can collaborate at once. 5. Rich settings.
Install
# from npm (prebuilt)
dsh plugin --profile web add phone-lens
# from a prebuilt release tarball
dsh plugin --profile web add "https://github.com/yxqfg/phone-lens/releases/latest/download/phone-lens.tgz"
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:yxqfg/phone-lens#path:/packages/phone-lens
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
phone-lens 是一个 dsh 双面插件,让手机相机成为 dsh 会话的即时视觉输入:
- host 半边:在 dsh 进程内起接收服务(Node HTTP + WebSocket,默认
0.0.0.0:8791),处理配对、上传、并将图片注入 dsh 会话输入框。 - client 半边:在 dsh Web UI 右下角注册一个悬浮取景小窗(
shell.overlay插槽),实时画面 + 快门 + 配对二维码。
环境要求
- Node.js ≥ 20、pnpm
- 一个 dsh web 配置(
dsh plugin --profile web)
安装
# 1. 构建
cd packages\phone-lens
pnpm install
pnpm build
# 2. 接入 dsh 的 web profile
dsh plugin --profile web add C:\Users\<you>\phone-lens\packages\phone-lens
也可以用仓库根的 scripts\dev-install.ps1 一键完成构建与接入,然后重启 dsh web,
终端会打印配对二维码。
发布到 npm 后,可直接
dsh plugin --profile web add phone-lens。
配置
默认配置见 cordis.patch.yml,可在你的 profile 层覆盖:
| 键 | 默认 | 说明 |
|---|---|---|
server.port |
8791 |
接收服务端口 |
limits.maxUploadBytes |
10485760 |
单张图片上限 |
limits.uploadsPerMinute |
10 |
上传频率限制 |
pairing.codeTtlMs |
900000 |
配对码有效期(15 分钟) |
preview.fps |
10 |
预览帧率 |
inject.notePrefix |
[手机拍照] |
注入消息文本块前缀 |
target.mode |
latest |
目标会话:latest(最近活跃)/ pinned(固定) |
使用
- 手机 App 扫码配对
- 手机端拍照(可选裁剪)→ 图片进入当前 dsh 会话
- 手机端「启动预览」→ 电脑端悬浮小窗实时取景;多设备时手机端「设为主机」抢占预览
详见仓库根 README 与 docs/。
开发
pnpm build # tsdown 构建 lib/index.js(host)与 dev.js
pnpm dev:standalone # 不进入 dsh,独立起接收服务(上传落盘 ~/.dsh/phone-lens/uploads)
node --check lib/client.js # 手写 client 的语法校验
协议与安全设计见 docs/protocol.md、docs/architecture.md。
Links
More in this category
liustack/modlens★ 5072
Vision bridge for text-only models: paste an image, get structured JSON evidence (OCR, layout, semantics).
ysr666/dsh-vision-router★ 1298
Free vision for text-only agents: built-in keyless vision chain plus pixel tools (Q&A, grounding, crop, pixel diff, colors, OCR, SVG trace, cutout, screenshots); paste an image to use it.
Anionex/dsh-vision-toolkit★ 951
Vision for text-only models: paste an image and the model switches to a Vision Toolkit variant for image Q&A, multi-image comparison, long-screenshot OCR, screenshot-to-UI reproduction, element grounding, and pixel diff. No API key by default — images are processed by the author-hosted free service, 100 per machine per day; configurable to your own provider.
SAOS-3624/dsh-see-now★ 753
Lets a text-only agent watch a live screen or camera feed: every frame is scored by how much the picture changed, only the ones that matter are packed into one numbered sheet with an audio envelope, so the model looks at what actually changed instead of a screenshot every few seconds.
SAOS-3624/dsh-video-storyboard★ 594
Turns a video (a local file, or a Bilibili/yt-dlp link) into one addressable storyboard grid — numbered cells with exact timestamps, per-cell transcript and an audio envelope on the same timeline — and video_zoom re-reads any window at higher resolution, so a text-only model can look at the video instead of reading a summary.
kingcharleslzy-ai/dsh-qwen-studio★ 534
Qwen Image 2.1 workspace for DSH: Apple Silicon MLX or your own NVIDIA server, native reference editing, LoRA, ControlNet, inpainting, shared presets, gallery and live agent progress. Includes verified updates and an agent setup guide.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.