Lines 2792-2832javascript
2793 console.error("sshpass is not installed. Install it with:\n macOS: brew install hudochenkov/sshpass/sshpass\n Linux: sudo apt install sshpass");
2796 const localClaude = pjoin(hd(), ".claude");
2797 const localClaudeJson = pjoin(hd(), ".claude.json");
2798 if (!existsSync(localClaude)) {
2799 console.error(`Local Claude config not found at ${localClaude}`);
2800 console.error("Authenticate Claude Code on this machine first.");
2803 const sshOpts = "-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null";
2804 const remoteHome = `/home/${user}`;
2805 const sshCmd = (cmd) => `sshpass -p ${JSON.stringify(password)} ssh ${sshOpts} -p ${port} ${user}@${host} ${JSON.stringify(cmd)}`;
2806 const run = (cmd) => {
2807 execSync(cmd, { stdio: "inherit" });
2809 // --install: check if claude is on the remote, install if missing
2810 if (installClaude) {
2811 console.log(`Checking if Claude Code is installed on ${user}@${host}...`);
2813 execSync(sshCmd("which claude"), { stdio: "ignore" });
2814 console.log("Claude Code already installed.");
2817 console.log("Claude Code not found — installing Node.js and Claude Code...");
2819 echo '${password}' | sudo -S apt-get update && \
2820 echo '${password}' | sudo -S apt-get install -y curl && \
2821 if ! command -v node > /dev/null 2>&1; then
2822 curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - && \
2823 echo '${password}' | sudo -S apt-get install -y nodejs
2825 echo '${password}' | sudo -S npm install -g @anthropic-ai/claude-code
2826 `));
HighRuntime Package Install
Package source invokes a package manager install command at runtime.
dist/index.jsView on unpkg · L2812 2829 // Wipe existing .claude on remote for a clean copy
2830 console.log("Removing existing .claude on remote...");
2831 run(sshCmd(`rm -rf ${remoteHome}/.claude`));
2832 // Tar up local .claude (excluding bulky dirs) and pipe to remote