Lines 2869-2909javascript
2870 console.error("sshpass is not installed. Install it with:\n macOS: brew install hudochenkov/sshpass/sshpass\n Linux: sudo apt install sshpass");
2873 const localClaude = pjoin(hd(), ".claude");
2874 const localClaudeJson = pjoin(hd(), ".claude.json");
2875 if (!existsSync(localClaude)) {
2876 console.error(`Local Claude config not found at ${localClaude}`);
2877 console.error("Authenticate Claude Code on this machine first.");
2880 const sshOpts = "-o StrictHostKeyChecking=no -o UserKnownHostsFile=/dev/null";
2881 const remoteHome = `/home/${user}`;
2882 const sshCmd = (cmd) => `sshpass -p ${JSON.stringify(password)} ssh ${sshOpts} -p ${port} ${user}@${host} ${JSON.stringify(cmd)}`;
2883 const run = (cmd) => {
2884 execSync(cmd, { stdio: "inherit" });
2886 // --install: check if claude is on the remote, install if missing
2887 if (installClaude) {
2888 console.log(`Checking if Claude Code is installed on ${user}@${host}...`);
2890 execSync(sshCmd("which claude"), { stdio: "ignore" });
2891 console.log("Claude Code already installed.");
2894 console.log("Claude Code not found — installing Node.js and Claude Code...");
2896 echo '${password}' | sudo -S apt-get update && \
2897 echo '${password}' | sudo -S apt-get install -y curl && \
2898 if ! command -v node > /dev/null 2>&1; then
2899 curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash - && \
2900 echo '${password}' | sudo -S apt-get install -y nodejs
2902 echo '${password}' | sudo -S npm install -g @anthropic-ai/claude-code
2903 `));
HighRuntime Package Install
Package source invokes a package manager install command at runtime.
dist/index.jsView on unpkg · L2889 2906 // Wipe existing .claude on remote for a clean copy
2907 console.log("Removing existing .claude on remote...");
2908 run(sshCmd(`rm -rf ${remoteHome}/.claude`));
2909 // Tar up local .claude (excluding bulky dirs) and pipe to remote