設定ディレクトリをXDG Base Directory準拠に変更#5
Conversation
os.UserConfigDir()(macOSでは~/Library/Application Support)から ~/.config/mf-cli をデフォルトに変更し、XDG_CONFIG_HOME環境変数も サポート。Windowsでは従来通り%AppData%を使用。 - resolveConfigDir()をXDG準拠に書き換え - 相対パスのXDG_CONFIG_HOMEを無視(XDG仕様準拠) - テスト追加(XDG、デフォルトフォールバック、相対パス無視) - READMEの設定パス説明を更新 - LICENSEのcopyright年号を2026に修正
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 956fc76216
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if v := os.Getenv("XDG_CONFIG_HOME"); v != "" && filepath.IsAbs(v) { | ||
| return filepath.Join(v, "mf-cli"), nil |
There was a problem hiding this comment.
Skip XDG config override on Windows
This branch now applies XDG_CONFIG_HOME before the Windows-specific fallback, so on Windows hosts where XDG_CONFIG_HOME is set (commonly in Git Bash/MSYS environments), the CLI will stop reading/writing %AppData%\\mf-cli and instead use the XDG path. That is a behavioral regression from the previous implementation and can make existing Windows users appear to have “lost” their config/token files after upgrading. If Windows behavior is intended to remain AppData-based, gate this XDG branch to non-Windows (or move it after the Windows branch).
Useful? React with 👍 / 👎.
Git Bash/MSYS環境でXDG_CONFIG_HOMEが設定されていても Windowsでは%AppData%を使用するようXDGチェックの順序を変更
|
@codex review |
|
Codex Review: Didn't find any major issues. Keep it up! ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
概要
macOSで
~/Library/Application Support/mf-cli/ではなく~/.config/mf-cli/をデフォルトの設定ディレクトリにするよう変更。CLIツールとしてより直感的なXDG Base Directory仕様に準拠。変更内容
resolveConfigDir()をos.UserConfigDir()からXDG準拠のロジックに書き換えXDG_CONFIG_HOME環境変数をサポート(相対パスはXDG仕様に従い無視)%AppData%を使用Codexローカルレビューの結果
🤖 Generated with Claude Code