cloudflare / cloudflare/workers-sdk
Config should be stored in ~/.config/wrangler/ , not ~/.config/.wrangler/ (as a hidden directory)
- Dominant language
- TypeScript
- Stars
- 4.5k
- Forks
- 1.5k
- Avg merge
- 3d 8h
- Merged PRs (30d)
- 187
Description
### What versions & operating system are you using?
I'm running wrangler 4.42.0 on Ubuntu 25.04.
### Please provide a link to a minimal reproduction
_No response_
### Describe the Bug
After running `npx wrangler login`, I noticed that wrangler created configuration in this directory: `~/.config/.wrangler/` . This does not meet the naming conventions in Linux. Instead, it should be in `~/.config/wrangler/` (the directory name `wrangler` should not start with a dot), assuming that the environment variable `XDG_CONFIG_HOME` is not set or empty.
The [XDG Base Directory specification](https://specifications.freedesktop.org/basedir-spec/latest/) specifies that configuration for a program should be stored in the path specified by the environment variable `XDG_CONFIG_HOME`. If that env variable is empty or unset, then the path `$HOME/.config` should be used. It does not specify that the configuration files should not be hidden files (starting with a dot character), but that is the convention that all other programs use. I have never come across a tool that stores its configuration as a hidden folder (starting with a dot) inside `~/.config`, other than wrangler. It is well understood that there is no need to mark the configuration files as hidden, since the parent directory `~/.config` is already hidden.
It seems that wrangler falls back to `~/.wrangler` . Although this does not meet the XDG Base Directory specification, it is a common convention on Linux. This issue is not requesting any changes to that. It is only requesting that `~/.config/.wrangler` be renamed to `~/.config/wrangler` .
### Please provide any relevant error logs
_No response_
Contributor guide
Research direction
Start at the `npx wrangler login` entry point and trace how Wrangler selects its configuration directory when `XDG_CONFIG_HOME` is unset or empty. The work is done when configuration uses `~/.config/wrangler/` instead of `~/.config/.wrangler/`, while the existing `~/.wrangler` fallback remains unchanged.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- cli
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 65/100