Adds theme package for better color management. Fixes invalid Go version. by scalvert · Pull Request #4 · gleanwork/glean-cli
Summary
This pull request includes several significant changes to the cmd/chat.go and cmd/search.go files to improve the code structure, remove unused imports, and enhance the chat and search functionalities. The changes include refactoring functions, modifying imports, and updating templates for better readability and maintainability.
Chat command improvements:
- Removed unused imports and added a new import for
themeincmd/chat.go. - Introduced a new
ChatStatestruct to hold the state for processing chat responses, improving the organization of state management. - Refactored the
executeChatfunction to separate the chat request sending (sendChatRequest) and response processing (processChatResponse) into distinct functions. [1] [2] [3] - Replaced the
greenCheckfunction withtheme.Bluefor consistent theming in chat stage formatting.
Search command improvements:
- Removed unused imports and added a new import for
themeincmd/search.go. - Updated the default template for search results to use
themefunctions for consistent styling. [1] [2] - Simplified the
runSearchfunction by removing unnecessary comments and organizing flag handling and options setting. [1] [2] [3] [4] - Replaced inline color functions with
theme.TemplateFuncsto centralize color handling and improve maintainability.
General improvements:
- Removed unused dependencies from
go.modto clean up the project dependencies.