@@ -91,31 +91,20 @@ func LoadMCPPrompts() ([]MCPPrompt, error) {
9191}
9292
9393func buildCommandSources(cfg *config.Config) []commandSource {
94− var sources []commandSource
95−
96− // XDG config directory
97− if dir := getXDGCommandsDir(); dir != "" {
98− sources = append(sources, commandSource{
99− path: dir,
94+ return []commandSource{
95+ {
96+ path: filepath.Join(home.Config(), "crush", "commands"),
10097 prefix: userCommandPrefix,
101− })
102− }
103−
104− // Home directory
105− if home := home.Dir(); home != "" {
106− sources = append(sources, commandSource{
107− path: filepath.Join(home, ".crush", "commands"),
98+ },
99+ {
100+ path: filepath.Join(home.Dir(), ".crush", "commands"),
108101 prefix: userCommandPrefix,
109− })
102+ },
103+ {
104+ path: filepath.Join(cfg.Options.DataDirectory, "commands"),
105+ prefix: projectCommandPrefix,
106+ },
110107 }
111−
112− // Project directory
113− sources = append(sources, commandSource{
114− path: filepath.Join(cfg.Options.DataDirectory, "commands"),
115− prefix: projectCommandPrefix,
116− })
117−
118− return sources
119108}
120109
121110func loadAll(sources []commandSource) ([]CustomCommand, error) {
@@ -204,19 +193,6 @@ func buildCommandID(path, baseDir, prefix string) string {
204193 return prefix + strings.Join(parts, ":")
205194}
206195
207−func getXDGCommandsDir() string {
208− xdgHome := os.Getenv("XDG_CONFIG_HOME")
209− if xdgHome == "" {
210− if home := home.Dir(); home != "" {
211− xdgHome = filepath.Join(home, ".config")
212− }
213− }
214− if xdgHome != "" {
215− return filepath.Join(xdgHome, "crush", "commands")
216− }
217− return ""
218−}
219−
220196func isMarkdownFile(name string) bool {
221197 return strings.HasSuffix(strings.ToLower(name), ".md")
222198}