Release standalone binaries with a one-line installer

Installing meant Bun, a clone with the T3 Code submodule and a build. Now
a tag builds a binary per platform with bun build --compile, carrying
Bun's runtime and OpenTUI's native library, and publishes them as a
GitHub Release after opening each one's dashboard on its own OS.

install.sh picks the right binary and checks it against SHA256SUMS;
`t3tui upgrade` replaces an installed binary with the latest release and
`t3tui version` prints the version. `t3tui tmux` started its windows as
`bun <file>`, which a compiled binary can't do, so it now runs itself.
This commit is contained in:
callumalpass committed 2026-11-03 02:48:57 +11:00
1 parent c0b7615590
commit 9bf9abb540
10 files changed
+319 -2

No files matched your search

+12 -1
View File
@@ -3,6 +3,7 @@ import type { OrchestrationV2ShellSnapshot, ThreadId } from "@t3tools/contracts"
import { migrateConfigDir } from "./client/auth.ts";
import { T3Session } from "./client/session.ts";
import { isCompiled, upgrade, VERSION } from "./upgrade.ts";
import { findThread, lastActivity, relativeTime, rowTime, shortId, statusLabel, threadRows } from "./model/threads.ts";
const USAGE = `t3tui: a terminal client for T3 Code
@@ -13,6 +14,8 @@ usage:
t3tui list [--json] print threads and exit
t3tui tmux [--watch] [--session <name>]
mirror active threads into tmux windows (default session: t3tui)
t3tui upgrade replace this binary with the latest release
t3tui version
t3tui help
env:
@@ -35,6 +38,13 @@ async function main(argv: string[]) {
return list(rest.includes("--json"));
case "tmux":
return tmuxCommand(rest);
case "upgrade":
return upgrade();
case "version":
case "--version":
case "-v":
console.log(`t3tui ${VERSION}`);
return;
case "help":
case "--help":
case "-h":
@@ -83,7 +93,8 @@ async function tmuxCommand(args: string[]) {
const sessionFlag = args.indexOf("--session");
const name = sessionFlag >= 0 ? args[sessionFlag + 1] : "t3tui";
if (!name) return fail("usage: t3tui tmux [--watch] [--session <name>]");
const options = { session: name, t3tui: [process.execPath, import.meta.path] };
// A compiled binary is t3tui by itself; otherwise it's Bun running this file.
const options = { session: name, t3tui: isCompiled() ? [process.execPath] : [process.execPath, import.meta.path] };
const { session, snapshot } = await connectedSession();
const { opened } = await syncTmux(snapshot, options);
console.log(`tmux session "${name}" is in sync (${opened} new window${opened === 1 ? "" : "s"}). Attach with: tmux attach -t ${name}`);