Skip to content

Diagnostics (doctor) ​

mogick doctor inspects the current Mogick CLI environment and generates a structured diagnostic report. It prints Markdown by default, supports JSON through --json or --format json, and can write directly to a file with --export <path>. The default checks include terminal compatibility but do not make network requests or run interactive font checks.

The report covers the operating system and shell, configuration integrity, models and providers, the memory database, MCP server connections, and loaded Skills. Enable --check-network explicitly to test connectivity, chat completions, streaming, usage metadata, and related service capabilities. Each report is a reproducible troubleshooting snapshot that you can attach to a support request.

Usage ​

mogick doctor                          # Run diagnostics and print a Markdown report
mogick doctor --json                   # Run diagnostics and print JSON
mogick doctor --format json            # Select JSON with the --format option
mogick doctor --export ./report.md      # Write the raw report to a file
mogick doctor --check-network          # Also probe network service availability
mogick doctor --check-terminal-font    # Interactively inspect the font and terminal grid
mogick doctor --all                    # Run the network and terminal checks together

Options ​

OptionDescription
--jsonOutput JSON; equivalent to --format json
--format md|jsonSpecify output format: md (Markdown, default) or json
--export <path>Write the report to the specified file
--check-networkProbe the reachability of network services (such as API endpoints)
--check-terminal-fontInteractively check Unicode borders, Chinese width and status symbols
--allPerform both network probing and interactive terminal/font checking
--verboseIncrease output verbosity and show more diagnostic details
--logs-path <file>Write diagnostic logs to the specified file

Output format ​

The JSON output has the following top-level structure:

FieldDescription
schema_versionReport format version
generated_atGenerated timestamp
requestDiagnostic request parameters, such as verbose and check_network
summarySummary status (status, warning_count, error_count)
sectionsDiagnostic modules containing id, title, status, items, and details

Status values are ok, warn, error, or exception.

Checks ​

A complete report covers these modules:

Section IDChecks
runtimeOperating system, architecture, Go version, CLI version, working directory, and executable path
configGlobal and project-level config.json paths and whether they exist
modelsLocal model and provider configuration, including model list, provider types, and counts
memorysessions.sqlite path, existence, file size
mcpEach MCP server's name, type, transport, and enabled state
skillsSkills directory and file status
authAuthentication-token status and expiration
terminalstdin/stdout, TERM, terminal size, UTF-8 locale and Windows VT capabilities

Having no MCP servers configured is a valid empty state and does not produce a warning. The summary and Needs attention list derive their warning counts from the same checks.

Network check ​

--check-network makes real network requests and adds a network section to the report. When troubleshooting model connectivity, focus on these fields:

Field or check itemMeaning
base_urlThe actual API base used to request model services
server_urlThe provider's original service URL; with llm-store, it may differ from base_url
providerThe active provider type
timeout_secondsTotal timeout for the network checks
server_reachableBasic HTTP reachability check on base_url
chat_completionWhether a non-streaming Chat Completions request succeeds
chat_usageWhether a non-streaming response includes usage metadata
chat_tool_callWhether the model can return a tool call
stream_responseWhether a streaming response completes and returns text
stream_usageWhether a streaming response includes usage metadata
embeddingsWhether an embedding request succeeds when an embedding model is configured
rerankWhether a reranking request succeeds when a reranking model is configured
llm_store_modelinfoWhether the remote model catalog can be retrieved in an llm-store setup

Common usage fields include prompt_tokens, completion_tokens, total_tokens, and cached_tokens. If chat_completion succeeds but chat_usage or stream_usage reports a warning, the service is usually available but does not return complete token-usage metadata.

Example ​

Run the default checks and print a Markdown report:

bash
mogick doctor

Print JSON for automated parsing:

bash
mogick doctor --json

Export a report for CI artifacts or team sharing:

bash
mogick doctor --export ./mogick-doctor-report.md

Include verbose output and network checks:

bash
mogick doctor --verbose --check-network

Filter errors from JSON output in an automation script:

bash
mogick doctor --json | jq '.sections[] | select(.status == "error")'