[CLI] Add Doctor Support Artifact#16
Closed
rasulkireev wants to merge 4 commits into
Closed
Conversation
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
The CLI can now generate a self-contained support artifact with
readwise doctor. The artifact reports local config/auth/cache state, validates credentials when present, checks MCP tool discovery by default, and stays useful when the user is logged out or auth itself is broken.This also brings in the diagnostics surface the doctor command depends on:
--debug/READWISE_CLI_DEBUG=1now emits sanitized phase timings and correlated error details with arun_id, and the doctor artifact carries the same correlation ID for support handoff.Details
readwise doctorprints a JSON artifact with CLI/runtime metadata, config-file health, auth state, tool-cache state, and check results.readwise doctor --no-networkskips authenticated network checks for offline or privacy-sensitive support flows.doctornow bypass dynamic MCP tool discovery so diagnostic output is available before normal command registration succeeds.Validation
npm run buildnpm testnode --import tsx src/index.ts doctor --helpnode --import tsx src/index.ts doctor --no-networkwith no config file emitted a warning-status JSON artifact instead of failing the auth gate.Post-Deploy Monitoring & Validation
readwise doctor,READWISE_CLI_DEBUG,run_id,Token refresh failed,Could not fetch MCP tools, andNot logged in.readwise doctorwhile logged out, artifacts parse as JSON, support can correlate artifacts with debug logs viarun_id, and shared artifacts do not include raw access tokens, refresh tokens, client secrets, or authorization headers.--no-networkstill attempts MCP/OAuth calls, artifacts fail JSON parsing, or any shared artifact contains raw credential material.