Skip to content

設定ディレクトリをXDG Base Directory準拠に変更#5

Merged
beatinaniwa merged 2 commits into
mainfrom
fix/xdg-config-dir
Mar 29, 2026
Merged

設定ディレクトリをXDG Base Directory準拠に変更#5
beatinaniwa merged 2 commits into
mainfrom
fix/xdg-config-dir

Conversation

@beatinaniwa

Copy link
Copy Markdown
Owner

概要

macOSで~/Library/Application Support/mf-cli/ではなく~/.config/mf-cli/をデフォルトの設定ディレクトリにするよう変更。CLIツールとしてより直感的なXDG Base Directory仕様に準拠。

変更内容

  • resolveConfigDir()os.UserConfigDir()からXDG準拠のロジックに書き換え
  • XDG_CONFIG_HOME環境変数をサポート(相対パスはXDG仕様に従い無視)
  • Windowsでは従来通り%AppData%を使用
  • READMEの設定パス説明を更新
  • LICENSEのcopyright年号を2026に修正

Codexローカルレビューの結果

  • 6ラウンド(修正: 8件、スキップ: 3件)
  • スキップ理由: 未公開リポジトリのためmacOSレガシーパスの移行は不要

🤖 Generated with Claude Code

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に修正

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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".

Comment thread internal/config/config.go Outdated
Comment on lines +77 to +78
if v := os.Getenv("XDG_CONFIG_HOME"); v != "" && filepath.IsAbs(v) {
return filepath.Join(v, "mf-cli"), nil

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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チェックの順序を変更
@beatinaniwa

Copy link
Copy Markdown
Owner Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Keep it up!

ℹ️ 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".

@beatinaniwa beatinaniwa merged commit 8db3cb5 into main Mar 29, 2026
1 check passed
@beatinaniwa beatinaniwa deleted the fix/xdg-config-dir branch March 29, 2026 17:11
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.

1 participant