Repository navigation
feat(cli): rebuild doctor with fix guidance, --fix, --offline and json output - #313
Merged
Merged
Conversation
…n output `shelltime doctor` now checks the whole setup and, for every problem, says what it breaks and the exact command or config change that fixes it: - system: shelltime on PATH, newer release available - storage: ~/.shelltime exists and is writable, log size vs logCleanup - configuration: which file is used, shadowed and unparseable local files, apiEndpoint, invalid exclude regexes, proxy URL, enableMetrics - account: token present and accepted by the server (401/403 vs unreachable) - privacy: data masking, encryption without a running daemon, legacy tokens without an encryption key - daemon: binary, service, socket, CLI/daemon version mismatch - shell hooks: rc lines, hook script, bash-preexec - Claude Code / Codex: OTEL config, legacy shell OTEL blocks, statusline, Codex sign-in - AI usage receiver: aiCodeOtel disabled, port mismatch, not listening - sync: queued failed uploads and heartbeats The report ends with a "How to fix" list grouped by action. `--fix` applies the safe fixes (hooks, cc/codex install, daemon install, log cleanup) after confirmation (`--yes` skips it), `--offline` skips the network checks and `--format json` prints a machine-readable report. doctor exits 1 when any check fails and no longer aborts on a config error or on an unsupported OS. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KzQHztW9fdhyWDwPmanhLN
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
Contributor
Code reviewNo issues found. Checked for bugs and CLAUDE.md compliance. Scope note: this was a manual read of 🤖 Generated with Claude Code |
Codecov Report❌ Patch coverage is
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
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
shelltime doctorused to check only the folder, the log size, config parsing, the daemon service and the hook for$SHELL. It also stopped at the first config error, and on any OS other than macOS/Linux. It now checks the whole setup. Each problem comes with a plain-language explanation of what it breaks and the exact command or config change that fixes it.shelltimeon PATH; a newer release is available (Homebrew-aware hint)~/.shelltimeexists and is writable;log.logsize againstlogCleanup.thresholdMB(was hard-coded to 100MB)config.tomlshadowed byconfig.yaml; aconfig.local.*that doesn't parse (silently ignored today);apiEndpoint; invalidexcluderegexes (silently skipped today);proxy.url;enableMetricsdataMaskingoff;encrypted: truewith no daemon running (uploads go unencrypted); an older token without an encryption key (also unencrypted)bash-preexec.shaiCodeOteldisabled while Claude Code/Codex report to it;grpcPort≠ 54027; receiver not listeningsync-pending.jsonl) and pending heartbeatsThe report ends with a How to fix list grouped by action, so one command that resolves several problems (e.g.
shelltime daemon install) appears once. Paths under$HOMEare shown as~/….New flags:
--fix: lists the safe automatic fixes, asks for confirmation, applies them, then re-runs the checks.--yesskips the prompt.cc install,codex install,daemon install, and clearing an oversized log.--offline: skips the network checks (token, encryption key, latest version).--format json: prints a machine-readable report (version,summary,checks[]withid,status,message,fixandautoFix).mainnow runs throughrun() int, so deferred cleanup still happens before exiting. Every other command's exit behavior is unchanged.Supporting changes:
model: exportedAICodeOtelEndpointand addedDefaultAICodeOtelGRPCPort. AddedClaudeSettingsAICodeOtelEnvService.StatusLineCommand(),CodexOtelConfigService.Endpoint(),ConfigFilePaths()andValidateConfigFile().requestDaemonStatus: now sets a deadline for the whole exchange, so a socket that never answers can't hangdoctorordaemon status.README.mdand the FAQ indocs/CONFIG.md. Also fixed the stalesync-pending.txt→sync-pending.jsonlthere.Test plan
go test -timeout 3m -coverprofile=coverage.txt -covermode=atomic ./...: all packages pass.commands/doctor_test.go:--format json, flag validation,--fix --yes(hook and Claude Code fixes applied, daemon install deduplicated to one run), and--fixdeclined;go vetis clean, and the changed files are gofmt-clean.HOMEs:--offline --format jsonparses;--fixprompt declines cleanly;go test -race ./daemon/failsTestSocketTopicProcessor_TrackPreAndPostRoutedonmainas well, so that race isn't caused by this PR. CI doesn't run with-race.🤖 Generated with Claude Code
https://claude.ai/code/session_01KzQHztW9fdhyWDwPmanhLN
Generated by Claude Code