Skip to content

Conversation

@galligan
Copy link
Contributor

@galligan galligan commented Jan 23, 2026

Summary

  • Add createCLI and command builder primitives for the CLI core.
  • Cover core wiring with unit tests.
  • Tighten CLI/command composition behavior.

Changes

  • packages/cli/src/cli.ts
  • packages/cli/src/command.ts
  • packages/cli/src/tests/core.test.ts

Testing

  • Not run (not requested).

Copy link
Contributor Author

galligan commented Jan 23, 2026

Warning

This pull request is not mergeable via GitHub because a downstack PR is open. Once all requirements are satisfied, merge this PR as a stack on Graphite.
Learn more

This stack of pull requests is managed by Graphite. Learn more about stacking.

@chatgpt-codex-connector
Copy link

You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard.
To continue using code reviews, add credits to your account and enable them for code reviews in your settings.

@greptile-apps
Copy link

greptile-apps bot commented Jan 23, 2026

Greptile Summary

  • Implements core CLI functionality by adding createCLI factory and CommandBuilder implementation to replace placeholder stubs with working Commander.js wrappers
  • Adds unit tests covering CLI creation, command registration, and basic wiring to establish foundational test coverage for the CLI package
  • Introduces error handling, exit override mechanics, and async parsing capabilities to ensure proper CLI lifecycle management

Important Files Changed

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.ts exit override logic and async error handling paths

Sequence Diagram

sequenceDiagram
    participant User
Loading

Copy link

@greptile-apps greptile-apps bot left a 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

Edit Code Review Agent Settings | Greptile


const register = (builder: CommandBuilder): CLI => {
program.addCommand(builder.build());
return cli;
Copy link

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

Suggested change
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.

@galligan galligan changed the base branch from p6/kit/scaffold to graphite-base/103 January 23, 2026 23:04
@galligan galligan changed the base branch from graphite-base/103 to p6/kit/scaffold January 23, 2026 23:12
@galligan
Copy link
Contributor Author

Fixed forward reference in \ by declaring \ before registering , then assigning after . Restacked and resubmitted.

@galligan
Copy link
Contributor Author

Correction: Fixed forward reference in packages/cli/src/cli.ts by declaring cli before registering onBeforeExit, then assigning after parse. Restacked and resubmitted.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants