Problem
axon analyze accepts an optional [PATH] argument, allowing it to index a project from anywhere:
axon analyze /home/user/projects/my-app
This creates .axon/ storage inside the target project. However, host, serve, and mcp commands hardcode Path.cwd().resolve() as the repo path (cli/main.py:490, cli/main.py:927), so they can only operate on the project you're currently inside.
This creates a problem when Axon is installed globally (or in a separate environment) and the target project uses its own isolated virtualenv (e.g., via pyenv). You can analyze the project from outside, but you can't run host --watch or serve against it — and you can't run them from inside the project dir because axon isn't on that venv's PATH.
Proposed Solution
Add an optional [PATH] argument to host, serve, and mcp, matching the existing analyze signature:
axon host --watch /home/user/projects/my-app
axon serve --watch /home/user/projects/my-app
axon mcp /home/user/projects/my-app
When provided, use that path instead of Path.cwd() for storage resolution, file watching, and all repo-scoped operations.
Scope
Small change — thread the optional path argument through:
host → _run_shared_host() → repo_path parameter (currently hardcoded at line 490)
serve → repo_path (currently hardcoded at line 927)
mcp → mcp_main() → _load_storage() (already accepts repo_path, just needs the CLI plumbing)
_load_storage() already handles an optional repo_path parameter with a Path.cwd() fallback (line 54), so the storage layer is ready — it's just the CLI entry points that need the argument.
Problem
axon analyzeaccepts an optional[PATH]argument, allowing it to index a project from anywhere:This creates
.axon/storage inside the target project. However,host,serve, andmcpcommands hardcodePath.cwd().resolve()as the repo path (cli/main.py:490,cli/main.py:927), so they can only operate on the project you're currently inside.This creates a problem when Axon is installed globally (or in a separate environment) and the target project uses its own isolated virtualenv (e.g., via pyenv). You can
analyzethe project from outside, but you can't runhost --watchorserveagainst it — and you can't run them from inside the project dir becauseaxonisn't on that venv's PATH.Proposed Solution
Add an optional
[PATH]argument tohost,serve, andmcp, matching the existinganalyzesignature:When provided, use that path instead of
Path.cwd()for storage resolution, file watching, and all repo-scoped operations.Scope
Small change — thread the optional
pathargument through:host→_run_shared_host()→repo_pathparameter (currently hardcoded at line 490)serve→repo_path(currently hardcoded at line 927)mcp→mcp_main()→_load_storage()(already acceptsrepo_path, just needs the CLI plumbing)_load_storage()already handles an optionalrepo_pathparameter with aPath.cwd()fallback (line 54), so the storage layer is ready — it's just the CLI entry points that need the argument.