Agent skill
win-server-deploy
Pack TermLink server into a self-contained zip for Windows deployment, install/uninstall as a background service using pm2, and manage the running server. Use when packaging the server for another Windows machine or setting up auto-start.
Install this agent skill to your Project
npx add-skill https://github.com/majiayu000/claude-skill-registry/tree/main/skills/other/other/win-server-deploy
SKILL.md
Windows Server Deploy
Use this skill to package the TermLink Node.js server into a portable zip and deploy it as a Windows background service.
Why Not Docker
node-pty requires native Windows conpty access for PowerShell/CMD terminals. Docker runs Linux containers and cannot provide Windows PTY, so the Win server must be deployed natively.
Prerequisites
- Build machine (this machine): Node.js 20+,
npm installalready done - Target machine: Node.js 20 LTS only (no build tools needed)
Pack
Create a self-contained zip with pruned node_modules (excludes @capacitor, xterm, nodemon — not needed on server):
powershell -ExecutionPolicy Bypass -File ./skills/win-server-deploy/scripts/pack-win-server.ps1
Output: dist/termlink-win-<timestamp>.zip (~22 MB)
The zip contains:
src/— server sourcepublic/— web frontend assetsnode_modules/— pruned production dependencies (with pre-builtnode-pty)ecosystem.config.js— pm2 process config.env.example— environment configuration templatedeploy-scripts/— install/uninstall/start scriptsdata/,logs/— empty runtime directories
Deploy on Target Machine
1. Extract
# Right-click zip → Extract All, or:
Expand-Archive termlink-win-*.zip -DestinationPath C:\TermLink
2. Configure
cd C:\TermLink
Copy-Item .env.example .env
notepad .env
Must change for production:
| Variable | Default | Description |
|---|---|---|
AUTH_USER |
admin |
BasicAuth username |
AUTH_PASS |
CHANGE_ME_TO_STRONG_PASSWORD |
BasicAuth password |
PORT |
3000 |
Listen port |
3. Install Service (as Administrator)
powershell -ExecutionPolicy Bypass -File .\deploy-scripts\install-service.ps1
This automatically:
- Installs
pm2globally - Registers pm2 auto-start on Windows boot
- Starts TermLink
- Verifies
/api/health
4. Verify
pm2 status
pm2 logs termlink
curl http://localhost:3000/api/health
Daily Management
pm2 restart termlink # Restart
pm2 stop termlink # Stop
pm2 start termlink # Start
pm2 logs termlink # View logs
pm2 monit # Real-time monitoring dashboard
Uninstall
powershell -ExecutionPolicy Bypass -File .\deploy-scripts\uninstall-service.ps1
Quick Test (No Service Install)
For local testing without pm2, just run directly:
cd C:\TermLink
node src/server.js
Rules
- Always exclude
@capacitor/*from server packages (contains Android DEX files with paths exceeding Windows MAX_PATH 260 limit). - Use
robocopy(notCopy-Item) when copyingnode_modulesto handle any remaining long paths. - The zip includes pre-compiled
node-ptynative bindings — the target machine does not need Python, Visual C++ Build Tools, or node-gyp. - pm2 must run in
forkmode (notcluster) becausenode-ptydoes not support cluster mode.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
agent-ops-spec
Manage specification documents in .agent/specs/. Use when user provides requirements, acceptance criteria, or feature descriptions that need to be tracked and validated against implementation.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-testing
Test strategy, execution, and coverage analysis. Use when designing tests, running test suites, or analyzing test results beyond baseline checks.
agent-ops-state
Maintain .agent state files. Use at session start, after meaningful steps, and before concluding: read/update constitution/memory/focus/issues/baseline consistently.
Didn't find tool you were looking for?