Summary
The archon version command works without a git repo, but the conventional flag aliases (--version, -v, -V, -version) all hit the git-repo check and exit with an error. Users expect any of these to print version info from anywhere — that's the convention node, npm, bun, and git follow.
Reproduction
From any non-git directory (e.g. C:\Users\<user> on Windows or ~ on Unix):
$ archon version
Archon CLI v0.3.9
Platform: win32-x64
Build: source (bun)
Database: sqlite
Git commit: unknown
$ archon -v
Error: Not in a git repository.
The Archon CLI must be run from within a git repository.
Either navigate to a git repo or use --cwd to specify one.
$ archon --version
Error: Not in a git repository.
...
$ archon -version
Error: Not in a git repository.
...
Root cause
packages/cli/src/cli.ts only short-circuits the git-repo check for the literal positional commands listed in noGitCommands (['version', 'help', 'setup', 'chat', 'continue', 'serve', 'skill']). Flag-style aliases like --version go through parseArgs (where they're either ignored or parsed as values.verbose) and then fall through to the git-repo check with no command, which fails.
Expected behavior
| Invocation |
Should do |
archon version |
print version (already works) |
archon --version |
print version |
archon -V |
print version |
archon -version |
print version |
archon -v (alone) |
print version |
archon -v workflow list |
keep -v as --verbose (existing behavior) |
Notes
-v is the existing short alias for --verbose. When used alone (no command), there's no workflow to be verbose about, so falling back to version output is harmless and matches user expectation.
- Fix should bypass
parseArgs for these aliases so they work even from directories where parsing later checks would fail.
Tested on: Windows 11, source build (bun), Archon CLI v0.3.9.
Summary
The
archon versioncommand works without a git repo, but the conventional flag aliases (--version,-v,-V,-version) all hit the git-repo check and exit with an error. Users expect any of these to print version info from anywhere — that's the conventionnode,npm,bun, andgitfollow.Reproduction
From any non-git directory (e.g.
C:\Users\<user>on Windows or~on Unix):Root cause
packages/cli/src/cli.tsonly short-circuits the git-repo check for the literal positional commands listed innoGitCommands(['version', 'help', 'setup', 'chat', 'continue', 'serve', 'skill']). Flag-style aliases like--versiongo throughparseArgs(where they're either ignored or parsed asvalues.verbose) and then fall through to the git-repo check with no command, which fails.Expected behavior
archon versionarchon --versionarchon -Varchon -versionarchon -v(alone)archon -v workflow list-vas--verbose(existing behavior)Notes
-vis the existing short alias for--verbose. When used alone (no command), there's no workflow to be verbose about, so falling back to version output is harmless and matches user expectation.parseArgsfor these aliases so they work even from directories where parsing later checks would fail.Tested on: Windows 11, source build (bun), Archon CLI v0.3.9.