ChatGPT CLI v1.8.9
New Features:
• Configurable User-Agent header:
• You can now set a custom User-Agent for all outgoing requests via config (user_agent), CLI flag (set-user-agent), or environment overrides.
• Default value: chatgpt-cli.
• Code reference: config/config.go, cmd/chatgpt/main.go, api/http/http.go, api/client/client.go, internal/constants.go.
• Admin API docs:
• Added documentation for OpenAI Admin endpoints to check organization info and cost reports using OPENAI_ADMIN_KEY.
• Code reference: docs/chatgpt_api.md.
Improvements:
• Standardized HTTP headers:
• Centralized common header keys and values (Content-Type, Authorization, User-Agent) into internal constants to reduce duplication and ensure consistency.
• Code reference: internal/constants.go; api/http/http.go; api/client/client.go.
• Enhanced request debug output:
• Debug logging now reflects the actual auth header name and token prefix from configuration and includes the User-Agent header for easier troubleshooting.
• Code reference: api/client/client.go (printRequestDebugInfo).
• Perplexity configuration simplification:
• Updated README to use model: sonar instead of the long model identifier.
• Code reference: README.md.
• Dependency updates:
• Upgraded several libraries for stability, features, and security:
– cobra 1.10.1, pflag 1.0.10, viper 1.21.0
– ginkgo 2.25.1, gomega 1.38.2, testify 1.11.1
– go-logr 1.4.3, golang.org/x/text 0.29.0, golang.org/x/net 0.44.0, golang.org/x/sys 0.36.0, golang.org/x/tools 0.36.0
– afero 1.15.0, cast 1.10.0, locafero 0.11.0
– Added go.yaml.in/yaml/v3 3.0.4 and Masterminds/semver/v3 3.4.0
• Code reference: go.mod, go.sum.
Bug Fixes:
• Correct Authorization header handling in debug and MCP requests:
• Debug output now uses the configured AuthHeader and AuthTokenPrefix instead of a hard-coded “Authorization: Bearer …”.
• MCP (Apify) requests now set Authorization and Content-Type via standardized constants.
• Code reference: api/client/client.go (printRequestDebugInfo, buildMCPRequest).
Other Changes:
• Tests updated to verify User-Agent header is present in debug output.
• Code reference: test/integration/integration_test.go.
• Minor import/order cleanups.
• Code reference: api/http/http.go, cmd/chatgpt/main.go.
Upgrade Notes:
• Homebrew: brew upgrade chatgpt-cli
• Direct download: Download the latest binaries for your operating system from the releases page and replace your existing binary.