Open source Grok Bot alternative, Bring your own agent and subscription: message Claude Code, Codex, Gemini CLI, Cursor, Copilot and 40+ AI agents as bots on your own computer, from iPhone, Mac, Windows, Linux or terminal. Agent-agnostic and free. Also a Muse and Dots alternative. Built in Rust.
Rust acpagent-client-protocolai-agentsai-assistantclaudeclaude-codecodexcoding-agentscursorgeminigemini-cligrok-bot-alternativeiosiphonelinuxmacosmcpopen-sourcerustself-hosted
feat(web): offer the installer for the visitor's own computer
leepokai9a04cf9ad199
diff --git a/docs/reference/analytics-events.md b/docs/reference/analytics-events.mdindex 9ee6fe23..f54f0646 100644--- a/docs/reference/analytics-events.md+++ b/docs/reference/analytics-events.md@@ -148,7 +148,7 @@ The *Onboarding & conversion* dashboard in PostHog reads these steps, each per `codync.dev counts visits without cookies or anything stored on the visitor's device(posthog-js `cookieless_mode: 'always'`, which needs the project's *cookieless server hash mode*;without it PostHog drops these events): `$pageview`, `download_clicked` (`platform`:-`mac`/`windows`/`linux`/`ios`; `linux` and the Homebrew `mac` are copies of the install command),+`mac`/`windows`/`linux`/`ios`; `linux` counts the Linux download links (x86_64 and arm64) and copies of the install command; the Homebrew `mac` is a copy of its command),`link_opened` (`link`). One document-level click listener in `web/app/analytics.tsx` reads eachlink's `href`, so a new link is counted without code; the film counts as `demo` when focus movesinto its frame.diff --git a/web/app/analytics.tsx b/web/app/analytics.tsxindex 36a487ce..32c80c02 100644--- a/web/app/analytics.tsx+++ b/web/app/analytics.tsx@@ -2,7 +2,7 @@import { useEffect } from "react";import posthog from "posthog-js";-import { APP_STORE, DISCORD, DMG, GITHUB, KO_FI, PRODUCT_HUNT, WINDOWS } from "./links";+import { APP_STORE, DISCORD, DMG, GITHUB, KO_FI, LINUX, LINUX_ARM, PRODUCT_HUNT, WINDOWS } from "./links";// Cookieless counts for codync.dev (docs/reference/analytics-events.md, Website). Nothing is// stored on the device; PostHog's server hashes the visitor per day.@@ -12,7 +12,7 @@ const MAIN = ["codync.dev", "www.codync.dev"];export type Platform = "mac" | "windows" | "linux" | "ios";-const downloads: Record<string, Platform> = { [DMG]: "mac", [WINDOWS]: "windows", [APP_STORE]: "ios" };+const downloads: Record<string, Platform> = { [DMG]: "mac", [WINDOWS]: "windows", [LINUX]: "linux", [LINUX_ARM]: "linux", [APP_STORE]: "ios" };// Matched by prefix, first hit wins.const links: [prefix: string, link: string][] = [[`${GITHUB}/issues`, "issues"],diff --git a/web/app/components/download-button.tsx b/web/app/components/download-button.tsxindex 055117b8..6864ba8a 100644--- a/web/app/components/download-button.tsx+++ b/web/app/components/download-button.tsx@@ -1,26 +1,38 @@-import { CaretDown, DeviceMobile, LinuxLogo, Terminal, WindowsLogo } from "@phosphor-icons/react/ssr";+"use client";++import { CaretDown, DeviceMobile, LinuxLogo, Terminal, WindowsLogo } from "@phosphor-icons/react";import { AppleLogo } from "./apple-logo";-import { APP_STORE, DMG, WINDOWS } from "../links";+import { useOs, type Os } from "./use-os";+import { APP_STORE, DMG, LINUX, LINUX_ARM, WINDOWS } from "../links";++type Icon = typeof DeviceMobile | typeof AppleLogo;+type Target = { label: string; detail: string; href: string; Icon: Icon; button?: string };++// The main button reads "Download for <label>" unless `button` says otherwise.+const targets: Record<Os | "terminal", Target> = {+ mac: { label: "macOS", detail: "Apple silicon and Intel", href: DMG, Icon: AppleLogo },+ windows: { label: "Windows", detail: "Installer for x64 PCs", href: WINDOWS, Icon: WindowsLogo },+ linux: { label: "Linux", detail: "AppImage for x86_64", href: LINUX, Icon: LinuxLogo, button: "Download for Linux (x86_64)" },+ "linux-arm64": { label: "Linux (Arm)", detail: "AppImage for arm64", href: LINUX_ARM, Icon: LinuxLogo, button: "Download for Linux (arm64)" },+ ios: { label: "iPhone", detail: "App Store", href: APP_STORE, Icon: DeviceMobile, button: "Get the iPhone app" },+ terminal: { label: "Terminal", detail: "Over SSH, any machine", href: "/#install", Icon: Terminal },+};-const others: [label: string, detail: string, href: string, Icon: typeof DeviceMobile | typeof AppleLogo][] = [- ["macOS", "Apple silicon and Intel", DMG, AppleLogo],- ["Windows", "Installer for x64 PCs", WINDOWS, WindowsLogo],- ["iPhone", "App Store", APP_STORE, DeviceMobile],- ["Linux", "AppImage, deb and servers", "/#install", LinuxLogo],- ["Terminal", "Over SSH, any machine", "/#install", Terminal],-];+const order = ["mac", "windows", "linux", "linux-arm64", "ios", "terminal"] as const;-// "Download for macOS" with a split menu for the other platforms; a native <details>, no script.+// "Download for <your OS>" with a split menu for the other platforms; a native <details>.export default function DownloadButton({ size = "lg" }: { size?: "sm" | "lg" }) {+ const os = useOs();+ const main = targets[os];const h = size === "sm" ? "h-9 text-sm" : "h-12";return (<div className="relative flex"><a- href={DMG}+ href={main.href}className={`${h} inline-flex items-center gap-2 rounded-l-full bg-neutral-50 pr-4 pl-5 font-medium whitespace-nowrap text-neutral-950 transition hover:bg-white active:scale-[0.98]`}>- <AppleLogo size={size === "sm" ? 15 : 18} weight="fill" />- {size === "sm" ? "Download" : "Download for macOS"}+ <main.Icon size={size === "sm" ? 15 : 18} weight="fill" />+ {size === "sm" ? "Download" : (main.button ?? `Download for ${main.label}`)}</a><details className="group"><summary@@ -30,17 +42,22 @@ export default function DownloadButton({ size = "lg" }: { size?: "sm" | "lg" })<CaretDown size={14} weight="bold" className="transition-transform group-open:rotate-180" /></summary><ul className="absolute right-0 z-40 mt-2 w-64 rounded-2xl bg-neutral-900 p-2 shadow-[0_20px_40px_rgba(0,0,0,0.6)]">- {others.map(([label, detail, href, Icon]) => (- <li key={label}>- <a href={href} className="flex items-center gap-3 rounded-xl px-3 py-2.5 transition hover:bg-neutral-800">- <Icon size={18} weight="fill" className="text-neutral-200" />- <span>- <span className="block text-sm font-medium text-neutral-100">{label}</span>- <span className="block text-xs text-neutral-500">{detail}</span>- </span>- </a>- </li>- ))}+ {order+ .filter((key) => key !== os)+ .map((key) => {+ const { label, detail, href, Icon } = targets[key];+ return (+ <li key={key}>+ <a href={href} className="flex items-center gap-3 rounded-xl px-3 py-2.5 transition hover:bg-neutral-800">+ <Icon size={18} weight="fill" className="text-neutral-200" />+ <span>+ <span className="block text-sm font-medium text-neutral-100">{label}</span>+ <span className="block text-xs text-neutral-500">{detail}</span>+ </span>+ </a>+ </li>+ );+ })}</ul></details></div>diff --git a/web/app/components/install.tsx b/web/app/components/install.tsxindex 1b9a1f3a..70d12638 100644--- a/web/app/components/install.tsx+++ b/web/app/components/install.tsx@@ -5,9 +5,7 @@ import CopyCommand from "./copy-command";import Eyebrow from "./eyebrow";import Halftone from "./halftone";import Reveal from "./reveal";-import { APP_STORE, DMG, WINDOWS } from "../links";--const INSTALL_SH = "curl -fsSL https://raw.githubusercontent.com/leepokai/Codync/main/packaging/install.sh | sh";+import { APP_STORE, DMG, INSTALL_SH, LINUX, LINUX_ARM, WINDOWS } from "../links";export default function Install() {return (@@ -66,6 +64,16 @@ export default function Install() {<div className="mt-5"><CopyCommand command={INSTALL_SH} platform="linux" /></div>+ <p className="mt-4 text-sm text-neutral-500">+ Desktop app:{" "}+ <a href={LINUX} className="text-neutral-300 underline underline-offset-4 transition hover:text-white">+ x86_64+ </a>+ {" · "}+ <a href={LINUX_ARM} className="text-neutral-300 underline underline-offset-4 transition hover:text-white">+ arm64+ </a>+ </p></div></Reveal>diff --git a/web/app/components/use-os.ts b/web/app/components/use-os.tsnew file mode 100644index 00000000..db6daebc--- /dev/null+++ b/web/app/components/use-os.ts@@ -0,0 +1,26 @@+import { useSyncExternalStore } from "react";++// The computer a visitor is on, as far as the browser says: one installer each, `linux-arm64` for Arm Linux.+// Phones and anything unknown (Android, ChromeOS, 32-bit Arm) get the Mac default, as before.+// Chromium reports every Linux as x86_64, so Arm Linux is only caught on Firefox; the menu lists both.+export type Os = "mac" | "windows" | "linux" | "linux-arm64" | "ios";++function detect(): Os {+ const ua = navigator.userAgent;+ if (/android|cros/i.test(ua)) return "mac";+ // iPadOS Safari presents itself as a Mac, but a Mac has no touch screen.+ if (/iphone|ipad|ipod/i.test(ua) || (/macintosh/i.test(ua) && navigator.maxTouchPoints > 1)) return "ios";+ if (/windows/i.test(ua)) return "windows";+ if (/linux|x11/i.test(ua)) {+ if (/aarch64|arm64/i.test(ua)) return "linux-arm64";+ return /arm/i.test(ua) ? "mac" : "linux"; // 32-bit Arm has no build+ }+ return "mac";+}++const never = () => () => {};++// Server and first client render say "mac"; the visitor's own OS replaces it right after hydration.+export function useOs(): Os {+ return useSyncExternalStore(never, detect, () => "mac");+}diff --git a/web/app/download/[platform]/page.tsx b/web/app/download/[platform]/page.tsxindex 90a867b3..086c88a9 100644--- a/web/app/download/[platform]/page.tsx+++ b/web/app/download/[platform]/page.tsx@@ -1,11 +1,26 @@import type { Metadata } from "next";import { notFound } from "next/navigation";+import CopyCommand from "../../components/copy-command";import GitHubStarButton from "../../components/github-star-button";import Halftone from "../../components/halftone";import { SiteFooter, SiteHeader } from "../../components/site-chrome";-import { DMG_FILE, WINDOWS_FILE } from "../../links";+import {+ DMG_FILE,+ INSTALL_SH,+ LINUX_ARM_DEB_FILE,+ LINUX_ARM_FILE,+ LINUX_DEB_FILE,+ LINUX_FILE,+ WINDOWS_FILE,+} from "../../links";-const files: Record<string, string> = { mac: DMG_FILE, windows: WINDOWS_FILE };+// `deb` is a second package for the same computer, offered under the main file; Linux pages (`host`) also explain the host.+const files: Record<string, { file: string; deb?: string; host?: boolean }> = {+ mac: { file: DMG_FILE },+ windows: { file: WINDOWS_FILE },+ linux: { file: LINUX_FILE, deb: LINUX_DEB_FILE, host: true },+ "linux-arm64": { file: LINUX_ARM_FILE, deb: LINUX_ARM_DEB_FILE, host: true },+};export const dynamicParams = false;@@ -18,8 +33,9 @@ export const metadata: Metadata = { title: "Thanks for downloading", robots: { i// The download starts by itself (meta refresh to the file keeps this page on screen) while we ask for a star.export default async function DownloadPage({ params }: { params: Promise<{ platform: string }> }) {const { platform } = await params;- const file = files[platform];- if (!file) notFound();+ const entry = files[platform];+ if (!entry) notFound();+ const { file, deb, host } = entry;return (<>@@ -43,7 +59,26 @@ export default async function DownloadPage({ params }: { params: Promise<{ platf<a href={file} className="text-neutral-300 underline underline-offset-4 transition hover:text-white">Try again</a>+ {deb && (+ <>+ {" · "}+ <a href={deb} className="text-neutral-300 underline underline-offset-4 transition hover:text-white">+ Prefer a .deb?+ </a>+ </>+ )}</p>+ {host && (+ <div className="mt-8 w-full max-w-lg text-left">+ <p className="text-sm text-neutral-500">+ On Linux the desktop app doesn't include the host. Install it too with this command, and if the+ AppImage won't start on Ubuntu, run <code className="text-neutral-300">sudo apt install libfuse2t64</code>.+ </p>+ <div className="mt-3">+ <CopyCommand command={INSTALL_SH} platform="linux" />+ </div>+ </div>+ )}</div></main><SiteFooter />diff --git a/web/app/links.ts b/web/app/links.tsindex 3124641f..e122f0ae 100644--- a/web/app/links.ts+++ b/web/app/links.ts@@ -1,8 +1,16 @@export const DMG_FILE = "https://github.com/leepokai/Codync/releases/latest/download/codync-macos.dmg";export const WINDOWS_FILE = "https://github.com/leepokai/Codync/releases/latest/download/codync-windows-x64.exe";+export const LINUX_FILE = "https://github.com/leepokai/Codync/releases/latest/download/codync-linux-x86_64.AppImage";+export const LINUX_ARM_FILE = "https://github.com/leepokai/Codync/releases/latest/download/codync-linux-arm64.AppImage";+export const LINUX_DEB_FILE = "https://github.com/leepokai/Codync/releases/latest/download/codync-linux-x86_64.deb";+export const LINUX_ARM_DEB_FILE = "https://github.com/leepokai/Codync/releases/latest/download/codync-linux-arm64.deb";+// Installs the host (and the CLI) on Linux; the AppImage desktop app does not include the host.+export const INSTALL_SH = "curl -fsSL https://raw.githubusercontent.com/leepokai/Codync/main/packaging/install.sh | sh";// Download buttons open a thank-you page that starts the file and asks for a star.export const DMG = "/download/mac";export const WINDOWS = "/download/windows";+export const LINUX = "/download/linux";+export const LINUX_ARM = "/download/linux-arm64";export const APP_STORE = "https://apps.apple.com/app/codync/id6760984418";export const GITHUB = "https://github.com/leepokai/Codync";export const DISCORD = "https://discord.gg/KBAX3Qznxh";