[CLI] Add Debug Diagnostics#12
Closed
rasulkireev wants to merge 2 commits into
Closed
Conversation
rasulkireev
force-pushed
the
rasul/cli-diagnostics
branch
from
June 30, 2026 17:06
d8dac20 to
3466ffa
Compare
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
Readwise CLI runs can now produce a support-safe diagnostic trace on demand. Users can enable
--debugorREADWISE_CLI_DEBUG=1and get arun_id, CLI/Node/platform metadata, phase timings, and sanitized error details on stderr without exposing tokens or full tool arguments.The debug trace covers the paths that mattered in the recent CLI investigation: config load, token validation/refresh, OAuth network steps, MCP connect/list/call phases, and client shutdown. This keeps normal CLI output unchanged while giving support enough detail to separate local auth, MCP connection, and tool-call failures.
Testing
npm testnpm run buildnode dist/index.js --debug --versionPost-Deploy Monitoring & Validation
Validation window: first 48 hours after npm publish. Owner: CLI/support on-call.
Search terms/support artifacts to watch:
[readwise-cli debug]READWISE_CLI_DEBUG=1run_idphase_errormcp.connect,mcp.listTools,mcp.callTool,oauth.refreshTokenExpected healthy signals:
--debugandREADWISE_CLI_DEBUG=1produce structured JSON lines on stderr.--json,--version, and command output.Failure signals and mitigation:
run_id, or debug output on stdout: patch the CLI before broad support rollout.