Skip to content

feat: support loading config from user home directory#89

Merged
schpet merged 3 commits into
schpet:mainfrom
kfrance:add-home-folder-config
Jan 9, 2026
Merged

feat: support loading config from user home directory#89
schpet merged 3 commits into
schpet:mainfrom
kfrance:add-home-folder-config

Conversation

@kfrance

@kfrance kfrance commented Jan 7, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Add support for loading .linear.toml from user's home directory as a fallback config location
  • Follows XDG Base Directory Specification on Unix ($XDG_CONFIG_HOME/linear/linear.toml or ~/.config/linear/linear.toml)
  • Uses %APPDATA%\linear\linear.toml on Windows
  • Includes comprehensive cross-platform tests

Config Precedence (highest to lowest)

  1. CLI flags
  2. Environment variables
  3. Project config (.linear.toml in cwd or repo root)
  4. User home config

Test plan

  • All existing tests pass
  • New tests verify home folder config loading
  • Tests verify project config takes precedence over home config
  • Tests verify XDG_CONFIG_HOME takes precedence over ~/.config (Unix)
  • Tests verify env vars take precedence over home config
  • Windows-specific test included (skipped on Unix)

Dependencies: This PR depends on #88 being merged first.

🤖 Generated with Claude Code

@schpet

schpet commented Jan 7, 2026

Copy link
Copy Markdown
Owner

i think overall i would like this, e.g. to allow people to set some values globally more easily. but as implemented in this PR it'll load only the user's global config (i.e. in ~/.config/linear/linear.toml) and not the repo specific one. i think we'd need to merge the configs or something. do you agree?

@schpet schpet linked an issue Jan 9, 2026 that may be closed by this pull request
kfrance and others added 2 commits January 9, 2026 12:49
…file values

The README documented that environment variables take precedence over
config file values, but the code had the opposite behavior. This fix
corrects the precedence order in getRawOption to match the documentation:

1. CLI flags (highest priority)
2. Environment variables
3. Config file (lowest priority)

Also adds subprocess-based tests that verify:
- Env vars win when both env var and config file are present
- Config file is used as fallback when no env var is set

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Add support for loading `.linear.toml` from user's home directory as a
fallback when no project-level config exists:
- Unix: `~/.config/linear/linear.toml` or `$XDG_CONFIG_HOME/linear/linear.toml`
- Windows: `%APPDATA%\linear\linear.toml`

Config precedence (highest to lowest):
1. CLI flags
2. Environment variables
3. Project config (`.linear.toml` in cwd or repo root)
4. User home config

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
@schpet schpet force-pushed the add-home-folder-config branch 2 times, most recently from 5f28b63 to e396e88 Compare January 9, 2026 21:23
@schpet schpet force-pushed the add-home-folder-config branch from e396e88 to 03ebf55 Compare January 9, 2026 21:26
@schpet schpet merged commit 71757e5 into schpet:main Jan 9, 2026
8 checks passed
@schpet

schpet commented Jan 9, 2026

Copy link
Copy Markdown
Owner

@kfrance FYI i went forward with the merging stuff i mentioned. excited to have global config. thanks for this!

@kfrance kfrance deleted the add-home-folder-config branch January 14, 2026 23:48
@kfrance

kfrance commented Jan 14, 2026

Copy link
Copy Markdown
Contributor Author

@kfrance FYI i went forward with the merging stuff i mentioned. excited to have global config. thanks for this!

Thanks. Sorry I was just coming back to look over this and see how to improve it. Glad you liked it enough to merge it in. I didn't really think about it, but you are probably right merging them would probably be better.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support reading config from home directory (~/.linear.toml)

2 participants