fix: add --version flag and scanner preflight for missing claude CLI#114
Merged
George-iam merged 1 commit intomainfrom Apr 17, 2026
Merged
Conversation
- axme-code --version / -v now prints AXME_CODE_VERSION and exits 0 (previously: "Unknown command: --version" + usage dump, discovered during WSL2 E2E testing when verifying install.sh worked). - initProjectWithLLM now pre-flights findClaudePath() before spawning scanners. Without the `claude` CLI, the bundled Agent SDK crashes on fileURLToPath(undefined) and leaks the stack trace 3x (once per scanner) via errors.push. The friendly message points the user at the install command instead. Deterministic fallback still runs, so the output of .axme-code/ is unchanged. #!axme pr=none repo=AxmeAI/axme-code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Two user-visible bugs found during WSL2 E2E testing.
1.
axme-code --versionreturned "Unknown command"The README Quick Start tells users to run
axme-coderight after install. The natural first command —axme-code --version— dumped the usage text. Added--version/-vhandler at the top ofsrc/cli.tsthat printsAXME_CODE_VERSIONand exits 0.2. LLM scanner leaked
TypeError: path must be stringstack trace whenclaudeCLI not installedWhen
axme-code setupruns without theclaudeCLI on PATH (e.g. fresh WSL install that only has our binary), the Agent SDK bundled inside us crashes onfileURLToPath(undefined)in each of the 4 scanners, leaking the stack trace 3x to the user througherrors.push. Deterministic fallback already runs, so.axme-code/is unaffected — the fix is purely UX.Added a pre-flight
findClaudePath()check insrc/tools/init.tsbeforePromise.allSettled. Ifclaudeis missing, log a friendly message with the install command and skip scanner invocation entirely. Downstream processing loop iterates the empty array and the existing deterministic-oracle fallback block kicks in.Test plan
node dist/axme-code.js --versionprints0.2.9, exits 0node dist/axme-code.js -vprints0.2.9, exits 0node dist/axme-code.js --unknown-flagstill prints "Unknown command" + usage (regression guard)node dist/axme-code.js statusstill worksnpm test511/511 passnpm run buildcleannpx tsc --noEmitcleanNot added: new unit tests. The
--versionpath is trivial and covered manually; the preflight branch is defensive against an SDK interaction that's hard to mock cleanly.🤖 Generated with Claude Code