I have issued an update to my CLI ChatGPT Client (see when I first announced it) so that you can now resume conversations. Here is the new
--help output (I personally have an
alias cgt=path/to/chat.php to have it quickly available):
Usage: chat.php [-l] [-r [number]] [-s system_prompt] [conversation_input] Options: -l Resume last conversation. -r [number] Resume a previous conversation and list 'number' conversations (default: 10). -s [system_prompt] Specify a system prompt preceeding the conversation. Arguments: conversation_input Input for the first conversation. Notes: - To input multiline messages, send an empty message. - To end the conversation, enter "bye". Example usage: chat.php -l Resumes the last conversation. chat.php -r 5 Resume a conversation and list the last 5 to choose from. chat.php -s "Only respond in emojis" Have an interesting conversation 🙂 chat.php Tell me a joke Starts a new conversation with the given message.
The CLI client uses a streaming response, so you can watch as it generates your answer.
The resuming functionaliy also changed re-arranges the history in the chat cli folder to a structure
%Y being a 4-digit year,
%M a two-digit month and
%U the unix timestamp when it was started). The prompt is readline compatibly with a history file so that you can quickly reuse previous questions. You can avoid something to be added to history by prepending it with whitespace.
chat.php -l will quickly resume the last conversation but you can also resume other ones:
To me, it is very powerful to have ChatGPT available in the CLI since I always have a terminal open. Keeping searchable local history is also something that I like for later (offline) reference.