feat: add doctor command and auto-detect editors#166
Merged
Conversation
- Enrich PostHog telemetry with per-command outcome events (check_completed, init_completed, upgrade_completed, login_completed), common properties (is_wsl, install_method, project context), and option-flag presence tracking on command_executed - Add `archgate doctor` command for system diagnostics: environment, install method, project context, editor CLIs, and plugin integrations. Supports --json output. - Add editor auto-detection: when --editor is omitted in a TTY, detect available editor CLIs and prompt the user to select which to configure. Applies to init, plugin install, and plugin url. Non-TTY falls back to "claude" for backward compatibility. - Fix exit codes: pre-main Bun/platform guards now use logError + exit(1) instead of throw; upgrade "unsupported platform" changed from exit(2) to exit(1); login status/logout wrapped in try-catch (ARCH-012) - Track failed upgrades in telemetry (catch block) - Relax oxlint max-lines from 300 to 500 - Update telemetry and CLI command docs (EN + pt-BR)
Deploying archgate-cli with
|
| Latest commit: |
468356b
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://8cd0d6de.archgate-cli.pages.dev |
| Branch Preview URL: | https://feat-telemetry-doctor-editor.archgate-cli.pages.dev |
Extract shared helpers into src/helpers/install-info.ts: - detectInstallMethod() — previously duplicated in telemetry.ts, doctor.ts, and sentry.ts (4 copies) - getProjectContext() — previously duplicated in telemetry.ts and doctor.ts (2 copies) Also deduplicate editor detection in doctor.ts by reusing detectEditors() from editor-detect.ts instead of calling isClaudeCliAvailable/etc directly.
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
check_completed,init_completed,upgrade_completed,login_completed) with rich properties. Enriched common properties on every event (is_wsl,install_method,has_project,adr_count,adr_with_rules_count). Added option-flag presence tracking tocommand_executed. Failed upgrades now tracked too.archgate doctorcommand: New diagnostic command that reports system environment, install method, project context, editor CLI availability, and plugin integrations. Supports--jsonoutput.--editoris omitted in a TTY, the CLI detects available editor CLIs and prompts the user to select which to configure (multi-select forinit/plugin install, single-select forplugin url). Non-TTY falls back to"claude"for backward compatibility. Applies toinit,plugin install, andplugin url.logError()+exit(1)instead of rawthrow;upgrade"unsupported platform" changed fromexit(2)toexit(1);login status/logoutwrapped in try-catch per ARCH-012.max-linesfrom 300 to 500.Test plan
bun run validatepasses (599 tests, 22/22 ADR checks, build compiles)archgate doctoroutputs correct system info in TTY and--jsonmodesarchgate initwithout--editorprompts for editor selection in TTYarchgate plugin installwithout--editorprompts for editor selection in TTYarchgate plugin urlwithout--editorprompts for single editor selection in TTY"claude"without prompting