server and settings setup
This commit is contained in:
+12
-10
@@ -6,6 +6,7 @@ import (
|
||||
"fmt"
|
||||
"os"
|
||||
"os/exec"
|
||||
"strings"
|
||||
|
||||
"g.fc.run/ai/byre/internal/tailscale"
|
||||
)
|
||||
@@ -21,6 +22,7 @@ type check struct {
|
||||
Need string `json:"need"`
|
||||
For string `json:"for"`
|
||||
OK bool `json:"ok"`
|
||||
Command string `json:"command"`
|
||||
Fix string `json:"fix"`
|
||||
Blocking bool `json:"blocking"`
|
||||
}
|
||||
@@ -29,16 +31,16 @@ func checks() []check {
|
||||
return []check{
|
||||
gitCheck(),
|
||||
tailscaleCheck(),
|
||||
command("claude", needAgent, "Claude models", "curl -fsSL https://claude.ai/install.sh | bash, then run claude once to sign in"),
|
||||
command("codex", needAgent, "GPT models", "brew install --cask codex, then run codex once to sign in"),
|
||||
command("agy", needAgent, "Gemini models", "brew install --cask antigravity-cli, then run agy once to sign in"),
|
||||
command("npx", needOptional, "reviewers' Playwright browser tools", "brew install node"),
|
||||
command("claude", needAgent, "Claude models", "curl -fsSL https://claude.ai/install.sh | bash", "Then run claude once to sign in."),
|
||||
command("codex", needAgent, "GPT models", "brew install --cask codex", "Then run codex once to sign in."),
|
||||
command("agy", needAgent, "Gemini models", "brew install --cask antigravity-cli", "Then run agy once to sign in."),
|
||||
command("npx", needOptional, "reviewers' Playwright browser tools", "brew install node", ""),
|
||||
appCheck("Google Chrome", needOptional, "browser tools for agents and reviewers", "brew install --cask google-chrome"),
|
||||
}
|
||||
}
|
||||
|
||||
func gitCheck() check {
|
||||
c := check{Name: "git", Need: needRequired, For: "worktrees, snapshots and merges", Fix: "xcode-select --install"}
|
||||
c := check{Name: "git", Need: needRequired, For: "worktrees, snapshots and merges", Command: "xcode-select --install"}
|
||||
path, err := exec.LookPath("git")
|
||||
// /usr/bin/git is a stub that offers to install the Command Line Tools when they're missing.
|
||||
c.OK = err == nil && (path != "/usr/bin/git" || exec.Command("xcode-select", "-p").Run() == nil)
|
||||
@@ -50,14 +52,14 @@ func tailscaleCheck() check {
|
||||
return check{Name: "Tailscale", Need: needRequired, For: "the server's HTTPS address and identity", OK: problem == "", Fix: problem}
|
||||
}
|
||||
|
||||
func command(name, need, purpose, fix string) check {
|
||||
func command(name, need, purpose, install, fix string) check {
|
||||
_, err := exec.LookPath(name)
|
||||
return check{Name: name, Need: need, For: purpose, OK: err == nil, Fix: fix}
|
||||
return check{Name: name, Need: need, For: purpose, OK: err == nil, Command: install, Fix: fix}
|
||||
}
|
||||
|
||||
func appCheck(name, need, purpose, fix string) check {
|
||||
func appCheck(name, need, purpose, install string) check {
|
||||
_, err := os.Stat("/Applications/" + name + ".app")
|
||||
return check{Name: name, Need: need, For: purpose, OK: err == nil, Fix: fix}
|
||||
return check{Name: name, Need: need, For: purpose, OK: err == nil, Command: install}
|
||||
}
|
||||
|
||||
func markBlocking(cs []check) bool {
|
||||
@@ -94,7 +96,7 @@ func requireChecks() {
|
||||
fmt.Println("byre can't run on this Mac yet. It needs git, Tailscale, and at least one of claude, codex and agy:")
|
||||
for _, c := range cs {
|
||||
if c.Blocking {
|
||||
fmt.Printf(" %s: %s\n", c.Name, c.Fix)
|
||||
fmt.Printf(" %s: %s\n", c.Name, strings.TrimSpace(c.Command+" "+c.Fix))
|
||||
}
|
||||
}
|
||||
os.Exit(1)
|
||||
|
||||
Reference in New Issue
Block a user