summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDax Raad <[email protected]>2025-06-19 14:21:00 -0400
committerDax Raad <[email protected]>2025-06-19 14:21:00 -0400
commitec1c9f8cd14e2359816dbe0a9003e244023a0b53 (patch)
treed9cd36be8123e18cd75ab4660981e0709b1740bc
parenta85b0a370ec02068b8dfced63f5c21ba9fdbfa07 (diff)
downloadopencode-ec1c9f8cd14e2359816dbe0a9003e244023a0b53.tar.gz
opencode-ec1c9f8cd14e2359816dbe0a9003e244023a0b53.zip
use production share url
-rw-r--r--opencode.json1
-rw-r--r--packages/opencode/script/postinstall.mjs4
-rw-r--r--packages/opencode/src/cli/cmd/run.ts3
-rw-r--r--packages/opencode/src/installation/index.ts4
-rw-r--r--packages/opencode/src/share/share.ts6
-rw-r--r--packages/opencode/src/tool/websearch.txt2
6 files changed, 15 insertions, 5 deletions
diff --git a/opencode.json b/opencode.json
index 8f9b80710..d69947d23 100644
--- a/opencode.json
+++ b/opencode.json
@@ -1,4 +1,5 @@
{
"$schema": "https://opencode.ai/config.json",
+ "keybinds": {},
"mcp": {}
}
diff --git a/packages/opencode/script/postinstall.mjs b/packages/opencode/script/postinstall.mjs
index 7bf119269..650aa66a2 100644
--- a/packages/opencode/script/postinstall.mjs
+++ b/packages/opencode/script/postinstall.mjs
@@ -80,9 +80,9 @@ function main() {
// Create symlink to the actual binary
fs.symlinkSync(binaryPath, binScript)
- console.log(`OpenCode binary symlinked: ${binScript} -> ${binaryPath}`)
+ console.log(`opencode binary symlinked: ${binScript} -> ${binaryPath}`)
} catch (error) {
- console.error("Failed to create OpenCode binary symlink:", error.message)
+ console.error("Failed to create opencode binary symlink:", error.message)
process.exit(1)
}
}
diff --git a/packages/opencode/src/cli/cmd/run.ts b/packages/opencode/src/cli/cmd/run.ts
index 24b51852c..cf3937ce7 100644
--- a/packages/opencode/src/cli/cmd/run.ts
+++ b/packages/opencode/src/cli/cmd/run.ts
@@ -20,11 +20,12 @@ const TOOL: Record<string, [string, string]> = {
list: ["List", UI.Style.TEXT_INFO_BOLD],
read: ["Read", UI.Style.TEXT_HIGHLIGHT_BOLD],
write: ["Write", UI.Style.TEXT_SUCCESS_BOLD],
+ websearch: ["Search", UI.Style.TEXT_MUTED_BOLD],
}
export const RunCommand = cmd({
command: "run [message..]",
- describe: "Run OpenCode with a message",
+ describe: "Run opencode with a message",
builder: (yargs: Argv) => {
return yargs
.positional("message", {
diff --git a/packages/opencode/src/installation/index.ts b/packages/opencode/src/installation/index.ts
index e7528bcdf..bb2626eec 100644
--- a/packages/opencode/src/installation/index.ts
+++ b/packages/opencode/src/installation/index.ts
@@ -41,6 +41,10 @@ export namespace Installation {
return VERSION.startsWith("0.0.0")
}
+ export function isDev() {
+ return VERSION === "dev"
+ }
+
export async function method() {
if (process.execPath.includes(path.join(".opencode", "bin"))) return "curl"
const exec = process.execPath.toLowerCase()
diff --git a/packages/opencode/src/share/share.ts b/packages/opencode/src/share/share.ts
index 8605644c3..d47abd885 100644
--- a/packages/opencode/src/share/share.ts
+++ b/packages/opencode/src/share/share.ts
@@ -1,5 +1,6 @@
import { App } from "../app/app"
import { Bus } from "../bus"
+import { Installation } from "../installation"
import { Session } from "../session"
import { Storage } from "../storage/storage"
import { Log } from "../util/log"
@@ -56,7 +57,10 @@ export namespace Share {
}
export const URL =
- process.env["OPENCODE_API"] ?? "https://api.dev.opencode.ai"
+ process.env["OPENCODE_API"] ??
+ (Installation.isSnapshot() || Installation.isDev()
+ ? "https://api.dev.opencode.ai"
+ : "https://api.opencode.ai")
export async function create(sessionID: string) {
return fetch(`${URL}/share_create`, {
diff --git a/packages/opencode/src/tool/websearch.txt b/packages/opencode/src/tool/websearch.txt
index ce119d28f..09d2eaa26 100644
--- a/packages/opencode/src/tool/websearch.txt
+++ b/packages/opencode/src/tool/websearch.txt
@@ -1,5 +1,5 @@
-- Allows OpenCode to search the web and use the results to inform responses
+- Allows opencode to search the web and use the results to inform responses
- Provides up-to-date information for current events and recent data
- Returns search result information formatted as search result blocks
- Use this tool for accessing information beyond Claude's knowledge cutoff