ChatGPT CLI is an advanced command-line interface for ChatGPT models via OpenAI and Azure, offering streaming, query mode, and history tracking for seamless, context-aware conversations. Ideal for both users and developers, it provides advanced configuration and easy setup options to ensure a tailored conversational experience with the GPT model.
This PR introduces the ability to use dynamic variables in the command prompt for interactive mode in the ChatGPT CLI. The following variables have been added:
%date: The current date in the format YYYY-MM-DD.
%time: The current time in the format HH:MM:SS.
%datetime: The current date and time in the format YYYY-MM-DD HH:MM:SS.
%counter: The current counter value.
%usage: The current usage value.
Changes:
Updated the README to reflect the new variables.
Modified the main file to utilize the new FormatPrompt function for dynamic command prompts.
Added unit tests for the FormatPrompt function to ensure correctness.
Set the default command prompt to [datetime] [Qcounter] in the configuration store.
Implementation:
config/utils.go: Added FormatPrompt function to handle dynamic prompt formatting.
config/utils_test.go: Added unit tests for FormatPrompt.
cmd/chatgpt/main.go: Updated to use the FormatPrompt function.
config/store.go: Set the default command prompt to [datetime] [Qcounter].
README.md: Documented the new variables and updated the Table of Contents.
Summary:
This PR introduces the ability to use dynamic variables in the command prompt for interactive mode in the ChatGPT CLI. The following variables have been added:
%date
: The current date in the formatYYYY-MM-DD
.%time
: The current time in the formatHH:MM:SS
.%datetime
: The current date and time in the formatYYYY-MM-DD HH:MM:SS
.%counter
: The current counter value.%usage
: The current usage value.Changes:
FormatPrompt
function for dynamic command prompts.FormatPrompt
function to ensure correctness.[datetime] [Qcounter]
in the configuration store.Implementation:
config/utils.go
: AddedFormatPrompt
function to handle dynamic prompt formatting.config/utils_test.go
: Added unit tests forFormatPrompt
.cmd/chatgpt/main.go
: Updated to use theFormatPrompt
function.config/store.go
: Set the default command prompt to[datetime] [Qcounter]
.README.md
: Documented the new variables and updated the Table of Contents.