MCPcopy Index your code
hub / github.com/anomalyco/opencode / share

Function share

packages/opencode/src/cli/cmd/run.ts:535–548  ·  view source on GitHub ↗
(sdk: OpencodeClient, sessionID: string)

Source from the content-addressed store, hash-verified

533 }
534
535 async function share(sdk: OpencodeClient, sessionID: string) {
536 const cfg = await sdk.config.get()
537 if (!cfg.data) return
538 if (cfg.data.share !== "auto" && !flags.autoShare && !args.share) return
539 const res = await sdk.session.share({ sessionID }).catch((error) => {
540 if (error instanceof Error && error.message.includes("disabled")) {
541 UI.println(UI.Style.TEXT_DANGER_BOLD + "! " + error.message)
542 }
543 return { error }
544 })
545 if (!res.error && "data" in res && res.data?.share?.url) {
546 UI.println(UI.Style.TEXT_INFO_BOLD + "~ " + res.data.share.url)
547 }
548 }
549
550 async function createFreshSession(
551 sdk: OpencodeClient,

Callers 3

createFreshSessionFunction · 0.70
executeFunction · 0.70
session.tsFile · 0.50

Calls 2

getMethod · 0.65
shareMethod · 0.45

Tested by

no test coverage detected