Add self-update command #37
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a new
self-updatecommand (withupdatealias) to the Context Generator CLI, allowing users to automatically update to the latest version without manually downloading the PHAR file.Features
Usage
Refactor GitHub API Interaction Architecture
This PR introduces a significant architectural improvement to how the context generator interacts with the GitHub API. The changes extract all API interactions into a dedicated client class, resulting in better separation of concerns, improved testability, and more maintainable code.
Key Changes
GithubClientInterfaceand implementation:HTTP Client Refactoring
Problem
Currently, several classes in our codebase need to check if HTTP client dependencies (PSR-18) are available before making HTTP requests. This creates unnecessary duplication and leaks implementation details across the system.
I've refactored the HTTP client implementation to follow better dependency injection principles and the Factory pattern:
HttpClientFactoryto centralize dependency checks and client instantiationNullHttpClient(Null Object pattern) that gracefully handles missing dependencies