diff --git a/assets/dockerfiles/Dockerfile.claude b/assets/dockerfiles/Dockerfile.claude index c7bf4f5b..3d89409c 100644 --- a/assets/dockerfiles/Dockerfile.claude +++ b/assets/dockerfiles/Dockerfile.claude @@ -2,7 +2,7 @@ FROM ubuntu:22.04 # Install curl and git, update package list -RUN apt-get update && apt-get install -y curl git ripgrep +RUN apt-get update && apt-get install -y curl git ripgrep procps # Install Node.js 24.x RUN curl -sL https://deb.nodesource.com/setup_24.x | bash - && apt-get install -y nodejs diff --git a/packages/cli/Dockerfile b/packages/cli/Dockerfile index 65244b9c..1866bbba 100644 --- a/packages/cli/Dockerfile +++ b/packages/cli/Dockerfile @@ -3,17 +3,27 @@ FROM oven/bun:1 # Install system dependencies including build tools for native modules RUN apt-get update && apt-get install -y \ bash \ + bc \ curl \ wget \ git \ python3 \ python3-pip \ build-essential \ + procps \ + neovim \ + jq \ + tini \ && rm -rf /var/lib/apt/lists/* +# Install Node.js for MCP server support +RUN curl -fsSL https://deb.nodesource.com/setup_lts.x | bash - \ + && apt-get install -y nodejs + # Set up Bun environment ENV BUN_INSTALL="/home/.bun" ENV PATH="$BUN_INSTALL/bin:$PATH" +ENV EDITOR="nvim" # Install coding agents globally RUN bun add -g @anthropic-ai/claude-code@latest || echo "Claude CLI install failed" @@ -26,16 +36,26 @@ RUN bun add -g @vibe-kit/grok-cli@latest || echo "Grok CLI install failed" RUN curl -sSL https://install.anthropic.com | bash || echo "Alternative Claude install failed" ENV PATH="/root/.local/bin:$BUN_INSTALL/bin:$PATH" +# Install ccusage for Claude Code usage tracking +RUN npm install -g ccusage || echo "ccusage install failed (non-critical)" + +# Install uv package manager for fetch MCP server +RUN curl -LsSf https://astral.sh/uv/install.sh | sh +ENV PATH="/root/.local/bin:$PATH" + # Install vibekit CLI globally and create symlink RUN bun add -g vibekit || echo "Vibekit install failed" -# Create workspace directory -RUN mkdir -p /workspace +# Create workspace directory and Claude directories +RUN mkdir -p /workspace /root/.claude WORKDIR /workspace # Expose common local development ports EXPOSE 3001 EXPOSE 8080 +# Use tini as PID 1 to properly handle subprocesses and signals +ENTRYPOINT ["/usr/bin/tini", "--"] + # Keep container running for persistent use CMD ["tail", "-f", "/dev/null"] \ No newline at end of file diff --git a/packages/cli/src/agents/base.js b/packages/cli/src/agents/base.js index af38f400..dc2ffde0 100644 --- a/packages/cli/src/agents/base.js +++ b/packages/cli/src/agents/base.js @@ -332,6 +332,16 @@ class BaseAgent { ...options.env }; + // Ensure PATH includes system directories for commands like ps + if (!env.PATH || !env.PATH.includes('/usr/bin')) { + const systemPaths = ['/usr/local/bin', '/usr/bin', '/bin']; + const currentPath = env.PATH || ''; + const missingPaths = systemPaths.filter(p => !currentPath.split(':').includes(p)); + if (missingPaths.length > 0) { + env.PATH = currentPath ? `${currentPath}:${missingPaths.join(':')}` : systemPaths.join(':'); + } + } + // Add proxy settings to environment if specified if (this.proxy) { env.HTTP_PROXY = this.proxy; diff --git a/packages/cli/src/auth/claude-auth-helper.js b/packages/cli/src/auth/claude-auth-helper.js index e870045e..28a9fed8 100644 --- a/packages/cli/src/auth/claude-auth-helper.js +++ b/packages/cli/src/auth/claude-auth-helper.js @@ -65,20 +65,20 @@ export class ClaudeAuthHelper { // Get valid OAuth token and raw token data const token = await ClaudeAuth.getValidToken(); const tokenData = await ClaudeAuth.getRawToken(); - + if (!token || !tokenData) { return null; } - + // Generate settings for onboarding bypass (now includes MCP servers from host) const settings = await this.generateClaudeSettings(tokenData); - + return { oauthToken: token, settings: settings, tokenData: tokenData }; - + } catch (error) { // Return null if auth fails - this is expected when not authenticated return null; diff --git a/packages/cli/src/sandbox/docker-sandbox.js b/packages/cli/src/sandbox/docker-sandbox.js index 32a7dec1..24f9c0dc 100644 --- a/packages/cli/src/sandbox/docker-sandbox.js +++ b/packages/cli/src/sandbox/docker-sandbox.js @@ -203,6 +203,9 @@ export class DockerSandbox { const customFlags = SandboxConfig.getSandboxFlags(); containerArgs.push(...customFlags); + // Mark container as sandbox environment (for hooks and scripts) + containerArgs.push('-e', 'VIBEKIT_SANDBOX_ACTIVE=1'); + // Mount project directory containerArgs.push('-v', `${this.projectRoot}:/workspace`);