Releases: kardolus/chatgpt-cli
ChatGPT CLI v1.7.10
This release introduces significant updates to the chatgpt-cli tool with enhanced support for image handling, improvements in configurability, and numerous optimizations in both performance and usability. Below are the detailed release notes outlining the major changes.
New Features
- Contextual Image Support:
- Enabled the ability to handle image inputs via context, supporting both URLs and local file paths to enhance data inputs for image queries.
- Code reference:
api/client/client.go
,cmd/chatgpt/main.go
Improvements
-
Query and Stream Functionality:
- Revised the Query and Stream methods to accept context, allowing better handling of timeouts, cancellations, and scoping.
- Code reference:
api/client/client.go
,cmd/chatgpt/main.go
-
Binary Data Handling Optimization:
- Redesigned the logic for handling binary data inputs to streamline operations and prevent adding unnecessary binary data to the command history.
- Code reference:
cmd/chatgpt/utils/utils.go
,cmd/chatgpt/utils/utils_test.go
Bug Fixes
- Error Management:
- Rectified issues with thread and history management, particularly in scenarios where specified threads do not exist or when clearing empty histories.
- Code reference:
config/store.go
,cmd/chatgpt/main.go
Other Changes
-
Code Refactoring:
- Consolidated and optimized import statements across several packages for better maintainability and performance.
- Code reference:
api/client/client_test.go
,cmd/chatgpt/utils/utils.go
-
Dependency Updates:
- Updated several Golang module dependencies to their latest versions, ensuring compatibility and leveraging improvements.
- Code reference:
go.mod
,go.sum
Upgrade Notes
To upgrade to this version, you can use the following methods:
- Homebrew: Run
brew upgrade chatgpt-cli
to update to the latest version. - Direct Download: Alternatively, download the updated binaries for your operating system directly
ChatGPT CLI v1.7.9
New Features:
- Binary Data Handling:
- Enhanced support for binary data input in the CLI. Input can now be piped as binary data, and the application will handle it appropriately.
- Code references:
api/client/client.go
,cmd/chatgpt/main.go
.
Improvements:
-
Image Handling Refactoring:
- Refactored image content handling for more efficient operations by introducing
createImageContentFromBinary
andcreateImageContentFromURLOrFile
functions. - Code reference:
api/client/client.go
.
- Refactored image content handling for more efficient operations by introducing
-
Utility Enhancements:
- Introduced a new
IsBinary
function for improved detection of binary data within the CLI. - Extended test coverage to ensure robustness.
- Code reference:
cmd/chatgpt/utils/utils.go
.
- Introduced a new
Bug Fixes:
- History Management:
- Fixed a bug where history was modified when binary data was provided to
ProvideContext
, ensuring history remains unchanged in this scenario. - Code reference:
api/client/client_test.go
.
- Fixed a bug where history was modified when binary data was provided to
Other Changes:
-
Dependency Updates:
- Upgraded
golang.org/x/exp
andgolang.org/x/sys
modules to newer versions. - Code references:
go.mod
,go.sum
.
- Upgraded
-
Testing and Linting Enhancements:
- Added checks to flag TODOs within the codebase as errors, encouraging cleaner code practices.
- Code reference:
scripts/all-tests.sh
.
Upgrade Notes:
- To upgrade to this version, you can use the command:
Alternatively, you can directly download the binaries specific to your operating system from the official repository.
brew upgrade chatgpt-cli
ChatGPT CLI v1.7.8
New Features:
- Image Support:
- Added the ability to upload images or provide image URLs using the
--image
flag. This feature enhances user interaction by allowing visual content to be processed in queries. - Note: Image support is model-dependent and may not be available for all models.
- Code references:
api/client/client.go
,cmd/chatgpt/main.go
- Added the ability to upload images or provide image URLs using the
Improvements:
-
CLI Enhancements:
- Updated the Makefile to provide better guidance on available commands for testing, building, and deployment.
- Improved context customization options through the configuration system.
- Code reference:
README.md
,cmd/chatgpt/main.go
,Makefile
-
Performance Optimizations:
- Refactored token counting functions and added better support for handling different data types within message content.
- Code references:
api/client/client.go
,api/completions.go
Bug Fixes:
- Content Handling Fixes:
- Corrected type assertions for message content to prevent runtime errors when handling JSON responses.
- Code references:
api/client/client.go
,history/manager.go
Other Changes:
-
Testing and Documentation Updates:
- Updated unit tests to cover new image support capabilities using mocks.
- Documentation refreshed to include instructions for using new image functionalities.
- Code references:
api/client/client_test.go
,docs/chatgpt_api.md
-
Dependency Updates:
- Updated several Go module dependencies for enhanced stability and performance.
- Code references:
go.mod
,go.sum
Upgrade Notes:
To upgrade to version v1.7.8, you can use one of the following options:
- Homebrew: Run
brew upgrade chatgpt-cli
if you installed via Homebrew. - Direct Download: Download the binaries directly from the GitHub releases page to match your operating system specifications.
ChatGPT CLI v1.7.7
New Features
- Added Command and Output Prompt Colors:
- Introduced the ability to set colors for the command and output prompts in interactive mode. Supported colors include "red", "green", "blue", "yellow", and "magenta".
- Code references: Updates in
README.md
and modifications incmd/chatgpt/main.go
andconfig/config.go
.
Improvements
-
System Role File Option:
- A new
--role-file
flag has been added to allow users to set the system role from a specified file, providing greater flexibility in configuring the chat application. - Code reference: Modifications in
cmd/chatgpt/main.go
.
- A new
-
Enhanced ANSI Color Handling:
- Implemented a new utility function
ColorToAnsi
that maps color names to ANSI escape codes, improving console color management. - Code reference:
cmd/chatgpt/utils/utils.go
added with corresponding tests incmd/chatgpt/utils/utils_test.go
.
- Implemented a new utility function
Bug Fixes
- No specific bug fixes were highlighted in this release.
Other Changes
-
Code Cleanup and Refactoring:
- Removed the
.idea/workspace.xml
andbin/chatgpt
files from the repository, improving overall repository hygiene. - Updated
.gitignore
to ensure proper exclusion of editor-specific files and build artifacts. - Code reference: Modifications in
.gitignore
and file deletions in.idea/workspace.xml
andbin/chatgpt
.
- Removed the
-
Dependency Updates:
- Upgraded
github.com/magiconair/properties
to v1.8.9 to maintain compatibility and security. - Code reference: Changes in
go.mod
andgo.sum
.
- Upgraded
Upgrade Notes
To upgrade to version v1.7.7, you can use one of the following methods:
-
Homebrew: Run the following command in your terminal:
brew upgrade chatgpt-cli
-
Direct Download: Alternatively, you can download the binaries for your specific operating system directly from the release page.
This release improves customization of the command-line interface by allowing prompt color settings, enhances command options for better usability, and maintains high code quality with essential cleanups and dependency updates.
ChatGPT CLI v1.7.6
Key Highlight
Support for o1 Models: We now support o1 prefixed models while maintaining full compatibility with GPT models, as well as Perplexity and Llama models. This enhancement ensures seamless integration with a broader range of models, offering more flexibility to users.
Code reference: api/client/client.go
New Features
Test Coverage Script: Introduced a new coverage script to generate combined coverage reports for unit, integration, and contract tests. The reports are now available in HTML format for easy visualization.
Code reference: scripts/coverage.sh
Improvements
- Enhanced .gitignore: Expanded .gitignore to cover a broader range of common directories and file types, ensuring a cleaner workspace by ignoring IDE/editor-specific configurations, system metadata, and temporary files.
- Code reference: .gitignore
- Performance Optimization in Client Struct: Improved the performance of the api/client package by optimizing how history messages are handled and enhancing response processing logic.
- Code reference: api/client/client.go
Bug Fixes
- Non-Empty Initial History Handling: Fixed an issue where the system failed to correctly append entries to an existing history. The logic has been improved to properly merge history entries.
- Code reference: api/client/client.go
- Model Filtering Enhancement: Corrected model filtering to ensure accurate identification and handling of both GPT and o1 prefixed models.
- Code reference: api/client/client.go
Other Changes
- Codebase Restructuring: Refactored the codebase to adopt a more consistent structure, improving maintainability and readability. This includes updates to core packages, configuration management, and utilities.
- Code references: Multiple files across api, config, history, and test directories.
- Dependency Updates: Updated dependencies and modules to improve security and compatibility.
- Code reference: go.mod, go.sum
Upgrade Notes
To update to v1.7.6, use the Homebrew package manager or download the binaries directly from the GitHub releases page. To upgrade via Homebrew, run:
brew upgrade chatgpt-cli
This release expands model compatibility, optimizes performance, enhances testing insights, and improves the codebase structure for a smoother development experience. Thank you for using ChatGPT CLI!
ChatGPT CLI v1.7.5
New Features:
- Deterministic Sampling with Seed Support: Introduced a configuration option to set a seed for deterministic sampling in the ChatGPT CLI. This feature is in beta and allows repeated requests with the same seed and parameters to return consistent results.
- Code reference:
README.md
,types/completions.go
,cmd/chatgpt/main.go
- Code reference:
Improvements:
- Refactored History Management: Enhanced the handling of message histories by refactoring data models to include timestamps. This improvement allows for better tracking and management of conversation history.
- Code reference:
client/client.go
,types/history.go
,history/history.go
- Code reference:
- Logging Enhancements: Improved test script logging to include timestamps, providing clearer insights into the execution timeline.
- Code reference:
scripts/all-tests.sh
- Code reference:
Bug Fixes:
- Improper Console Output Handling: Resolved issues where certain commands in the CLI did not handle console output correctly, ensuring that all output is now formatted and displayed as intended.
- Code reference:
cmd/chatgpt/main.go
- Code reference:
Other Changes:
- Updated Testing Framework: Upgraded from
github.com/onsi/gomega v1.34.2
tov1.35.1
, ensuring compatibility with recent updates and improvements.- Code reference:
go.mod
,go.sum
- Code reference:
- Consistent Use of Mock Timer in Tests: Integrated a mock timer into client tests to simulate and verify time dependencies.
- Code reference:
client/client_test.go
- Code reference:
Upgrade Notes:
- To upgrade to this version, use
brew upgrade chatgpt-cli
, or download the binaries directly for your operating system from the releases page.
ChatGPT CLI v1.7.4
New Features
- Conversation History Command (
--show-history
): Introduced a new command-line flag to display human-readable conversation history for the specified thread or the default thread if no argument is provided.- Code reference: cmd/chatgpt/main.go, history/history.go
Improvements
- Error Handling in Tests: Enhanced error output in integration tests to improve debugging efficiency by printing detailed error messages.
- Code reference: integration/integration_test.go
Bug Fixes
- Minor Typographical Error in README: Corrected a typographical error in the
README.md
to improve documentation clarity.- Code reference: README.md
Other Changes
- Makefile Cleanup: Removed the
run_test
target and its script to streamline the build process.- Code reference: Makefile
- Test Refactoring: Updated test assertions in
configmanager_test.go
to use GomegaExpect
for better readability and reliability.- Code reference: configmanager/configmanager_test.go
- Addition of Test Mocks: Added new mock generation for testing history functionalities to enhance test coverage and reliability.
- Code reference: history/historymocks_test.go
Upgrade Notes
To upgrade to version v1.7.4, you can use one of the following methods:
- Homebrew Upgrade: Run
brew upgrade chatgpt-cli
if you have installed the application via Homebrew. - Direct Download: Alternatively, you can download the latest binaries for your specific operating system from the releases page on our GitHub repository.
Ensure your development environment is consistent and up-to-date by following these recommendations.
ChatGPT CLI v1.7.3
New Features
- Multiline Input Mode: A new feature that enables multiline input in interactive sessions has been added. Users can toggle this mode via the
multiline
configuration setting, allowing for more complex queries and commands.- Code reference:
cmd/chatgpt/main.go
,types/config.go
- Code reference:
Improvements
-
Interactive Mode Output Customization: Enhanced the
command_prompt
andoutput_prompt
configurations to allow for more personalized interactive session displays.- Code reference:
cmd/chatgpt/main.go
- Code reference:
-
Markdown Rendering Capability: Added a script (
mdrender.sh
) for real-time markdown rendering, enhancing documentation readability in the CLI.- Code reference:
scripts/mdrender.sh
- Code reference:
-
Makefile Enhancements: Introduced a Makefile to automate common development tasks, streamlining test running, binary building, and dependency management.
- Code reference:
Makefile
,README.md
- Code reference:
Bug Fixes
-
Uncommitted Changes Check in Update Scripts: Modified update and build scripts to ensure there are no unstaged changes before running tests or updates, ensuring a clean working state.
- Code reference:
scripts/shipit.sh
,scripts/updatedeps.sh
- Code reference:
-
Corrected Use of Write Functions: Updated several
Write
function calls to handle errors and improve reliability.- Code reference:
integration/helpers_test.go
- Code reference:
Other Changes
-
Removed Deprecated Functions: Various unnecessary helper functions and outdated code logic were removed to clean up the codebase and improve maintainability.
- Code reference:
configmanager/configmanager_test.go
- Code reference:
-
Warnings for Missing Configuration Files: Added a warning message if
config.yaml
is absent whenOPENAI_CONFIG_HOME
is set, helping users to set up their environment correctly.- Code reference:
integration/integration_test.go
- Code reference:
Upgrade Notes
- This release includes several improvements and bug fixes that enhance functionality and user experience.
- To upgrade, you can use Homebrew by executing:
brew upgrade chatgpt-cli
- Alternatively, download the pre-built binaries directly for your operating system from the release page.
With this release, we aim to enhance usability and developer experience while ensuring more robust code practices. Please ensure that your configurations are up to date and take advantage of the new features and improvements.
ChatGPT CLI v1.7.2
New Features
- New
--new-thread
Flag: Added the--new-thread
flag to generate a new thread with a random name and automatically target it. This feature is particularly useful when using prompt files, allowing users to start fresh without the sticky history of previous interactions. It ensures that follow-up questions are isolated to the new thread. - Conflict Prevention for Thread Flags: Improved user experience by disallowing the simultaneous use of
--new-thread
with--thread
or--set-thread
flags. This ensures clarity in thread targeting, avoiding unexpected behavior when specifying a new thread and targeting another thread concurrently.
Enhancements
- Code Refactoring: Removed redundant
generateUniqueSlug
function from the client and centralized the logic inutils.GenerateUniqueSlug
, improving code maintainability. - Enhanced Integration Tests: Added integration tests to ensure proper validation of flag usage, particularly checking for conflicts between
--new-thread
,--thread
, and--set-thread
flags.
Integration Test Additions
- Added tests to ensure the CLI throws an error when:
--new-thread
is used with--set-thread
.--new-thread
is used with--thread
.
- These tests ensure that the command-line interface behaves as expected when conflicting flags are provided.
How to Update
Using Homebrew (macOS)
brew upgrade chatgpt-cli
Direct Download
For a quick and easy installation without compiling, you can directly download the pre-built binary for your operating system and architecture.
ChatGPT CLI v1.7.1
We're excited to announce the release of ChatGPT CLI v1.7.1! This version introduces a highly-requested feature that enhances how you interact with ChatGPT using prompt files. Additionally, this update includes several minor improvements and bug fixes to ensure a smoother experience.
🚀 New Feature: --prompt
Flag
Provide Rich Context with Prompt Files
With the new --prompt
flag, you can now use a file to provide detailed context for your conversations with ChatGPT. This feature allows for greater flexibility and ease when working with complex prompts or reusable context across different conversations.
How to use the --prompt
flag:
- Pass the path to your prompt file using the
--prompt
flag:chatgpt --prompt path/to/your/prompt.md "Your follow-up question here"
- This will read the contents of
prompt.md
and use it as the initial context for the conversation.
Example:
- A practical use case could be piping the output of a
git diff
command and using a prompt to guide the response:git diff | chatgpt --prompt ../prompts/write_pull-request.md
Check Out Our Prompt Repository
For a variety of ready-to-use prompts, visit our prompts repository. These examples can serve as great starting points or inspiration for your own custom prompts!
🛠 Improvements & Bug Fixes
- Enhanced command-line parsing to ensure better compatibility and user experience.
- Minor adjustments to error handling and debug output for improved usability.
- Updated documentation and help commands to reflect the new features.
How to Update
Using Homebrew (macOS)
brew upgrade chatgpt-cli
Direct Download
For a quick and easy installation without compiling, you can directly download the pre-built binary for your operating system and architecture.