-
Notifications
You must be signed in to change notification settings - Fork 0
fix(cli): implement createCLI and command builder #103
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: p6/kit/scaffold
Are you sure you want to change the base?
Conversation
8188ebf to
bde2b19
Compare
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Greptile Summary
|
| Filename | Overview |
|---|---|
| packages/cli/src/cli.ts | Implements complete createCLI factory with error handling, exit override logic, and async parsing capabilities |
| packages/cli/src/command.ts | Replaces stub with full CommandBuilderImpl providing fluent API for typed Commander.js command construction |
Confidence score: 4/5
- This PR is safe to merge with minimal risk as it implements well-structured foundational CLI functionality
- Score reflects solid implementation with proper error handling, but complex async parsing logic and Commander.js integration could benefit from more comprehensive testing
- Pay close attention to
packages/cli/src/cli.tsexit override logic and async error handling paths
Sequence Diagram
sequenceDiagram
participant User
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
3 files reviewed, 1 comment
|
|
||
| const register = (builder: CommandBuilder): CLI => { | ||
| program.addCommand(builder.build()); | ||
| return cli; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
logic: Forward reference to cli before it's declared - this should reference the return value after it's created
| return cli; | |
| program.addCommand(builder.build()); | |
| return { program, register, parse }; |
Prompt To Fix With AI
This is a comment left during a code review.
Path: packages/cli/src/cli.ts
Line: 75:75
Comment:
**logic:** Forward reference to `cli` before it's declared - this should reference the return value after it's created
```suggestion
program.addCommand(builder.build());
return { program, register, parse };
```
How can I resolve this? If you propose a fix, please make it concise.bde2b19 to
cd7f5ae
Compare
83ce548 to
72c9b90
Compare
|
Fixed forward reference in \ by declaring \ before registering , then assigning after . Restacked and resubmitted. |
|
Correction: Fixed forward reference in |

Summary
createCLIand command builder primitives for the CLI core.Changes
Testing