Skip to content
Closed
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
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@openrouter/spawn",
"version": "1.0.27",
"version": "1.0.28",
"type": "module",
"bin": {
"spawn": "cli.js"
Expand Down
4 changes: 2 additions & 2 deletions packages/cli/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -959,12 +959,12 @@ async function main(): Promise<void> {

// fast_provision experiment: if the user did NOT pass --beta or --fast,
// bucket them on the PostHog `fast_provision` flag. The `test` variant
// turns on images by default; control behaves as before.
// turns on images + docker by default; control behaves as before.
// Exposure is captured for both variants so PostHog can compute conversion.
if (!userOptedIntoBeta) {
const variant = getFeatureFlag("fast_provision", "control");
if (variant === "test") {
betaFeatures.push("images");
betaFeatures.push("images", "docker");
}
}

Expand Down
28 changes: 24 additions & 4 deletions packages/cli/src/local/local.ts
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,6 @@ export async function ensureDocker(): Promise<void> {
process.exit(1);
}
} else {
logStep("Docker not found — installing docker.io...");
const hasSudo =
Bun.spawnSync(
[
Expand All @@ -475,12 +474,32 @@ export async function ensureDocker(): Promise<void> {
],
},
).exitCode === 0;
const prefix = hasSudo ? "sudo " : "";
const hasApt =
Bun.spawnSync(
[
"which",
"apt-get",
],
{
stdio: [
"ignore",
"ignore",
"ignore",
],
},
).exitCode === 0;
// Prefer apt-get on Debian/Ubuntu (small, fast, distro-trusted).
// Fall back to Docker's convenience script for Fedora/Arch/Alpine/etc.
const installLabel = hasApt ? "docker.io" : "via get.docker.com";
logStep(`Docker not found — installing ${installLabel}...`);
const installCmd = hasApt
? `${hasSudo ? "sudo " : ""}apt-get update -qq && ${hasSudo ? "sudo " : ""}apt-get install -y -qq docker.io`
: `curl -fsSL https://get.docker.com | ${hasSudo ? "sudo sh" : "sh"}`;
const result = Bun.spawnSync(
[
"bash",
"-c",
`${prefix}apt-get update -qq && ${prefix}apt-get install -y -qq docker.io`,
installCmd,
],
{
stdio: [
Expand All @@ -491,7 +510,8 @@ export async function ensureDocker(): Promise<void> {
},
);
if (result.exitCode !== 0) {
logInfo("Auto-install failed. Install Docker manually: sudo apt-get install docker.io");
const manualHint = hasApt ? "sudo apt-get install docker.io" : "https://docs.docker.com/engine/install/";
logInfo(`Auto-install failed. Install Docker manually: ${manualHint}`);
process.exit(1);
}
}
Expand Down
Loading