Understand any codebase instantly. System intelligence for codebases, built for humans and AI.
TypeScript aiai-memoryclaude-codeclicode-analysiscode-mappingcode-memorycodebase-understandingcodexdeveloper-toolsllmopenclawpersistent-memoryprogram-analysissoftware-architecturesystem-intelligencesystem-mapping
feat: add Windows bash installer support
Joseph Mikhail34a9a95cc035
diff --git a/README.md b/README.mdindex a7979682..9db84a00 100644--- a/README.md+++ b/README.md@@ -71,10 +71,16 @@ Open the map instead.## Install+**macOS / Linux**```bashcurl -fsSL https://get.ix.dev | bash```+**Windows (PowerShell)**+```powershell+irm https://raw.githubusercontent.com/ix-infrastructure/Ix/main/install.ps1 | iex+```+or```bashdiff --git a/install.ps1 b/install.ps1index eb07033f..1ad4cc94 100644--- a/install.ps1+++ b/install.ps1@@ -188,7 +188,7 @@ if ($existingVersion -eq $Version) {# Create batch wrapper@"@echo off-"%~dp0..\cli\ix.cmd" %*+"%~dp0..\cli\ix-$Version-windows-amd64\ix.cmd" %*"@ | Out-File -FilePath "$IxBin\ix.cmd" -Encoding asciiWrite-Ok "Installed: $IxBin\ix.cmd"diff --git a/install.sh b/install.shindex 5d65fdf9..41b6e439 100755--- a/install.sh+++ b/install.sh@@ -101,6 +101,7 @@ detect_platform() {case "$os" indarwin) os="darwin" ;;linux) os="linux" ;;+ mingw*|msys*|cygwin*) os="windows" ;;*) err "Unsupported OS: $os" ;;esac@@ -156,6 +157,10 @@ elseecho " Quick install:"echo " curl -fsSL https://get.docker.com | sh";;+ MINGW*|MSYS*|CYGWIN*)+ echo " Install Docker Desktop for Windows:"+ echo " https://docs.docker.com/desktop/install/windows-install/"+ ;;esacecho ""err "Install Docker and re-run this installer."@@ -197,13 +202,15 @@ elseif curl -sf "$HEALTH_URL" >/dev/null 2>&1 && curl -sf "$ARANGO_URL" >/dev/null 2>&1; theninfo "Backend is already running and healthy"else- stale_pid=$(lsof -ti :8090 2>/dev/null || true)- if [ -n "$stale_pid" ]; then- stale_cmd=$(ps -p "$stale_pid" -o comm= 2>/dev/null || true)- if [ "$stale_cmd" != "com.docker.ba" ] && [ "$stale_cmd" != "docker" ]; then- warn "Killing stale process on port 8090 (PID $stale_pid: $stale_cmd)"- kill "$stale_pid" 2>/dev/null || true- sleep 1+ if command -v lsof >/dev/null 2>&1; then+ stale_pid=$(lsof -ti :8090 2>/dev/null || true)+ if [ -n "$stale_pid" ]; then+ stale_cmd=$(ps -p "$stale_pid" -o comm= 2>/dev/null || true)+ if [ "$stale_cmd" != "com.docker.ba" ] && [ "$stale_cmd" != "docker" ]; then+ warn "Killing stale process on port 8090 (PID $stale_pid: $stale_cmd)"+ kill "$stale_pid" 2>/dev/null || true+ sleep 1+ fififi@@ -240,7 +247,11 @@ fistep "3. ix CLI"-TARBALL_NAME="ix-${VERSION}-${PLATFORM}.tar.gz"+if [ "$PLATFORM" = "windows-amd64" ]; then+ TARBALL_NAME="ix-${VERSION}-${PLATFORM}.zip"+else+ TARBALL_NAME="ix-${VERSION}-${PLATFORM}.tar.gz"+fiTARBALL_URL="https://github.com/${GITHUB_ORG}/${GITHUB_REPO}/releases/download/v${VERSION}/${TARBALL_NAME}"INSTALL_DIR="$IX_HOME/cli"@@ -252,8 +263,21 @@ for old_ix in "$HOME/.local/bin/ix" "/usr/local/bin/ix"; dodone# Check if already installed at correct version+# On Windows, avoid invoking the shim (calls cmd.exe, hangs in bash subshell)+check_installed_version() {+ if [ "$PLATFORM" = "windows-amd64" ]; then+ if [ -d "$INSTALL_DIR/ix-${VERSION}-windows-amd64" ]; then+ echo "$VERSION"+ else+ echo "unknown"+ fi+ else+ "$IX_BIN/ix" --version 2>/dev/null || echo "unknown"+ fi+}+if [ -x "$IX_BIN/ix" ]; then- existing_version=$("$IX_BIN/ix" --version 2>/dev/null || echo "unknown")+ existing_version=$(check_installed_version)if [ "$existing_version" = "$VERSION" ]; theninfo "ix CLI v${VERSION} is already installed"else@@ -262,7 +286,7 @@ if [ -x "$IX_BIN/ix" ]; thenfifi-if [ ! -x "$IX_BIN/ix" ] || [ "$("$IX_BIN/ix" --version 2>/dev/null || echo "")" != "$VERSION" ]; then+if [ ! -x "$IX_BIN/ix" ] || [ "$(check_installed_version)" != "$VERSION" ]; thenmkdir -p "$INSTALL_DIR"TMP_DIR=$(mktemp -d)@@ -285,15 +309,27 @@ if [ ! -x "$IX_BIN/ix" ] || [ "$("$IX_BIN/ix" --version 2>/dev/null || echo "")"fi# Extract- tar -xzf "$TMP_FILE" -C "$INSTALL_DIR" --strip-components=1+ if [ "$PLATFORM" = "windows-amd64" ]; then+ unzip -q "$TMP_FILE" -d "$INSTALL_DIR"+ else+ tar -xzf "$TMP_FILE" -C "$INSTALL_DIR" --strip-components=1+ firm -rf "$TMP_DIR"info "Extracted CLI"# Create wrapper in bin dir- cat > "$IX_BIN/ix" <<SHIM+ if [ "$PLATFORM" = "windows-amd64" ]; then+ IX_JS="$INSTALL_DIR/ix-${VERSION}-windows-amd64/cli/dist/cli/main.js"+ cat > "$IX_BIN/ix" <<SHIM+#!/usr/bin/env bash+exec node "$IX_JS" "\$@"+SHIM+ else+ cat > "$IX_BIN/ix" <<SHIM#!/usr/bin/env bashexec "$INSTALL_DIR/ix" "\$@"SHIM+ fichmod +x "$IX_BIN/ix"ensure_path@@ -327,7 +363,12 @@ echo " ArangoDB: http://localhost:8529"echo ""# Verify CLI works-if command -v ix >/dev/null 2>&1; then+if [ "$PLATFORM" = "windows-amd64" ]; then+ if [ -x "$IX_BIN/ix" ]; then+ info "ix CLI v${VERSION} installed at $IX_BIN/ix"+ echo " Run 'ix --version' in a new terminal to verify"+ fi+elif command -v ix >/dev/null 2>&1; thenCLI_VERSION=$(ix --version 2>/dev/null || echo "unknown")info "ix CLI v${CLI_VERSION} is working"elif [ -x "$IX_BIN/ix" ]; thendiff --git a/ix-cli/package.json b/ix-cli/package.jsonindex 0f8bffee..c9efd889 100644--- a/ix-cli/package.json+++ b/ix-cli/package.json@@ -1,6 +1,6 @@{"name": "@ix/cli",- "version": "0.4.0",+ "version": "0.4.4","type": "module","description": "Ix Memory — Persistent Memory for LLM Systems","main": "dist/index.js",diff --git a/ix-cli/src/cli/commands/upgrade.ts b/ix-cli/src/cli/commands/upgrade.tsindex 57568951..0b6ad72f 100644--- a/ix-cli/src/cli/commands/upgrade.ts+++ b/ix-cli/src/cli/commands/upgrade.ts@@ -75,7 +75,10 @@ function isNewer(latest: string, current: string): boolean {}function detectPlatform(): string {- const os = process.platform === "darwin" ? "darwin" : "linux";+ let os: string;+ if (process.platform === "darwin") os = "darwin";+ else if (process.platform === "win32") os = "windows";+ else os = "linux";const arch = process.arch === "arm64" ? "arm64" : "amd64";return `${os}-${arch}`;}@@ -141,21 +144,26 @@ export function registerUpgradeCommand(program: Command): void {if (opts.check) return;const platform = detectPlatform();- const tarball = `ix-${latest}-${platform}.tar.gz`;- const url = `https://github.com/${GITHUB_ORG}/${GITHUB_REPO}/releases/download/v${latest}/${tarball}`;+ const isWindows = platform.startsWith("windows");+ const archiveName = isWindows+ ? `ix-${latest}-${platform}.zip`+ : `ix-${latest}-${platform}.tar.gz`;+ const url = `https://github.com/${GITHUB_ORG}/${GITHUB_REPO}/releases/download/v${latest}/${archiveName}`;const installDir = join(IX_HOME, "cli");// Use secure temp directory- const tmpDir = mkdtempSync(join(tmpdir(), "ix-upgrade-"));- const tmpFile = join(tmpDir, tarball);+ // Keep Windows paths for curl/Node (which use Windows curl/fs),+ // convert to Unix paths only for bash tools (unzip)+ const tmpDirRaw = mkdtempSync(join(tmpdir(), "ix-upgrade-"));+ const tmpFile = join(tmpDirRaw, archiveName);console.log(`Downloading ix ${latest} for ${platform}...`);try {execFileSync("curl",- ["-fsSL", url, "-o", tmpFile],- { stdio: "inherit", timeout: 60000 }+ ["-fsSL", "--progress-bar", url, "-o", tmpFile],+ { stdio: ["ignore", "inherit", "inherit"], timeout: 300000 });} catch {console.error(`[error] Failed to download ${url}`);@@ -163,7 +171,7 @@ export function registerUpgradeCommand(program: Command): void {console.error(` curl -fsSL https://raw.githubusercontent.com/${GITHUB_ORG}/${GITHUB_REPO}/main/install.sh | bash`);- rmSync(tmpDir, { recursive: true, force: true });+ rmSync(tmpDirRaw, { recursive: true, force: true });process.exit(1);}@@ -171,18 +179,41 @@ export function registerUpgradeCommand(program: Command): void {try {rmSync(installDir, { recursive: true, force: true });mkdirSync(installDir, { recursive: true });- execFileSync(- "tar",- ["-xzf", tmpFile, "-C", installDir, "--strip-components=1"],- { stdio: "ignore" }- );- rmSync(tmpDir, { recursive: true, force: true });+ if (isWindows) {+ let unixTmpFile = tmpFile;+ let unixInstallDir = installDir;+ try {+ unixTmpFile = execFileSync("cygpath", ["-u", tmpFile], { encoding: "utf-8" }).trim();+ unixInstallDir = execFileSync("cygpath", ["-u", installDir], { encoding: "utf-8" }).trim();+ } catch { /* use as-is */ }+ execFileSync("unzip", ["-q", unixTmpFile, "-d", unixInstallDir], { stdio: "ignore" });+ } else {+ execFileSync(+ "tar",+ ["-xzf", tmpFile, "-C", installDir, "--strip-components=1"],+ { stdio: "ignore" }+ );+ }+ rmSync(tmpDirRaw, { recursive: true, force: true });} catch {console.error("[error] Failed to extract CLI update.");- rmSync(tmpDir, { recursive: true, force: true });+ rmSync(tmpDirRaw, { recursive: true, force: true });process.exit(1);}+ // On Windows, update the shim to point to the new versioned directory+ if (isWindows) {+ const shimPath = join(homedir(), ".local", "bin", "ix");+ const jsPathWin = join(installDir, `ix-${latest}-${platform}`, "cli", "dist", "cli", "main.js");+ let jsPath = jsPathWin;+ try {+ jsPath = execFileSync("cygpath", ["-u", jsPathWin], { encoding: "utf-8" }).trim();+ } catch { /* use windows path */ }+ if (existsSync(shimPath)) {+ writeFileSync(shimPath, `#!/usr/bin/env bash\nexec node "${jsPath}" "$@"\n`);+ }+ }+console.log(`[ok] Upgraded ix: ${current} → ${latest}`);console.log("Pulling latest backend image...");diff --git a/ix-cli/src/cli/main.ts b/ix-cli/src/cli/main.tsindex 0ab31377..b8415758 100644--- a/ix-cli/src/cli/main.ts+++ b/ix-cli/src/cli/main.ts@@ -6,10 +6,12 @@ import { buildHelpText } from "./help-text.js";import { checkForUpdate } from "./commands/upgrade.js";import { readFileSync } from "fs";-import { join } from "path";+import { join, dirname } from "path";+import { fileURLToPath } from "url";let cliVersion = "0.0.0";try {+ const __dirname = dirname(fileURLToPath(import.meta.url));const pkg = JSON.parse(readFileSync(join(__dirname, "../../package.json"), "utf-8"));cliVersion = pkg.version || "0.0.0";} catch {}