Skip to content

Store config in the user config directory instead of ~/note - #81

Merged
Bucknalla merged 3 commits into
masterfrom
ray/cli-updates
Oct 31, 2026
Merged

Bucknalla merged 3 commits into
masterfrom
ray/cli-updates

Conversation

@rayozzie

Copy link
Copy Markdown
Contributor

Why

muse doesn't preserve ~/note when it replaces a container, so anyone running notehub there lost their saved login (and the rest of the config) every time the container was replaced. Platforms like muse do persist the standard config directory, so the config now lives there.

What changed

The config file, which includes saved Notehub credentials, has moved:

OS Before After
macOS / Linux ~/note/config.json $XDG_CONFIG_HOME/note/config.json, or ~/.config/note/config.json if that isn't set
Windows %USERPROFILE%\note\config.json %AppData%\note\config.json
  • ~/.config is used on macOS as well, matching tools like gh, rather than ~/Library/Application Support, which is harder to find and has a space in the path. A relative $XDG_CONFIG_HOME is ignored, as the XDG spec requires.
  • The directory is created owner-only (0700), since it holds tokens.
  • ConfigDir() now returns (string, error). When no home or config directory can be found (for example, $HOME unset in a stripped-down container), commands now fail with a clear error. Before, they fell back to the current directory, which could leave tokens in a repository.
  • The per-OS lib/config-unix.go and lib/config-windows.go are replaced by one lib/config-dir.go.

Impact

Existing config at ~/note/config.json isn't migrated, so users need to run notehub login again once after upgrading.

This branch also includes the earlier commit 644f8e8 (go-m1cpi update for the Apple M5 crash, and help agent text).

Testing

  • go vet passes for the host OS and GOOS=windows
  • go test ./... passes in lib
  • The full repo builds

🤖 Generated with Claude Code

rayozzie and others added 2 commits October 29, 2026 13:41
The config (including saved Notehub credentials) now lives in
$XDG_CONFIG_HOME/note, or ~/.config/note when that isn't set, and in
%AppData%\note on Windows. Container platforms such as muse persist the
standard config directory across container replacement, but not an
arbitrary ~/note directory, so sign-ins were being lost.

ConfigDir now returns an error when no home or config directory can be
found, rather than falling back to the current directory, which could
leave tokens inside a repository.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rayozzie
rayozzie requested a review from Bucknalla October 31, 2026 02:22
Resolve go.mod/go.sum conflicts by taking master's go-m1cpu v0.2.4
(newer than the v0.2.2 bump on this branch).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AYbrESTG2Up5m3mzsRSABh
@Bucknalla
Bucknalla merged commit eaffea2 into master Oct 31, 2026
2 checks passed
@Bucknalla
Bucknalla deleted the ray/cli-updates branch October 31, 2026 07:29
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.

3 participants