-
Notifications
You must be signed in to change notification settings - Fork 8.2k
Description
Company or project name
No response
Describe the improvement
Current behavior
clickhouse-client expects its configuration file to be located at ~/.clickhouse-client/config.xml.
Reference: ClickHouse CLI configuration documentation
This approach contributes to home directory clutter. Many command-line tools still use this convention, resulting in numerous dotfiles that make the home folder disorganized and harder to manage.
Proposed improvement
Adopt the XDG Base Directory Specification by default, placing the config file in:
~/.config/clickhouse-client/config.xml
while still supporting the legacy path for backward compatibility.
I think this will show how bad it becomes after some time:
Apparently I'm not the only one that's bothered by home folder pollution: https://github.com/b3nj5m1n/xdg-ninja
Also, there are already handful of tools supporting that:
Cleaner home directory: Aligns with modern CLI design and avoids unnecessary dotfiles in ~/.
Consistency: Matches behavior of other modern CLI tools such as kubectl, gh, aws, and git.
Ease of configuration management: Centralizes configurations under ~/.config/, improving maintainability and backup workflows.
Suggested implementation
- Check
~/.config/clickhouse-client/config.xmlby default. - Fall back to
~/.clickhouse-client/config.xmlif the XDG path does not exist. - Optionally, respect
$XDG_CONFIG_HOMEif defined.
Which ClickHouse versions are affected?
All
How to reproduce
Not applicable
Error message and/or stacktrace
No response
Additional context
No response