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

Function current

packages/opencode/src/cli/cmd/run.ts:578–593  ·  view source on GitHub ↗
(sdk: OpencodeClient)

Source from the content-addressed store, hash-verified

576 }
577
578 async function current(sdk: OpencodeClient): Promise<string> {
579 if (!args.attach) {
580 return directory ?? root
581 }
582
583 const next = await sdk.path
584 .get()
585 .then((x) => x.data?.directory)
586 .catch(() => undefined)
587 if (next) {
588 return next
589 }
590
591 UI.error("Failed to resolve remote directory")
592 process.exit(1)
593 }
594
595 async function localAgent() {
596 if (!args.agent) return undefined

Callers 3

executeFunction · 0.70
RunFooterSubagentBodyFunction · 0.50
repo.tsFile · 0.50

Calls 1

getMethod · 0.65

Tested by

no test coverage detected