Practical phased replacement of Bun $ calls.
Replace runtime Bun shell template-tag usage in packages/opencode/src with a unified Process API in util/process.ts.
Keep behavior stable while improving safety, testability, and observability.
Current baseline from audit:
src/cli/cmd/github.ts (33)src/worktree/index.ts (22)src/lsp/server.ts (21)src/installation/index.ts (20)src/snapshot/index.ts (18)src/util/process.ts (do not create a separate exec module).$ compatibility in 1.x and remove in 2.0.$ compatibility in this effort.src/session/prompt.ts raw command executionsrc/worktree/index.tssrc/util/process.ts)Add higher-level wrappers on top of current spawn support.
Core methods:
Process.run(cmd, opts)Process.text(cmd, opts)Process.lines(cmd, opts)Process.status(cmd, opts)Process.shell(command, opts) for intentional shell executionGit helpers:
Process.git(args, opts)Process.gitText(args, opts)Shared options:
cwd, env, stdin, stdout, stderr, abort, timeout, killallowFailure / non-throw modeStandard result shape:
code, stdout, stderr, duration_ms, cmdtext() and arrayBuffer() where usefulsrc/util/process.ts.src/util/git.ts to use Process only.Migrate these first:
src/cli/cmd/github.tssrc/worktree/index.tssrc/lsp/server.tssrc/installation/index.tssrc/snapshot/index.tsWithin each file, migrate git paths first where applicable.
Migrate git-centric call sites to Process.git* helpers:
src/file/index.tssrc/project/vcs.tssrc/file/watcher.tssrc/storage/storage.tssrc/cli/cmd/pr.tsMigrate residual non-git usages:
src/cli/cmd/tui/util/clipboard.tssrc/util/archive.tssrc/file/ripgrep.tssrc/tool/bash.tssrc/cli/cmd/uninstall.ts$ compatibility isolated and documented as temporary.$ removal.Process methods and options.$ usage in packages/opencode/src is removed except:
Process.git* consistently.$ removal.