all: support popping a browser from termui
- Add 'browser', 'open', and 'b' command aliases to termui
- Open the current conversation URL in default browser
- Add help documentation for the new command
Add browser launch endpoint to Git server for Docker support.
We'll probably want to set up a proper mux for the no-longer-just-git
server pretty soon.
Co-Authored-By: sketch <hello@sketch.dev>
diff --git a/termui/termui.go b/termui/termui.go
index 40e76b7..e6e5b4e 100644
--- a/termui/termui.go
+++ b/termui/termui.go
@@ -195,6 +195,7 @@
- help, ? : Show this help message
- budget : Show original budget
- usage, cost : Show current token usage and cost
+- browser, open, b : Open current conversation in browser
- stop, cancel, abort : Cancel the current operation
- exit, quit, q : Exit sketch
- ! <command> : Execute a shell command (e.g. !ls -la)`)
@@ -208,6 +209,13 @@
ui.AppendSystemMessage("- Max wall time: %v", originalBudget.MaxWallTime)
}
ui.AppendSystemMessage("- Max total cost: %0.2f", originalBudget.MaxDollars)
+ case "browser", "open", "b":
+ if ui.httpURL != "" {
+ ui.AppendSystemMessage("🌐 Opening %s in browser", ui.httpURL)
+ go ui.agent.OpenBrowser(ui.httpURL)
+ } else {
+ ui.AppendSystemMessage("❌ No web URL available for this session")
+ }
case "usage", "cost":
totalUsage := ui.agent.TotalUsage()
ui.AppendSystemMessage("💰 Current usage summary:")