Skip to content

refactor(cli): convert pr command to effectCmd#25465

Merged
kitlangton merged 2 commits intodevfrom
kit/cli-effectify-pr
May 2, 2026
Merged

refactor(cli): convert pr command to effectCmd#25465
kitlangton merged 2 commits intodevfrom
kit/cli-effectify-pr

Conversation

@kitlangton
Copy link
Copy Markdown
Contributor

Summary

  • Convert cli/cmd/pr.ts from the legacy Promise-style cmd() wrapper to effectCmd.
  • Replace Instance.provide + AppRuntime.runPromise(Git.Service.use(...)) ceremony with an Effect-native handler that yields services directly.
  • Worktree + project info now come from InstanceRef instead of legacy Instance globals.
  • process.exit(1) paths flow through fail() → existing FormatError global handler.

Net: -36 lines, same behavior.

Test plan

  • bun run typecheck
  • bun run test test/cli/ — 137 pass
  • bun run src/index.ts pr shows correct yargs help / arg validation

Drops Instance.provide + AppRuntime.runPromise(Git.Service.use(...))
ceremony in favor of an Effect-native handler. process.exit(1) now flows
through fail() / FormatError. Worktree + project info come from
InstanceRef instead of legacy Instance globals.
Use Effect.die(new Error(...)) for the "opencode exited with code N" case
so the global FormatError sees a plain Error (not a CliError), matching
the original throw — exit code 1 with the "Unexpected error" banner —
instead of inheriting the subprocess's exit code.
Bojun-Vvibe added a commit to Bojun-Vvibe/oss-contributions that referenced this pull request May 2, 2026
@kitlangton kitlangton merged commit 8396d6b into dev May 2, 2026
10 checks passed
@kitlangton kitlangton deleted the kit/cli-effectify-pr branch May 2, 2026 21:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant