Przeglądaj źródła

Added "Open docs" command to palette (#4915)

Co-authored-by: opencode-agent[bot] <opencode-agent[bot]@users.noreply.github.com>
Co-authored-by: rekram1-node <[email protected]>
opencode-agent[bot] 2 miesięcy temu
rodzic
commit
ae500ea01d
1 zmienionych plików z 10 dodań i 0 usunięć
  1. 10 0
      packages/opencode/src/cli/cmd/tui/app.tsx

+ 10 - 0
packages/opencode/src/cli/cmd/tui/app.tsx

@@ -30,6 +30,7 @@ import { TuiEvent } from "./event"
 import { KVProvider, useKV } from "./context/kv"
 import { Provider } from "@/provider/provider"
 import { ArgsProvider, useArgs, type Args } from "./context/args"
+import open from "open"
 
 async function getTerminalBackgroundColor(): Promise<"dark" | "light"> {
   // can't set raw mode if not a TTY
@@ -315,6 +316,15 @@ function App() {
       },
       category: "System",
     },
+    {
+      title: "Open docs",
+      value: "docs.open",
+      onSelect: () => {
+        open("https://opencode.ai/docs").catch(() => {})
+        dialog.clear()
+      },
+      category: "System",
+    },
     {
       title: "Exit the app",
       value: "app.exit",