ChatGPT CLI v1.8.12
New Features:
-
Auto shell title support:
- Added a new configuration option auto_shell_title to automatically set the terminal title to the current thread name during interactive sessions (TTY-only; silently skipped in non-TTY).
- Config and CLI flag support:
- Config key: auto_shell_title
- CLI flag: --set-auto-shell-title / set-auto-shell-title
- Code reference: cmd/chatgpt/main.go, config/config.go, README.md
-
Interactive “multiline” toggle command:
- You can now toggle multiline input on/off while in interactive mode by typing the command multiline.
- The interactive welcome message now shows whether multiline is ON or OFF.
- Code reference: cmd/chatgpt/main.go (readInput changes)
Improvements:
-
Centralized thread naming and persistence:
- Introduced GenerateThreadName to unify logic for naming threads across modes and options:
- --new-thread takes priority and creates a cmd_-prefixed thread and persists it to config.
- In interactive mode with auto_create_new_thread enabled, creates an int_-prefixed thread without writing to config.
- Otherwise, uses the configured thread name as-is.
- Code reference: cmd/chatgpt/utils/utils.go (GenerateThreadName), cmd/chatgpt/main.go
- Introduced GenerateThreadName to unify logic for naming threads across modes and options:
-
Clearer interactive session UX:
- Updated the startup message to include multiline status and a concise list of commands (clear, multiline, exit/Ctrl+C).
- Backspace handling and EOF flow in multiline mode were refined.
- Code reference: cmd/chatgpt/main.go
-
Safer terminal title handling:
- Added TTY detection before writing the terminal title to avoid errors in piped or non-interactive environments.
- Code reference: cmd/chatgpt/main.go (isTerminal, setShellTitle)
Bug Fixes:
- Avoid unintended thread overwrites:
- Moved thread selection logic out of the client constructor and into the CLI layer to prevent accidental overwrites and ensure consistent behavior across modes and flags.
- Updated tests to reflect the new responsibility boundaries.
- Code reference: api/client/client.go, api/client/client_test.go, cmd/chatgpt/main.go
Other Changes:
-
Configuration updates:
- auto_shell_title added to Config and Viper bindings.
- Code reference: config/config.go, cmd/chatgpt/main.go
-
Dependency updates:
- go.uber.org/zap: 1.27.0 → 1.27.1
- golang.org/x/text: 0.30.0 → 0.31.0
- golang.org/x/net: 0.46.0 → 0.47.0 (indirect)
- golang.org/x/sys: 0.37.0 → 0.38.0 (indirect)
- golang.org/x/tools: 0.37.0 → 0.38.0
- Code reference: go.mod, go.sum
-
Tests:
- Added coverage for GenerateThreadName with multiple scenarios.
- Removed client constructor tests that asserted thread-setting behavior (now handled in CLI).
- Code reference: cmd/chatgpt/utils/utils_test.go, api/client/client_test.go
Upgrade Notes:
- To update:
- Homebrew: brew upgrade chatgpt-cli
- Direct download: Fetch the latest binaries for your OS from the releases page and replace your existing executable.
- Configuration:
- auto_shell_title is new and defaults to false. Enable it via config.yaml or the CLI flag set-auto-shell-title if you want the terminal title to reflect the current thread.
- Behavior:
- When using --new-thread, the new thread name (cmd_ prefix) is now persisted to config. In interactive mode with auto_create_new_thread: true, a session-specific thread (int_ prefix) is created without writing to config.