@znmin/claude-remote-cli 0.2.4 → 0.2.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # claude-remote-cli
2
2
 
3
- 在项目目录运行 `claude`,让 Claude Code 主进程运行在 SSH 服务器,文件、终端和浏览器操作在本机执行;也保留服务器执行和目录双向同步模式。
3
+ 在项目目录运行 `claude`,让 Claude Code 主进程运行在 SSH 服务器,文件、终端和交互式浏览器操作在本机执行,普通公开资料搜索与网页读取使用服务器原生工具;也保留服务器执行和目录双向同步模式。
4
4
 
5
5
  本项目是独立的 SSH/同步封装,不是 Anthropic 官方客户端。它不提供服务器、Claude 账号或 API 服务。
6
6
 
@@ -25,10 +25,10 @@ npm install -g git+https://github.com/znmin/claude-remote-cli.git
25
25
  也可以从已下载的分发包安装:
26
26
 
27
27
  ```bash
28
- npm install -g ./znmin-claude-remote-cli-0.2.4.tgz
28
+ npm install -g ./znmin-claude-remote-cli-0.2.5.tgz
29
29
  ```
30
30
 
31
- 若系统 npm 全局目录不可写,可使用 `npm install -g --prefix "$HOME/.local" ./znmin-claude-remote-cli-0.2.4.tgz`,并确保 `~/.local/bin` 在 PATH 中;卸载时也使用相同的 `--prefix`。
31
+ 若系统 npm 全局目录不可写,可使用 `npm install -g --prefix "$HOME/.local" ./znmin-claude-remote-cli-0.2.5.tgz`,并确保 `~/.local/bin` 在 PATH 中;卸载时也使用相同的 `--prefix`。
32
32
 
33
33
  npm 中不带作用域的 `claude-remote-cli` 属于其他项目。本项目使用独立的 `@znmin/claude-remote-cli` 作用域包名;请安装完整包名,或使用上述 GitHub 地址及本项目分发的 `.tgz` 文件。
34
34
 
@@ -129,6 +129,8 @@ Git、npm、pnpm、Python、Go、Docker、数据库 CLI、`gh` 等共用本地
129
129
 
130
130
  文件工具限定项目内,拒绝路径穿越和指向项目外的符号链接;修改已有文件需要精确旧文本或读取时的 SHA-256。终端具有启动用户的正常系统权限,项目工作目录不是操作系统沙箱。本地模式可使用本机 Git worktree。
131
131
 
132
+ 0.2.5 起,普通公开资料查询优先使用服务器上的 Claude 原生 `WebSearch` / `WebFetch`,不打开本地浏览器;服务器的文件、终端和浏览器执行工具仍不开放。原生搜索/网页读取是否可用取决于服务器 Claude 的账号、服务商和策略;如果不可用或查询失败,会先说明并征求用户意见,再回退本地浏览器。本地开发页面、localhost/局域网地址、交互测试、截图和交互登录仍使用本地浏览器,不交给服务器 WebFetch。该选择通过工具白名单及提示词约定实现,不是对模型每次路由选择的硬性拦截。
133
+
132
134
  浏览器使用独立窗口和临时上下文,不读取日常 Chrome 的登录态。启动本地模式时准备相应浏览器版本,后续使用缓存;收到浏览器工具调用时才打开窗口。可以打开本机 localhost,填写表单、点击、截图和读取控制台错误。
133
135
 
