Skip to content

feat(cli): add config path command - #1711

Open
ChrisJr404 wants to merge 2 commits into
floatpane:masterfrom
ChrisJr404:feature/config-path-command
Open

feat(cli): add config path command#1711
ChrisJr404 wants to merge 2 commits into
floatpane:masterfrom
ChrisJr404:feature/config-path-command

Conversation

@ChrisJr404

Copy link
Copy Markdown

What?

Adds a matcha config path subcommand that prints the resolved config.json location and exits, without opening an editor.

Why?

Closes #1516. There's currently no quick way to find where Matcha stores its config, you either open it in $EDITOR or guess the path. Printing it is useful in scripts and for anyone who just wants the location.

The path comes from a small exported config.GetConfigFile helper so it resolves the same way the rest of the app does. Added tests for the resolver and for the wired command, and updated the README and CLI docs.

@ChrisJr404
ChrisJr404 requested a review from a team as a code owner August 25, 2026 16:47
@floatpanebot floatpanebot added area/config Configuration / settings area/cli CLI flags / commands area/docs Docs site / README size/M Diff: 51–200 lines documentation Documentation changes enhancement New feature or request labels Aug 25, 2026

@floatpanebot floatpanebot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi @ChrisJr404! Please fix the following issues with your PR:

  • Title: Is too long (41 characters). The PR title must be strictly under 40 characters.

@floatpanebot

floatpanebot commented Aug 25, 2026

Copy link
Copy Markdown
Member

Benchmark report — no significant change

Metrics worse: 0 · better: 0 (threshold: ±3%).

benchstat output
goos: linux
goarch: amd64
pkg: github.com/floatpane/matcha/backend
cpu: AMD EPYC 7763 64-Core Processor                
                           │    old.txt    │                new.txt                │
                           │    sec/op     │    sec/op      vs base                │
ParseSearchQuery_Simple-4    3.307µ ± 276%    2.472µ ± 24%         ~ (p=0.310 n=6)
ParseSearchQuery_Complex-4   8.376µ ±  42%    7.689µ ± 32%         ~ (p=0.240 n=6)
TokenizeSearchQuery-4        4.013µ ±  19%   12.230µ ± 51%  +204.79% (p=0.002 n=6)
geomean                      4.808µ           6.148µ         +27.88%

                           │  old.txt   │              new.txt               │
                           │    B/op    │    B/op     vs base                │
ParseSearchQuery_Simple-4    26.00 ± 0%   26.00 ± 0%       ~ (p=1.000 n=6) ¹
ParseSearchQuery_Complex-4   762.0 ± 0%   762.0 ± 0%       ~ (p=1.000 n=6) ¹
TokenizeSearchQuery-4        176.0 ± 0%   176.0 ± 0%       ~ (p=1.000 n=6) ¹
geomean                      151.6        151.6       +0.00%
¹ all samples are equal

                           │  old.txt   │              new.txt               │
                           │ allocs/op  │ allocs/op   vs base                │
ParseSearchQuery_Simple-4    2.000 ± 0%   2.000 ± 0%       ~ (p=1.000 n=6) ¹
ParseSearchQuery_Complex-4   23.00 ± 0%   23.00 ± 0%       ~ (p=1.000 n=6) ¹
TokenizeSearchQuery-4        9.000 ± 0%   9.000 ± 0%       ~ (p=1.000 n=6) ¹
geomean                      7.453        7.453       +0.00%
¹ all samples are equal

pkg: github.com/floatpane/matcha/tui
                    │   old.txt    │               new.txt               │
                    │    sec/op    │    sec/op      vs base              │
LogPanelView-4        155.4µ ± 14%    169.3µ ±  9%       ~ (p=0.240 n=6)
SearchOverlayView-4   172.3µ ± 12%    169.5µ ± 14%       ~ (p=0.937 n=6)
InboxConstruction-4   984.1µ ± 16%   1014.3µ ± 13%       ~ (p=0.485 n=6)
geomean               297.6µ          307.6µ        +3.39%

                    │    old.txt     │               new.txt                │
                    │      B/op      │     B/op       vs base               │
LogPanelView-4        21.79Ki ± 105%   44.67Ki ± 51%        ~ (p=0.567 n=6)
SearchOverlayView-4   56.14Ki ±   0%   44.69Ki ± 26%        ~ (p=0.582 n=6)
InboxConstruction-4   874.3Ki ±   0%   874.3Ki ±  0%        ~ (p=0.818 n=6)
geomean               102.3Ki          120.4Ki        +17.74%

                    │   old.txt   │              new.txt              │
                    │  allocs/op  │  allocs/op   vs base              │
LogPanelView-4         712.0 ± 0%    714.0 ± 0%       ~ (p=0.567 n=6)
SearchOverlayView-4    926.0 ± 0%    925.0 ± 0%       ~ (p=0.121 n=6)
InboxConstruction-4   3.478k ± 0%   3.478k ± 0%       ~ (p=0.827 n=6)
geomean               1.319k        1.319k       +0.05%

auto-generated by benchmarks.yml

@ChrisJr404 ChrisJr404 changed the title feat(cli): add matcha config path command feat(cli): add config path command Aug 26, 2026

@floatpanebot floatpanebot left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hi @ChrisJr404! Please fix the following issues with your PR:

  • Title: Is too long (41 characters). The PR title must be strictly under 40 characters.

@ChrisJr404

Copy link
Copy Markdown
Author

Trimmed the title under 40 chars. Also pushed a fix for the Windows build: TestGetConfigFile only set HOME, but os.UserHomeDir() reads USERPROFILE on Windows so the temp override was ignored and it resolved to the real profile dir. Now sets both, same as the cache tests already do.

@floatpanebot
floatpanebot dismissed stale reviews from themself August 26, 2026 05:02

Formatting issues have been resolved. Thank you!

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

Labels

area/cli CLI flags / commands area/config Configuration / settings area/docs Docs site / README documentation Documentation changes enhancement New feature or request size/M Diff: 51–200 lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

FEAT: Add 'matcha config path' command to print config location

2 participants