luigidemasi opened a new issue, #63:
URL: https://github.com/apache/camel-kit/issues/63

   > Imported from 
[luigidemasi/camel-kit#107](https://github.com/luigidemasi/camel-kit/issues/107),
 opened by [luigidemasi](https://github.com/luigidemasi) on 2026-06-25.
   > Closed by 
[luigidemasi/camel-kit#115](https://github.com/luigidemasi/camel-kit/pull/115), 
merged on 2026-06-26.
   
   ---
   
   ## Description
   
   `InitCommand` and `DoctorCommand` mix Picocli command handling, workflow 
orchestration, filesystem operations, validation, terminal output, and recovery 
guidance. This makes the command classes large and harder to reuse from other 
entry points such as the JBang plugin.
   
   Relevant files:
   - 
`camel-kit-core/src/main/java/io/github/luigidemasi/camelkit/command/InitCommand.java`
   - 
`camel-kit-core/src/main/java/io/github/luigidemasi/camelkit/command/DoctorCommand.java`
   - 
`camel-kit-core/src/main/java/io/github/luigidemasi/camelkit/command/DoctorExpectations.java`
   - 
`camel-jbang-plugin-kit/src/main/java/io/github/luigidemasi/camelkit/jbang/`
   
   ## Expected Behavior
   
   Picocli command classes should primarily parse options and render results. 
Business logic should live in reusable services.
   
   Suggested shape:
   
   - `InitService` executes project initialization from an `InitRequest`.
   - `InitResult` contains created paths, detected runtime, graph summary, 
warnings, and errors.
   - `DoctorService` inspects a workspace from a `DoctorRequest`.
   - `DoctorResult` contains structured findings.
   - CLI classes convert requests/results to terminal or JSON output.
   
   ## Additional Context
   
   This is not intended to change user-facing behavior. It should make the code 
easier to test and reuse.
   
   An incremental path:
   
   1. Extract `DoctorService` first because it already has structured `Finding` 
concepts.
   2. Extract `InitService` after stabilizing request/result objects.
   3. Keep Picocli option names and output behavior unchanged.
   
   ## Acceptance Criteria
   
   - `DoctorCommand` delegates validation to a service and keeps output 
formatting in the command layer.
   - `InitCommand` delegates initialization work to a service and keeps CLI/TUI 
wiring in the command layer.
   - Existing command tests continue to pass.
   - Add focused service tests for success and failure paths.
   - JBang plugin behavior remains unchanged.
   
   ## Validation
   
   Run:
   
   `./mvnw -pl camel-kit-core,camel-jbang-plugin-kit test -Dformat.skip=true`
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to