134
136
  ```bash
@@ -142,7 +144,7 @@ Linux 上仍需安装 Playwright 所需的系统共享库,有窗口模式还
142
144
 
143
145
  本地模式要求服务器允许 SSH TCP 转发,Claude Code 版本至少 **2.1.248**;已有版本过旧时会提示在服务器运行 `claude update`。每个会话创建仅监听本机回环地址的工具服务、随机令牌和 SSH 反向隧道;令牌通过 SSH 标准输入写入服务器 0600 临时配置,不出现在命令行参数或同步项目中。退出时清理配置、连接和浏览器。
144
146
 
145
- 启动时使用 `--restricted`、`--tools ""`、`--strict-mcp-config`,限定工具和设置来源、关闭普通 hooks。0.2.2 起恢复 `/config`、`/model`、`/help` 等内置交互命令,不再使用禁用整个命令菜单的 `--disable-slash-commands`;通过 `disableSkillShellExecution` 和 `disableBundledSkills` 单独关闭技能内联 shell 和内置技能工作流。恢复菜单不代表所有依赖服务器项目目录或原生工具的命令都适用于本地模式。设置面板修改的是服务器上的 Claude 配置;受限模式仍只加载托管配置和本次 `--settings`,不会恢复读取普通用户/项目 settings.json,因此偏好设置的跨会话持久化仍受该限制影响,可用 `claude --model sonnet` 明确指定启动模型。保留服务器上的订阅认证,不使用跳过 OAuth 的 `--bare`。本地连接失效时不会退回服务器工具。支持 `--continue`、`--resume`、`--model`、`--effort`、`-p` 和输入/输出格式;暂不接受替换工具配置、加载插件、切换云会话等参数。
147
+ 启动时使用 `--restricted`、`--tools "WebSearch,WebFetch"`、`--strict-mcp-config`,限定工具和设置来源、关闭普通 hooks。0.2.2 起恢复 `/config`、`/model`、`/help` 等内置交互命令,不再使用禁用整个命令菜单的 `--disable-slash-commands`;通过 `disableSkillShellExecution` 和 `disableBundledSkills` 单独关闭技能内联 shell 和内置技能工作流。恢复菜单不代表所有依赖服务器项目目录或原生工具的命令都适用于本地模式。设置面板修改的是服务器上的 Claude 配置;受限模式仍只加载托管配置和本次 `--settings`,不会恢复读取普通用户/项目 settings.json,因此偏好设置的跨会话持久化仍受该限制影响,可用 `claude --model sonnet` 明确指定启动模型。保留服务器上的订阅认证,不使用跳过 OAuth 的 `--bare`。本地连接失效时不会将文件或命令操作退回服务器执行。支持 `--continue`、`--resume`、`--model`、`--effort`、`-p` 和输入/输出格式;暂不接受替换工具配置、加载插件、切换云会话等参数。
146
148
 
147
149
  这是工具路由约束,不是对 Claude Code 主进程的系统隔离。认证、会话和日志仍在服务器,管理员管理策略继续生效。文件内容、命令结果和截图会经过服务器交给模型,不整体同步不代表数据不离开本机。
148
150
 
@@ -220,7 +222,7 @@ npm test
220
222
  CLAUDE_REMOTE_INTEGRATION=1 CLAUDE_REMOTE_BROWSER_TEST=1 npm test
221
223
 
222
224
  npm pack
223
- npm install -g ./znmin-claude-remote-cli-0.2.4.tgz
225
+ npm install -g ./znmin-claude-remote-cli-0.2.5.tgz
224
226
 
225
227
  # 确定包名、版本和使用条款后,使用有发布权限的 npm 账号发布
226
228
  npm login
@@ -229,6 +231,6 @@ npm publish --access public
229
231
 
230
232
  GitHub 仓库名为 `claude-remote-cli`,npm 包名为 `@znmin/claude-remote-cli`,命令名为 `claude` 和 `claude-remote`。发布账号必须拥有 npm 用户作用域 `@znmin`,或拥有同名 npm 组织的发布权限;GitHub 身份不会自动授予 npm 权限。当前 `license` 为 `UNLICENSED`,尚未指定开源许可证。
231
233
 
232
- 测试覆盖真实 MCP HTTP 调用、本机文件与进程、受控浏览器交互、本地真实同步、模拟 SSH/Claude 的完整启动清理链路,以及官方安装流程的隔离模拟。尚未提供服务器,真实 SSH 认证、Claude 模型端到端调用、Linux 和其他 CPU 架构尚未实测。
234
+ 测试覆盖真实 MCP HTTP 调用、本机文件与进程、受控浏览器交互、本地真实同步、模拟 SSH/Claude 的完整启动清理链路,以及官方安装流程的隔离模拟。真实服务器完整启动、Claude 模型端到端调用、Linux 和其他 CPU 架构尚未完成实测。
233
235
 
234
236
  参考:[npm 命令入口配置](https://docs.npmjs.com/cli/configuring-npm/package-json#bin)、[Mutagen 同步机制](https://mutagen.io/documentation/synchronization/)、[Mutagen SSH 支持](https://mutagen.io/documentation/transports/ssh/)。
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@znmin/claude-remote-cli",
3
- "version": "0.2.4",
3
+ "version": "0.2.5",
4
4
  "description": "Run Claude Code on an SSH server with local filesystem, terminal and browser tools, or remote bidirectional sync",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",
@@ -66,7 +66,7 @@ export async function startLocalServer({ root, env = process.env, headless = fal
66
66
  register('list_processes', 'List processes owned by this tool session, not all system processes.', {}, () => processes.list(), true);
67
67
  register('stop_process', 'Stop a process group started by this tool session, including a development server.', { job_id: z.string() },
68
68
  args => processes.stop(args.job_id));
69
- register('browser_open', 'Open a page in a dedicated LOCAL browser. localhost is the developer computer. Does not attach to existing browser profiles.', {
69
+ register('browser_open', 'Open a page in a dedicated LOCAL browser for local development, interactive UI testing, screenshots or interactive sign-in. For ordinary public research use server WebSearch/WebFetch; ask the user before falling back to this browser. localhost is the developer computer. Does not attach to existing browser profiles.', {
70
70
  url: z.string().url().or(z.literal('about:blank')).default('about:blank')
71
71
  }, args => browser.open(args.url));
72
72
  register('browser_snapshot', 'Inspect a LOCAL browser page and get visible text and selectors for interactive elements.', { page_id: pageId },
package/src/local-mode.js CHANGED
@@ -38,7 +38,7 @@ export function validateLocalArguments(args) {
38
38
 
39
39
  export function localClaudeArguments(configFile, root, extra) {
40
40
  validateLocalArguments(extra);
41
- return ['--restricted', '--tools', '', '--strict-mcp-config', '--mcp-config', configFile,
41
+ return ['--restricted', '--tools', 'WebSearch,WebFetch', '--strict-mcp-config', '--mcp-config', configFile,
42
42
  // Keep built-in UI commands (/config, /model, /help) available. Disable
43
43
  // skill shell expansion separately instead of disabling the entire menu.
44
44
  '--setting-sources', '', '--settings', JSON.stringify({ disableAllHooks: true,
@@ -46,8 +46,11 @@ export function localClaudeArguments(configFile, root, extra) {
46
46
  '--append-system-prompt', `All project operations run on the developer's LOCAL computer through the local MCP server. ` +
47
47
  `The LOCAL project root is ${JSON.stringify(root)}. The server working directory is only for session metadata, not project files. ` +
48
48
  'Call workspace_info before working. Use only local tools for file access, shell commands and browser operations. ' +
49
+ 'For public information research, use the server-side WebSearch and WebFetch tools first; do not open the local browser for ordinary searches or reading public documentation. ' +
50
+ 'Use the LOCAL browser for local development pages, localhost/loopback or developer LAN addresses, interactive UI testing, screenshots, or pages requiring interactive sign-in. ' +
51
+ 'Never send local development URLs to server-side WebFetch. If WebSearch or WebFetch is unavailable or fails for ordinary public research, report it and ask before using the local browser as a fallback. ' +
49
52
  'Read LOCAL CLAUDE.md with read_file if present. Use background commands for development servers, inspect their logs, and stop owned processes when finished. ' +
50
- 'If the local connection fails, report it and stop tool work; never fall back to server tools.', ...extra];
53
+ 'If the local connection fails, report it and stop local project operations; never fall back to server filesystem, shell or browser tools.', ...extra];
51
54
  }
52
55
 
53
56
  export function supportsLocalMode(output) {