Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/cli/default-dockerfile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,10 @@ RUN curl -LsSf https://astral.sh/uv/install.sh | sh \
# Sentry CLI
RUN curl -sL https://sentry.io/get-cli/ | bash

# RTK (token-optimized CLI proxy)
RUN curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | sh \
&& ln -sf /root/.local/bin/rtk /usr/local/bin/rtk

# pnpm via Corepack
ENV COREPACK_ENABLE_DOWNLOAD_PROMPT=0
RUN corepack enable
Expand Down
16 changes: 16 additions & 0 deletions src/cli/sandbox.ts
Original file line number Diff line number Diff line change
Expand Up @@ -720,6 +720,22 @@ function buildDockerRunArgs(
}
}

// RTK data dir: mount host rtk data dir into the container so that `rtk gain`
// on the host reflects token savings recorded inside the sandbox.
// Host path varies by OS (macOS: ~/Library/Application Support/rtk,
// Linux: ~/.local/share/rtk); container always uses /root/.local/share/rtk.
const rtkHostDataDir = os.platform() === 'darwin'
? path.join(hostHome, 'Library', 'Application Support', 'rtk')
: path.join(hostHome, '.local', 'share', 'rtk')
const rtkContainerDataDir = `${containerHome}/.local/share/rtk`
if (!mountedPaths.has(rtkHostDataDir)) {
// Create the directory on the host if it doesn't exist so the mount succeeds
// even before rtk has been run for the first time.
fs.mkdirSync(rtkHostDataDir, { recursive: true })
mountedPaths.add(rtkHostDataDir)
args.push('-v', `${rtkHostDataDir}:${rtkContainerDataDir}`)
}

const SF_CACHE_DIR = '$HOME/.cache/snowflake'
const SF_CACHE_FILE = `${SF_CACHE_DIR}/credential_cache_v1.json`
const BOOTSTRAP_LOG = '/pippin-share/bootstrap.log'
Expand Down
Loading