Skip to content

Commit a46a92a

Browse files
la14-1louisgvclaude
authored
fix: add missing PATH entries in Hetzner and DigitalOcean runServer/interactiveSession (#2450)
AWS and GCP both include $HOME/.npm-global/bin and $HOME/.claude/local/bin in the PATH exported before running remote commands. Hetzner and DO were missing these two entries, causing "command not found" errors for Claude Code and npm-global packages on those clouds. Agent: code-health Co-authored-by: B <6723574+louisgv@users.noreply.github.com> Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 1bddd71 commit a46a92a

3 files changed

Lines changed: 5 additions & 5 deletions

File tree

packages/cli/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@openrouter/spawn",
3-
"version": "0.15.38",
3+
"version": "0.15.39",
44
"type": "module",
55
"bin": {
66
"spawn": "cli.js"

packages/cli/src/digitalocean/digitalocean.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1124,7 +1124,7 @@ export async function waitForCloudInit(ip?: string, maxAttempts = 60): Promise<v
11241124

11251125
export async function runServer(cmd: string, timeoutSecs?: number, ip?: string): Promise<void> {
11261126
const serverIp = ip || _state.serverIp;
1127-
const fullCmd = `export PATH="$HOME/.local/bin:$HOME/.bun/bin:$PATH" && ${cmd}`;
1127+
const fullCmd = `export PATH="$HOME/.npm-global/bin:$HOME/.claude/local/bin:$HOME/.local/bin:$HOME/.bun/bin:$PATH" && ${cmd}`;
11281128
const keyOpts = getSshKeyOpts(await ensureSshKeys());
11291129

11301130
const proc = Bun.spawn(
@@ -1200,7 +1200,7 @@ export async function interactiveSession(cmd: string, ip?: string): Promise<numb
12001200
const term = sanitizeTermValue(process.env.TERM || "xterm-256color");
12011201
// Single-quote escaping prevents premature shell expansion of $variables in cmd
12021202
const shellEscapedCmd = cmd.replace(/'/g, "'\\''");
1203-
const fullCmd = `export TERM=${term} PATH="$HOME/.local/bin:$HOME/.bun/bin:$PATH" && exec bash -l -c '${shellEscapedCmd}'`;
1203+
const fullCmd = `export TERM=${term} PATH="$HOME/.npm-global/bin:$HOME/.claude/local/bin:$HOME/.local/bin:$HOME/.bun/bin:$PATH" && exec bash -l -c '${shellEscapedCmd}'`;
12041204
const keyOpts = getSshKeyOpts(await ensureSshKeys());
12051205

12061206
const exitCode = spawnInteractive([

packages/cli/src/hetzner/hetzner.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ export async function waitForCloudInit(ip?: string, maxAttempts = 60): Promise<v
555555

556556
export async function runServer(cmd: string, timeoutSecs?: number, ip?: string): Promise<void> {
557557
const serverIp = ip || _state.serverIp;
558-
const fullCmd = `export PATH="$HOME/.local/bin:$HOME/.bun/bin:$PATH" && ${cmd}`;
558+
const fullCmd = `export PATH="$HOME/.npm-global/bin:$HOME/.claude/local/bin:$HOME/.local/bin:$HOME/.bun/bin:$PATH" && ${cmd}`;
559559
const keyOpts = getSshKeyOpts(await ensureSshKeys());
560560

561561
const proc = Bun.spawn(
@@ -632,7 +632,7 @@ export async function interactiveSession(cmd: string, ip?: string): Promise<numb
632632
const term = sanitizeTermValue(process.env.TERM || "xterm-256color");
633633
// Single-quote escaping prevents premature shell expansion of $variables in cmd
634634
const shellEscapedCmd = cmd.replace(/'/g, "'\\''");
635-
const fullCmd = `export TERM=${term} PATH="$HOME/.local/bin:$HOME/.bun/bin:$PATH" && exec bash -l -c '${shellEscapedCmd}'`;
635+
const fullCmd = `export TERM=${term} PATH="$HOME/.npm-global/bin:$HOME/.claude/local/bin:$HOME/.local/bin:$HOME/.bun/bin:$PATH" && exec bash -l -c '${shellEscapedCmd}'`;
636636

637637
const keyOpts = getSshKeyOpts(await ensureSshKeys());
638638

0 commit comments

Comments
 (0)