Skip to content

Add ~/.archon/.archon/commands/ as a global command search path (mirrors global workflow behavior) #1105

@dancehands

Description

@dancehands

Currently, workflows support a global search path at ~/.archon/.archon/workflows/ via getArchonHome() in discoverWorkflows(). Commands have no equivalent — they only load from:

  1. .archon/commands/ (project-local)
  2. .archon/commands/defaults/ (bundled defaults)
  3. commands.folder from .archon/config.yaml (project-local, no tilde expansion)

Request: Add ~/.archon/.archon/commands/ as a global fallback in getCommandFolderSearchPaths(), loaded after project-local commands but before bundled defaults — mirroring the existing global workflow pattern.

Use case: Teams maintaining a shared set of custom commands (e.g. company-specific workflow steps) want to author them in one place and have them available across all project repos without copying files into each repo or committing machine-specific absolute paths to .archon/config.yaml.

Suggested change (in packages/paths/src/archon-paths.ts):

export function getCommandFolderSearchPaths(configuredFolder?: string): string[] {
const globalCommandsPath = join(getArchonHome(), 'commands');
const paths = ['.archon/commands', '.archon/commands/defaults', globalCommandsPath];

if (
  configuredFolder &&
  configuredFolder !== '.archon/commands' &&
  configuredFolder !== '.archon/commands/defaults'
) {
  paths.push(expandTilde(configuredFolder)); // also fix tilde expansion here
}

return paths;

}

This also fixes a secondary issue: configuredFolder from config currently doesn't expand ~, so commands: folder: ~/.archon/commands silently fails.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P3Low priority - Nice to have, consider closing if stalearea: handlersCommand handlereffort/lowSingle file or function, one responsibility, isolated changefeature-requestNew functionality (external suggestion, needs review)

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions