get your claude code tokens here
1#!/usr/bin/env bun
2
3const PORT = Number(Bun.env.PORT || 8787);
4
5async function open(url: string) {
6 const tryRun = async (cmd: string, ...args: string[]) => {
7 try {
8 await Bun.$`${[cmd, ...args]}`.quiet();
9 return true;
10 } catch {
11 return false;
12 }
13 };
14 if (process.platform === "darwin") {
15 if (await tryRun("open", url)) return;
16 } else if (process.platform === "win32") {
17 if (await tryRun("cmd", "/c", "start", "", url)) return;
18 } else {
19 if (await tryRun("xdg-open", url)) return;
20 }
21}
22
23await open(`http://localhost:${PORT}`);