import "./index.css" import { Meta, Title } from "@solidjs/meta" import { A } from "@solidjs/router" import { createSignal, type JSX, onMount, Show } from "solid-js" import { Faq } from "~/component/faq" import { Footer } from "~/component/footer" import { Header } from "~/component/header" import { IconCheck, IconCopy } from "~/component/icon" import { Legal } from "~/component/legal" import { LocaleLinks } from "~/component/locale-links" import { config } from "~/config" import { useI18n } from "~/context/i18n" import { useLanguage } from "~/context/language" import desktopAppIcon from "../../asset/lander/opencode-desktop-icon.png" import type { DownloadPlatform } from "./types" type OS = "macOS" | "Windows" | "Linux" | null function detectOS(): OS { if (typeof navigator === "undefined") return null const platform = navigator.platform.toLowerCase() const userAgent = navigator.userAgent.toLowerCase() if (platform.includes("mac") || userAgent.includes("mac")) return "macOS" if (platform.includes("win") || userAgent.includes("win")) return "Windows" if (platform.includes("linux") || userAgent.includes("linux")) return "Linux" return null } function getDownloadPlatform(os: OS): DownloadPlatform { switch (os) { case "macOS": return "darwin-aarch64-dmg" case "Windows": return "windows-x64-nsis" case "Linux": return "linux-x64-deb" default: return "darwin-aarch64-dmg" } } function getDownloadHref(platform: DownloadPlatform, channel: "stable" | "beta" = "stable") { return `/download/${channel}/${platform}` } function IconDownload(props: JSX.SvgSVGAttributes) { return ( ) } function CopyStatus() { return ( ) } export default function Download() { const i18n = useI18n() const language = useLanguage() const [detectedOS, setDetectedOS] = createSignal(null) onMount(() => { setDetectedOS(detectOS()) }) const handleCopyClick = (command: string) => (event: Event) => { const button = event.currentTarget as HTMLButtonElement navigator.clipboard.writeText(command) button.setAttribute("data-copied", "") setTimeout(() => { button.removeAttribute("data-copied") }, 1500) } return (
{i18n.t("download.title")}

{i18n.t("download.hero.title")}

{i18n.t("download.hero.subtitle")}

{i18n.t("download.hero.button", { os: detectedOS()! })}
[1] {i18n.t("download.section.terminal")}
[2] {i18n.t("download.section.desktop")}
{i18n.t("download.platform.macosAppleSilicon")}
{i18n.t("download.action.download")}
{i18n.t("download.platform.macosIntel")}
{i18n.t("download.action.download")}
{i18n.t("download.platform.windowsX64")}
{i18n.t("download.action.download")}
{i18n.t("download.platform.linuxDeb")}
{i18n.t("download.action.download")}
{i18n.t("download.platform.linuxRpm")}
{i18n.t("download.action.download")}
{/* Disabled temporarily as it doesn't work */} {/*
Linux (.AppImage)
Download
*/}
[3] {i18n.t("download.section.extensions")}
[4] {i18n.t("download.section.integrations")}

{i18n.t("common.faq")}

) }