feat: upgrade to Effect v4 beta and modernize CLI implementation#19
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 626ed09c15
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| Effect.catch((error: unknown) => { | ||
| if (CliError.isCliError(error)) { | ||
| return Console.error(error.message) | ||
| } | ||
| return Console.error(messageFromUnknown(error) ?? String(error)) |
There was a problem hiding this comment.
Preserve non-zero exit codes for CLI parse failures
This top-level Effect.catch converts every CliError into Console.error(...), which makes argument/usage failures succeed from the shell’s perspective. In practice, commands like sakuga render with no input or sakuga git --commits 0 README.md will print an error but exit with status 0, which breaks CI and scripts that rely on the process status. The previous entry point only swallowed a few specific parser errors; this now catches the entire CLI failure channel.
Useful? React with 👍 / 👎.
| const handle = yield* ChildProcess.make(GIT_BINARY, args, { | ||
| cwd, | ||
| stderr: "pipe", | ||
| stdin: "ignore", | ||
| stdout: "pipe", | ||
| }) |
There was a problem hiding this comment.
Wrap
ChildProcess.make failures in GitCommandFailed
runGitString() no longer maps failures from ChildProcess.make(...) itself, only the later stream/exit-code reads. If git is missing from PATH, the working directory has disappeared, or process spawn is otherwise denied, the failure escapes as a raw platform error. resolveGitRepoRoot() only recovers GitCommandFailed, and src/commands/git.ts only formats tagged git errors, so these cases bypass the intended user-facing diagnostics entirely.
Useful? React with 👍 / 👎.

This pull request upgrades the Effect ecosystem dependencies from version 3.x to 4.0.0-beta.33, which includes significant API changes and modernizations.
Key Changes:
effect@3.19.14toeffect@4.0.0-beta.33@effect/cli,@effect/platform, and@effect/platform-nodepackages to just@effect/platform-node@4.0.0-beta.33API Migrations:
CLI Framework: Migrated from
@effect/clito the new built-ineffect/unstable/climoduleArgs→ArgumentOptions→FlagCommand.run()now requires onlyversionparameter instead ofnameandversionPlatform Services:
@effect/platform/FileSystem→effect/FileSystem@effect/platform/Path→effect/PathNodeContext.layer→NodeServices.layerProcess Management: Replaced
@effect/platform/Commandwitheffect/unstable/process/ChildProcessfor better process control and type safetySchema Updates:
Schema.decodeUnknown()→Schema.decodeUnknownEffect()and updated JSON parsing patternsError Handling: Enhanced error handling with improved CLI error detection and more detailed error messages
Dependency Updates:
ioredissupport with related Redis dependenciesmime,undici,uuid, etc.) to newer versionsThe changes maintain backward compatibility in functionality while adopting the new Effect v4 patterns and improved type safety.