From eb3bad289adbf3430387e2ebae9f34c784c94558 Mon Sep 17 00:00:00 2001 From: Jared Miller Date: Wed, 28 Jan 2026 17:28:17 -0500 Subject: [PATCH] Add light build requiring bun installed --- justfile | 13 +++++++++++-- src/cli.ts | 7 +++++++ 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/justfile b/justfile index fb2838e..d8b3add 100644 --- a/justfile +++ b/justfile @@ -17,13 +17,22 @@ start: check: bun run lint && bun run typecheck && bun run test -# Build CLI binary (smallest possible) +build: build-cli build-bundle + @ls -lah dist/bin/ + +# Build CLI binary (standalone, ~100MB, no deps) build-cli: mkdir -p dist/bin bun build --compile --minify --sourcemap=none src/cli.ts --outfile dist/bin/claude-remote +# Build CLI bundle (small, requires bun installed) +build-bundle: + mkdir -p dist/bin + bun build --minify --target bun src/cli.ts --outfile dist/bin/claude-remote.js + chmod +x dist/bin/claude-remote.js + # Docker build -build: +build-image: docker build -t claude-remote . up: diff --git a/src/cli.ts b/src/cli.ts index 603db1d..ef75b23 100755 --- a/src/cli.ts +++ b/src/cli.ts @@ -2,6 +2,13 @@ // PTY wrapper for claude CLI +// Check for Bun runtime (only fails when running bundled .js with Node) +if (typeof Bun === "undefined") { + console.error("claude-remote requires Bun to run."); + console.error("Install Bun: https://bun.sh"); + process.exit(1); +} + import type { IPty } from "bun-pty"; import { spawn } from "bun-pty"; import type { ClientMessage, ServerMessage } from "./types";