Releases: kardolus/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.
ChatGPT CLI v1.7.0
We're excited to announce the release of ChatGPT CLI v1.7.0! This update introduces significant improvements in configuration handling, enhances flexibility in user input, and includes a few important bug fixes and enhancements.
🚀 Key Changes & Improvements
Enhanced Configuration Handling with Viper & Cobra
- Command-Line Setters & Runtime Flags for Configuration:
- Each configuration value now has a dedicated command-line setter and a corresponding runtime flag. This means you can easily update settings like the model, max tokens, or API key on the fly, either persistently or temporarily.
- For example, use
--set-model <model-name>
to update the default model permanently, or--model <model-name>
to apply the change only for the current session.
- Improved Flag Syncing:
- We've refactored how the CLI handles flag configuration using
viper
andcobra
. The new approach ensures that changes to command-line flags are properly synced withviper
's internal state. - The CLI now consistently respects the configuration precedence order of Environment Variables > Config File > Default Values.
- This overhaul simplifies configuration management, reducing the need for custom parsing logic and making the code more maintainable.
- We've refactored how the CLI handles flag configuration using
- More Robust Flag Management:
- The CLI now defines flags dynamically based on a configuration metadata structure, making it easier to add new configurable options in the future.
- Improved handling of command aliases ensures that both full and short versions of flags are correctly interpreted.
Enhanced Input Handling
- Support for Piped Input:
- This release improves the behavior of the CLI when handling piped input without explicitly specifying a query. Previously, if you provided input through a pipe but did not set a query, the CLI would error out.
- With the new changes, the CLI now correctly detects non-empty piped input and uses it as context without requiring a direct query. If no context or query is provided, an error is returned, maintaining user feedback clarity.
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.6.8
New Features
- Clear Command in Interactive Mode: You can now use the
clear
command in interactive mode to clear the screen, making it easier to manage long sessions. Simply typeclear
and press Enter to refresh the screen, leaving only the command prompt at the top. - Improved User Instructions: The instructions for interactive mode have been updated to include the new
clear
command alongsideexit
and/q
, providing users with clear guidance for managing their sessions.
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.6.7
Key Updates
1. Refactor to Support Custom Config and Data Directories
In this release, we've introduced support for overriding the default paths for configuration and data directories using environment variables. This is particularly useful for users who prefer to manage their settings and data in non-default locations. The following environment variables are now supported:
OPENAI_CONFIG_HOME
: Defines a custom path for configuration files (e.g.,config.yaml
). Default is~/.chatgpt-cli
.OPENAI_DATA_HOME
: Defines a custom path for storing data, including chat history. Default is~/.chatgpt-cli/history
.
2. Enhanced Directory Management
The internal logic for retrieving default directories has been refactored. The previous methods such as GetHistoryDir
and GetChatGPTDirectory
have been replaced with clearer naming and paths:
GetConfigHome
: Retrieves the configuration home directory.GetDataHome
: Retrieves the data home directory (for history storage).
3. Improved Integration Test Setup
We've improved the integration testing setup by ensuring that any pre-existing environment variables related to config and data directories (OPENAI_CONFIG_HOME
, OPENAI_DATA_HOME
) are unset before running tests. This guarantees a clean and isolated test environment, making the tests more reliable and predictable.
4. Migration Handling
The legacy history migration logic has been enhanced to ensure smooth transitions when moving from older versions of the CLI to v1.6.7. If the legacy history file exists, it will be migrated to the new directory structure, ensuring all your existing conversation history is preserved.
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.6.6
Features and Improvements:
-
Output Prompt Configuration:
You can now customize the output prompt in interactive mode using theoutput_prompt
configuration setting. This allows you to prepend custom text or formatting to the AI’s response.Example configuration:
output_prompt: '\nhi there: '
This example will display:
hi there: <response>
Bug Fixes and Internal Changes:
-
Fixed Newline Escaping:
In the command prompt,\\n
is now correctly replaced with an actual newline during execution, allowing multi-line output prompts. -
Code Refactoring:
- Minor adjustments to prompt handling in interactive mode.
- Internal tests have been added to ensure correct behavior of the newline replacement in the output prompt.
Documentation:
- Updated the README to include the new
output_prompt
configuration option.
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.6.5
New Features
- TLS Certificate Verification Control:
- Introduced a new configuration option,
skip_tls_verify
, to allow users to skip TLS certificate verification for HTTPS requests. - By default, this option is set to
false
to ensure secure communication. Users can enable it to bypass certificate validation in environments with self-signed certificates or for development purposes.
- Introduced a new configuration option,
Enhancements
- Compatibility Update:
- ChatGPT CLI is now Tested and Compatible with OpenAI ChatGPT, Azure OpenAI Service, Perplexity AI, and Llama.
Bug Fixes
- Fixed several configuration tests in
configmanager_test.go
to account for the newskip_tls_verify
setting, ensuring proper behavior for environment variable overrides and user-defined configurations.
This version brings enhanced flexibility for certificate management and broadens compatibility with more AI services!
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.