Skip to content

Commit e259dba

Browse files
Update config location documentation (#110)
1 parent d4c1ae3 commit e259dba

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

CLAUDE.md

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -35,14 +35,12 @@ Note: Integration tests require `LOCALSTACK_AUTH_TOKEN` environment variable for
3535

3636
# Configuration
3737

38-
Uses Viper with TOML format. Config lookup order:
38+
Uses Viper with TOML format. lstk uses the first config file found in this order:
3939
1. `./lstk.toml` (project-local)
4040
2. `$HOME/.config/lstk/config.toml`
41-
3. `os.UserConfigDir()/lstk/config.toml`
41+
3. **macOS**: `$HOME/Library/Application Support/lstk/config.toml` / **Windows**: `%AppData%\lstk\config.toml`
4242

43-
When no config file exists, lstk creates one at:
44-
- `$HOME/.config/lstk/config.toml` if `$HOME/.config` exists
45-
- otherwise `os.UserConfigDir()/lstk/config.toml`
43+
When no config file exists, lstk creates one at `$HOME/.config/lstk/config.toml` if `$HOME/.config/` already exists, otherwise at the OS default (#3). This means #3 is only reached on macOS when `$HOME/.config/` didn't exist at first run.
4644

4745
Use `lstk config path` to print the resolved config file path currently in use.
4846
When adding a new command that depends on configuration, wire config initialization explicitly in that command (`PreRunE: initConfig`). Keep side-effect-free commands (e.g., `version`, `config path`) without config initialization.

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,10 +70,12 @@ The CLI supports multiple auth workflows. `lstk` resolves your auth token in thi
7070

7171
`lstk` uses a TOML config file, created automatically on first run.
7272

73-
Config lookup order:
73+
`lstk` uses the first config file found in this order:
7474
1. `./lstk.toml` (project-local)
7575
2. `$HOME/.config/lstk/config.toml`
76-
3. `os.UserConfigDir()/lstk/config.toml`
76+
3. **macOS**: `$HOME/Library/Application Support/lstk/config.toml` / **Windows**: `%AppData%\lstk\config.toml`
77+
78+
On first run, the config is created at `$HOME/.config/lstk/config.toml` if `$HOME/.config/` already exists, otherwise at the OS default (#3). This means #3 is only reached on macOS when `$HOME/.config/` didn't exist at first run.
7779

7880
To see which config file is currently in use:
7981

0 commit comments

Comments
 (0)