{"_id":"@aliyahzombie/octssh","_rev":"9-faabaee0029a21e76529ac5453a2e62b","name":"@aliyahzombie/octssh","dist-tags":{"latest":"0.1.7"},"versions":{"0.1.0":{"name":"@aliyahzombie/octssh","version":"0.1.0","keywords":["mcp","ssh","deployment","automation","agent","llm"],"license":"UNLICENSED","_id":"@aliyahzombie/octssh@0.1.0","maintainers":[{"name":"aliyahzombie","email":"curaalizm@gmail.com"}],"homepage":"https://github.com/aliyahzombie/OctSSH#readme","bugs":{"url":"https://github.com/aliyahzombie/OctSSH/issues"},"bin":{"octssh":"dist/index.js"},"dist":{"shasum":"32f41734f851c5d76857992c6ed8cd5f9794a800","tarball":"https://registry.npmjs.org/@aliyahzombie/octssh/-/octssh-0.1.0.tgz","fileCount":34,"integrity":"sha512-P1ke61yHR0QdHY2qU3vTDtZHMuT30tkeM/wcw+g+6x5uz0y+bZzZwuvqu7poZ1mQXHddXdIP+cPkYLUngOnLWQ==","signatures":[{"sig":"MEUCIQCYMSYkcB1MFX3nOTTe9DQhE+BtSy0FBtB8zuIwlTglvwIgW/sTkBXFSHAnpGT7lshgOiDZe9JdBZDXCyk6YhzpTkw=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":154420},"main":"dist/index.js","engines":{"node":">=18"},"gitHead":"9e4f95daca2879519397696dab12003fc0b8d8ac","scripts":{"dev":"node dist/index.js","test":"npm run build --silent && node --test test/index.test.js","build":"npm run clean --silent && tsup","clean":"node scripts/clean-dist.cjs","prepack":"npm run build --silent","prepublishOnly":"npm test"},"_npmUser":{"name":"aliyahzombie","email":"curaalizm@gmail.com"},"repository":{"url":"git+https://github.com/aliyahzombie/OctSSH.git","type":"git"},"_npmVersion":"11.6.2","description":"OctSSH - Make LLMs safely control your servers for deployment (MCP)","directories":{},"_nodeVersion":"24.12.0","dependencies":{"zod":"^3.24.1","ssh2":"^1.16.0","fast-glob":"^3.3.2","@modelcontextprotocol/sdk":"^1.25.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","typescript":"^5.5.0","@types/node":"^20.11.30","@types/ssh2":"^1.11.18"},"_npmOperationalInternal":{"tmp":"tmp/octssh_0.1.0_1769677528538_0.9839245839761392","host":"s3://npm-registry-packages-npm-production"}},"0.1.1":{"name":"@aliyahzombie/octssh","version":"0.1.1","keywords":["mcp","ssh","deployment","automation","agent","llm"],"license":"UNLICENSED","_id":"@aliyahzombie/octssh@0.1.1","maintainers":[{"name":"aliyahzombie","email":"curaalizm@gmail.com"}],"homepage":"https://github.com/aliyahzombie/OctSSH#readme","bugs":{"url":"https://github.com/aliyahzombie/OctSSH/issues"},"bin":{"octssh":"dist/index.js"},"dist":{"shasum":"a670ef770002680976bff209266a9a0361a2787b","tarball":"https://registry.npmjs.org/@aliyahzombie/octssh/-/octssh-0.1.1.tgz","fileCount":34,"integrity":"sha512-pkGSQ9FTglvd8s2LCS3joHkDqudlPfc5xM08ko6ZNhvuxlNHxYYnOCRVu8p7Mo0FXrcY7yhEF/BOKq78CRMO0A==","signatures":[{"sig":"MEUCIQCU4YLzOVkN3sKFxwArbj/3tAfvDYMC5Wl8FnBXbiV+3QIgb3d1ZyEe0XzU3d9Mp6t7lAu1AwDNEgWZYlXIEz2aOYM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":157493},"main":"dist/index.js","engines":{"node":">=18"},"gitHead":"cc0fcdff5da6e0454ccfdd2e916536e002086d83","scripts":{"dev":"node dist/index.js","test":"npm run build --silent && node --test test/index.test.js","build":"npm run clean --silent && tsup","clean":"node scripts/clean-dist.cjs","prepack":"npm run build --silent","prepublishOnly":"npm test"},"_npmUser":{"name":"aliyahzombie","email":"curaalizm@gmail.com"},"repository":{"url":"git+https://github.com/aliyahzombie/OctSSH.git","type":"git"},"_npmVersion":"11.6.2","description":"OctSSH - Make LLMs safely control your servers for deployment (MCP)","directories":{},"_nodeVersion":"24.12.0","dependencies":{"zod":"^3.24.1","ssh2":"^1.16.0","fast-glob":"^3.3.2","@modelcontextprotocol/sdk":"^1.25.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","typescript":"^5.5.0","@types/node":"^20.11.30","@types/ssh2":"^1.11.18"},"_npmOperationalInternal":{"tmp":"tmp/octssh_0.1.1_1769740614056_0.2865335057719929","host":"s3://npm-registry-packages-npm-production"}},"0.1.2":{"name":"@aliyahzombie/octssh","version":"0.1.2","keywords":["mcp","ssh","deployment","automation","agent","llm"],"license":"UNLICENSED","_id":"@aliyahzombie/octssh@0.1.2","maintainers":[{"name":"aliyahzombie","email":"curaalizm@gmail.com"}],"homepage":"https://github.com/aliyahzombie/OctSSH#readme","bugs":{"url":"https://github.com/aliyahzombie/OctSSH/issues"},"bin":{"octssh":"dist/index.js"},"dist":{"shasum":"8cd80719247002156107166492040fa43a4f3576","tarball":"https://registry.npmjs.org/@aliyahzombie/octssh/-/octssh-0.1.2.tgz","fileCount":39,"integrity":"sha512-r/Nu88FeuW6J92gLWNF9hzYRR/91UGUogO4SQ8g6Is7T9lqm4Bs5W/zM6upIc8TZLc0iCkQX+F5I1KR/itgCAg==","signatures":[{"sig":"MEUCIHPoTupUvkFt5YJy8YzM8OYyzRN950lAdT7/nWR7ErW2AiEA3dKkU4wy5GxSng2v3tyFI90nYD2dOK+VMfHd5duGYWE=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":196812},"main":"dist/index.js","engines":{"node":">=18"},"gitHead":"7e779536759ec475ba953804f12c48431d749588","scripts":{"dev":"node dist/index.js","test":"npm run build --silent && node --test test/index.test.js","build":"npm run clean --silent && tsup","clean":"node scripts/clean-dist.cjs","prepack":"npm run build --silent","prepublishOnly":"npm test"},"_npmUser":{"name":"aliyahzombie","email":"curaalizm@gmail.com"},"repository":{"url":"git+https://github.com/aliyahzombie/OctSSH.git","type":"git"},"_npmVersion":"11.6.2","description":"OctSSH - Make LLMs safely control your servers for deployment (MCP)","directories":{},"_nodeVersion":"24.12.0","dependencies":{"zod":"^3.24.1","ssh2":"^1.16.0","fast-glob":"^3.3.2","@modelcontextprotocol/sdk":"^1.25.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","typescript":"^5.5.0","@types/node":"^20.11.30","@types/ssh2":"^1.11.18"},"_npmOperationalInternal":{"tmp":"tmp/octssh_0.1.2_1770480643840_0.9036234407164117","host":"s3://npm-registry-packages-npm-production"}},"0.1.3":{"name":"@aliyahzombie/octssh","version":"0.1.3","keywords":["mcp","ssh","deployment","automation","agent","llm"],"license":"UNLICENSED","_id":"@aliyahzombie/octssh@0.1.3","maintainers":[{"name":"aliyahzombie","email":"curaalizm@gmail.com"}],"homepage":"https://github.com/aliyahzombie/OctSSH#readme","bugs":{"url":"https://github.com/aliyahzombie/OctSSH/issues"},"bin":{"octssh":"dist/index.js"},"dist":{"shasum":"db933f1b9442a5389836bf98887491410dba04ca","tarball":"https://registry.npmjs.org/@aliyahzombie/octssh/-/octssh-0.1.3.tgz","fileCount":39,"integrity":"sha512-0PaeVmMwTIyWk4r13GPZl0eT7t+ShpPhTL4UI30CfjqhLHqQKLJ+7mKqnhbS7ggNfPdUMRMlckrhaznS/XdTzQ==","signatures":[{"sig":"MEUCIQDkEKiNi9Do5Ibh3yOUuiyp0fi1CFezshH+Tc+nBpqZCQIgREJUwzReMILvIdVdpqOAY6SNPPD9TtmXpEW90fgxe7U=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":198502},"main":"dist/index.js","engines":{"node":">=18"},"gitHead":"d515f7888958db775a806ea548fcb95332a536d9","scripts":{"dev":"node dist/index.js","test":"npm run build --silent && node --test test/index.test.js","build":"npm run clean --silent && tsup","clean":"node scripts/clean-dist.cjs","prepack":"npm run build --silent","prepublishOnly":"npm test"},"_npmUser":{"name":"aliyahzombie","email":"curaalizm@gmail.com"},"repository":{"url":"git+https://github.com/aliyahzombie/OctSSH.git","type":"git"},"_npmVersion":"11.6.2","description":"OctSSH - Make LLMs safely control your servers for deployment (MCP)","directories":{},"_nodeVersion":"24.12.0","dependencies":{"zod":"^3.24.1","ssh2":"^1.16.0","fast-glob":"^3.3.2","@modelcontextprotocol/sdk":"^1.25.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","typescript":"^5.5.0","@types/node":"^20.11.30","@types/ssh2":"^1.11.18"},"_npmOperationalInternal":{"tmp":"tmp/octssh_0.1.3_1772442024677_0.31403666881049275","host":"s3://npm-registry-packages-npm-production"}},"0.1.4":{"name":"@aliyahzombie/octssh","version":"0.1.4","keywords":["mcp","ssh","deployment","automation","agent","llm"],"license":"UNLICENSED","_id":"@aliyahzombie/octssh@0.1.4","maintainers":[{"name":"aliyahzombie","email":"curaalizm@gmail.com"}],"homepage":"https://github.com/aliyahzombie/OctSSH#readme","bugs":{"url":"https://github.com/aliyahzombie/OctSSH/issues"},"bin":{"octssh":"dist/index.js"},"dist":{"shasum":"ab71b1cdd7288f43991ddeb787ba27a194dc39f9","tarball":"https://registry.npmjs.org/@aliyahzombie/octssh/-/octssh-0.1.4.tgz","fileCount":39,"integrity":"sha512-xtzmi4vl1vDLIfj0vISfVRT2JfrMxvwkQ8XnBJpkoKatr/Clu1MWC15NZFLtF1+aac5TC93HF25LJAoipKTuew==","signatures":[{"sig":"MEUCIHWV33IJO1jgsA9UTCc0+8yhwGFcunfVzlubUudeS1TQAiEAiqtfkZVLRv4Pxs8ACvGgGZALlLuMCdnaaMeDcrt5wTM=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":199438},"main":"dist/index.js","engines":{"node":">=18"},"gitHead":"46816831f6b604d2a99f53bc1f49d494dc438c06","scripts":{"dev":"node dist/index.js","test":"npm run build --silent && node --test test/index.test.js","build":"npm run clean --silent && tsup","clean":"node scripts/clean-dist.cjs","prepack":"npm run build --silent","prepublishOnly":"npm test"},"_npmUser":{"name":"aliyahzombie","email":"curaalizm@gmail.com"},"repository":{"url":"git+https://github.com/aliyahzombie/OctSSH.git","type":"git"},"_npmVersion":"11.6.2","description":"OctSSH - Make LLMs safely control your servers for deployment (MCP)","directories":{},"_nodeVersion":"24.12.0","dependencies":{"zod":"^3.24.1","ssh2":"^1.16.0","fast-glob":"^3.3.2","@modelcontextprotocol/sdk":"^1.25.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","typescript":"^5.5.0","@types/node":"^20.11.30","@types/ssh2":"^1.11.18"},"_npmOperationalInternal":{"tmp":"tmp/octssh_0.1.4_1772458782930_0.6197873101424589","host":"s3://npm-registry-packages-npm-production"}},"0.1.5":{"name":"@aliyahzombie/octssh","version":"0.1.5","keywords":["mcp","ssh","deployment","automation","agent","llm"],"license":"UNLICENSED","_id":"@aliyahzombie/octssh@0.1.5","maintainers":[{"name":"aliyahzombie","email":"curaalizm@gmail.com"}],"homepage":"https://github.com/aliyahzombie/OctSSH#readme","bugs":{"url":"https://github.com/aliyahzombie/OctSSH/issues"},"bin":{"octssh":"dist/index.js"},"dist":{"shasum":"bdae060d1468e2f38716dfe6aa876926f754d549","tarball":"https://registry.npmjs.org/@aliyahzombie/octssh/-/octssh-0.1.5.tgz","fileCount":39,"integrity":"sha512-1AwXTi+cqJERiaegidwAt4ysOxu7BHND3Lj8bkUBd91lusyquEYoTvWjzYeRITJ2HDrp2NQwRl8FhTfcuA6SMw==","signatures":[{"sig":"MEQCIBCQ0qTQ54a8y6cw3vLFgjqhJf5+20qbqxXOg6qIvF7vAiAlOwUIV6X98lNfl0NfMFWycdpACWuT5st4e59OJFp3dA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":210774},"main":"dist/index.js","engines":{"node":">=18"},"gitHead":"94dff1f9cb735d6fabf6c6e027b585e0a89e1bfc","scripts":{"dev":"node dist/index.js","test":"npm run build --silent && node --test test/index.test.js","build":"npm run clean --silent && tsup","clean":"node scripts/clean-dist.cjs","prepack":"npm run build --silent","prepublishOnly":"npm test"},"_npmUser":{"name":"aliyahzombie","email":"curaalizm@gmail.com"},"repository":{"url":"git+https://github.com/aliyahzombie/OctSSH.git","type":"git"},"_npmVersion":"11.6.2","description":"OctSSH - Make LLMs safely control your servers for deployment (MCP)","directories":{},"_nodeVersion":"24.12.0","dependencies":{"zod":"^3.24.1","ssh2":"^1.16.0","fast-glob":"^3.3.2","@modelcontextprotocol/sdk":"^1.25.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","typescript":"^5.5.0","@types/node":"^20.11.30","@types/ssh2":"^1.11.18"},"_npmOperationalInternal":{"tmp":"tmp/octssh_0.1.5_1773543391760_0.1306188882120729","host":"s3://npm-registry-packages-npm-production"}},"0.1.6":{"name":"@aliyahzombie/octssh","version":"0.1.6","keywords":["mcp","ssh","deployment","automation","agent","llm"],"license":"UNLICENSED","_id":"@aliyahzombie/octssh@0.1.6","maintainers":[{"name":"aliyahzombie","email":"curaalizm@gmail.com"}],"homepage":"https://github.com/aliyahzombie/OctSSH#readme","bugs":{"url":"https://github.com/aliyahzombie/OctSSH/issues"},"bin":{"octssh":"dist/index.js"},"dist":{"shasum":"0bb76fd1a8ca02750b45e81a80b6dd3cf4e85188","tarball":"https://registry.npmjs.org/@aliyahzombie/octssh/-/octssh-0.1.6.tgz","fileCount":39,"integrity":"sha512-ODJhlApFU6e4dwfICA5EeKh68l8AUbn9O+m1bXEYTJPyATgmv9+F/0utOWoHfw9/j/0Oy19BzQ9FpQt3TfHOBA==","signatures":[{"sig":"MEUCIQCK81WaV/w6BMs2QRwK2O+7qWOE+TPitc8hBmj10wqaqAIgRLCIHeAAcYEOIkv0kTMK/wezBKoAOoys0z2zSUonETQ=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":215562},"main":"dist/index.js","engines":{"node":">=18"},"gitHead":"e809f8777e777a24fe09c31e8f694ff30565c5df","scripts":{"dev":"node dist/index.js","test":"npm run build --silent && node --test test/index.test.js","build":"npm run clean --silent && tsup","clean":"node scripts/clean-dist.cjs","prepack":"npm run build --silent","prepublishOnly":"npm test"},"_npmUser":{"name":"aliyahzombie","email":"curaalizm@gmail.com"},"repository":{"url":"git+https://github.com/aliyahzombie/OctSSH.git","type":"git"},"_npmVersion":"11.6.2","description":"OctSSH - Make LLMs safely control your servers for deployment (MCP)","directories":{},"_nodeVersion":"24.12.0","dependencies":{"zod":"^3.24.1","ssh2":"^1.16.0","fast-glob":"^3.3.2","@modelcontextprotocol/sdk":"^1.25.3"},"publishConfig":{"access":"public"},"_hasShrinkwrap":false,"devDependencies":{"tsup":"^8.0.0","typescript":"^5.5.0","@types/node":"^20.11.30","@types/ssh2":"^1.11.18"},"_npmOperationalInternal":{"tmp":"tmp/octssh_0.1.6_1773544074958_0.7714595107820608","host":"s3://npm-registry-packages-npm-production"}},"0.1.7":{"name":"@aliyahzombie/octssh","version":"0.1.7","description":"OctSSH - Make LLMs safely control your servers for deployment (MCP)","license":"UNLICENSED","repository":{"type":"git","url":"git+https://github.com/aliyahzombie/OctSSH.git"},"homepage":"https://github.com/aliyahzombie/OctSSH#readme","bugs":{"url":"https://github.com/aliyahzombie/OctSSH/issues"},"publishConfig":{"access":"public"},"keywords":["mcp","ssh","deployment","automation","agent","llm"],"engines":{"node":">=18"},"bin":{"octssh":"dist/index.js"},"main":"dist/index.js","dependencies":{"@modelcontextprotocol/sdk":"^1.25.3","fast-glob":"^3.3.2","ssh2":"^1.16.0","zod":"^3.24.1"},"scripts":{"clean":"node scripts/clean-dist.cjs","build":"npm run clean --silent && tsup","test":"npm run build --silent && node --test test/index.test.js","dev":"node dist/index.js","prepack":"npm run build --silent","prepublishOnly":"npm test"},"devDependencies":{"@types/node":"^20.11.30","@types/ssh2":"^1.11.18","tsup":"^8.0.0","typescript":"^5.5.0"},"gitHead":"2a2f2552ad2aab16f4adfabf3ed2a74aecc78e70","_id":"@aliyahzombie/octssh@0.1.7","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-jM3x8bjeDY+knzkOXyxItMe8mZA4vV3OVRZvoGdjb47PwR80wALOlX3scWvkkxr42b6G+MkcaguqIy6cpNaLJg==","shasum":"1f125c8ece67afa968cd530b09162e80c3f8d1e7","tarball":"https://registry.npmjs.org/@aliyahzombie/octssh/-/octssh-0.1.7.tgz","fileCount":42,"unpackedSize":227574,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCIQCnMpYGAPFTYsHUw1KGu8LmEO7/JIH3xw1gWoUKze7TrQIgZ0LaUwDCbnrdtzsddoeXgo1crcv86t6ZvdqcHFveuUY="}]},"_npmUser":{"name":"aliyahzombie","email":"curaalizm@gmail.com"},"directories":{},"maintainers":[{"name":"aliyahzombie","email":"curaalizm@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/octssh_0.1.7_1780510475410_0.49461394500622435"},"_hasShrinkwrap":false}},"time":{"created":"2026-01-29T09:05:28.459Z","modified":"2026-06-03T18:14:35.650Z","0.1.0":"2026-01-29T09:05:28.680Z","0.1.1":"2026-01-30T02:36:54.213Z","0.1.2":"2026-02-07T16:10:43.988Z","0.1.3":"2026-03-02T09:00:24.890Z","0.1.4":"2026-03-02T13:39:43.073Z","0.1.5":"2026-03-15T02:56:31.908Z","0.1.6":"2026-03-15T03:07:55.143Z","0.1.7":"2026-06-03T18:14:35.555Z"},"bugs":{"url":"https://github.com/aliyahzombie/OctSSH/issues"},"license":"UNLICENSED","homepage":"https://github.com/aliyahzombie/OctSSH#readme","keywords":["mcp","ssh","deployment","automation","agent","llm"],"repository":{"type":"git","url":"git+https://github.com/aliyahzombie/OctSSH.git"},"description":"OctSSH - Make LLMs safely control your servers for deployment (MCP)","maintainers":[{"name":"aliyahzombie","email":"curaalizm@gmail.com"}],"readme":"# OctSSH\n\n[English README](README.md)\n\n[![XEnvManager V1.0](https://img.shields.io/badge/XEnvManager-V1.0-blue)](https://github.com/AliyahZombie/XEnvMananger)\n\n<p align=\"center\">本项目支持 XEnvManager 协议</p>\n\nVibeCoding 的时候，我突然想到，能不能让 agent 帮我上服务器部署代码呢，于是，我开发了\n\n<img src=\"logo.png\" width=\"200\" />\n\n**OctSSH** 是一个 MCP 服务，允许 LLM **安全、可控**地访问您的服务器 shell 环境。\n\n### 注意\n**默认模式（stdio）下，OctSSH 只支持连接到您本机 `ssh_config` 中配置好的免密登录的机器。**\n\n---\n\n> [!TIP]\n> **那么... OctSSH 有什么特别之处呢？**\n\n## 异步支持\n\nOctSSH 提供了一套完整的异步任务工具，防止 LLM 等待长任务超时：\n\n| 工具 | 说明 |\n|:---|:---|\n| `exec(machine, command, confirm_code?)` | 同步执行短命令 |\n| `sudo-exec(machine, command, confirm_code?)` | 以 root 身份同步执行 (sudo -n) |\n| `exec-async(machine, command, confirm_code?)` | 后台运行长任务 (screen) |\n| `exec-async-sudo(...)` | 以 root 身份后台运行 |\n| `write-stdin(session_id, data, append_newline?)` | 向运行中的异步任务写入 stdin |\n| `get-result(session_id, lines?)` | 查看异步任务输出 |\n| `grep-result(session_id, pattern, ...)` | 搜索任务日志 |\n| `cancel(session_id)` | 终止任务 |\n| `sleep(time)` | 暂停（轮询场景适用） |\n\n> **注意**：在 **HTTP Serve 模式**下，上述工具直接作用于本机，不需要 `machine` 参数。\n\n## 安全设计\n\nOctSSH 设计了一套 **Virtual Mode** 操作模式和 **Confirm Code** 安全验证，工作流程如下：\n\n### 🔒 安全机制：Virtual Mode\n\n我们不希望 AI 变成毁灭世界的终结者，所以设计了 Virtual Mode。\n当 AI 尝试以下操作时，OctSSH **不会直接执行**，而是返回 `confirm_code` 确认码：\n\n- 📁 **文件覆盖**：上传的目标路径已存在同名文件\n- 💀 **高危指令**：`rm -rf` 等“删库跑路”级命令\n- 🔍 **正则拦截**：配置中自定义的敏感模式\n\n**执行流程示例**：\n1. AI 调用 `exec(\"web\", \"rm -rf /var/www/html\")`\n2. 🛑 OctSSH 拦截：该操作将递归删除目录 -> 返回 `confirm_code: a1b2c3` + 受影响文件预览\n3. 👤 用户检查后告诉 AI：\"确认执行\"\n4. ✅ AI 调用 `exec(\"web\", \"rm -rf /var/www/html\", \"a1b2c3\")` -> 真正执行\n\n## 快速开始\n\n### 安装\n\n```bash\nnpm install -g @aliyahzombie/octssh\noctssh init\n```\n\n### 启动模式\n\n#### 1. 默认 Client 模式 (stdio)\n在本地运行，通过 SSH 控制远程机器（读取 `~/.ssh/config`）：\n```bash\noctssh\n```\n\n#### 2. Streamable HTTP Server 模式 (本机控制)\n安装在**目标机器**上，通过 HTTP 接口控制该机器本身（无需 SSH 中转，适合反向代理或远程直连）。\n在此模式下，OctSSH 仅控制**本机**。\n\n```bash\noctssh serve\n```\n- **默认监听**：`127.0.0.1:8787` (可通过 `OCTSSH_SERVE_HOST` / `OCTSSH_SERVE_PORT` 覆盖)\n- **认证**：启动时会打印随机生成的 Key；客户端需带 Header `X-OctSSH-Key: <key>`\n  - 固定 Key 配置：`export OCTSSH_SERVE_KEY=\"my-secret\"`\n- **工具变化**：此模式下工具直接操作本机，**不接受 `machine` 参数**，且不暴露 SSH 传输工具（`upload`/`download`）。\n\n#### Windows 说明（serve 模式）\n\n在 Windows 上，OctSSH serve 会自动选择本地 shell，优先级如下：\n\n1) `sh`（如果存在，例如 Git-Bash/MSYS）\n2) `pwsh`\n3) `powershell`\n4) `cmd`\n\n可通过环境变量强制指定：\n\n```bat\nset OCTSSH_SHELL=powershell\n```\n\n### 工具前缀（可选）\n\n如果你需要同时运行多个 OctSSH 实例（避免工具名冲突），可以给所有暴露的工具增加前缀：\n\n```bash\nexport OCTSSH_TOOL_PREFIX=\"us1_\"\n```\n\n示例：`list` 会变成 `us1_list`。\n\n### write-stdin（异步任务交互输入）\n\n`write-stdin` 用于向正在运行的 `exec-async` 会话写入 stdin（给长任务/交互式脚本喂输入）。\n\n典型流程：\n1) 用 `exec-async` 启动一个会读取 stdin 的长任务\n2) 用 `write-stdin(session_id, data)` 发送输入\n3) 用 `get-result(session_id)` 轮询输出\n\n注意：\n- `append_newline` 默认是 `true`。\n- 单次写入最大 **64KiB**。\n- 这里的 stdin 是持续的流：**不会发送 EOF**。如果你的程序需要 EOF 才会退出，请用 `cancel` 结束会话。\n- 如果设置了 `OCTSSH_TOOL_PREFIX`，工具名也会带前缀（例如 `us1_write-stdin`）。\n\n### 接入 MCP 客户端\n\n#### 通用配置 (stdio)\n向你的 MCP 客户端配置文件添加：\n```json\n{\n  \"mcpServers\": {\n    \"octssh\": {\n      \"command\": \"octssh\",\n      \"args\": []\n    }\n  }\n}\n```\n\n#### Claude Code CLI\n```bash\nclaude mcp add octssh -- octssh\n```\n\n#### OpenCode CLI\n```json\n{\n  \"mcp\": {\n    \"octssh\": {\n      \"type\": \"local\",\n      \"command\": \"octssh\",\n      \"args\": [],\n      \"enabled\": true\n    }\n  }\n}\n```\n或者：\n```bash\nopencode mcp add octssh --command octssh\n```\n\n> [!CAUTION]\n> 本项目会连接到您的真实服务器（或在本机执行命令），请您务必仔细审查 LLM 的操作。使用该项目则代表您同意开发者不对任何可能的误操作负责。\n","readmeFilename":"README.zh.md"}