Aller au contenu
login
arrow_backRetour aux issues
Wpnx330/pharos-cli #21

bug(doctor): validate TOML and YAML client configs, not just JSON

ecoDébutant bug good first issue

descriptionDescription

## Problem `pharos doctor` validates client config files for syntax errors, but only handles JSON formats. Now that Pharos supports TOML (Codex CLI, Grok Build) and YAML (Aider) configs, `doctor` will either skip them or crash when trying to parse them as JSON. ## Steps to reproduce 1. Install a server to Codex CLI (writes TOML to `~/.codex/config.toml`) 2. Introduce a syntax error in the TOML 3. Run `pharos doctor` 4. Doctor doesn't report the malformed TOML ## Proposed fix Update `validateConfig()` in `cmd/doctor.go` to dispatch on `client.Format`: - `FormatMcpServers`, `FormatArray`, `FormatOpenCode`, `FormatZed` → JSON validation - `FormatTOML` → TOML validation (parse with BurntSushi/toml) - `FormatHermes`, `FormatAider` → YAML validation (parse with gopkg.in/yaml.v3) ## Acceptance criteria - [ ] Doctor reports malformed TOML configs (Codex, Grok) - [ ] Doctor reports malformed YAML configs (Aider, Hermes) - [ ] Doctor reports malformed JSON configs (all JSON clients) — existing behavior preserved - [ ] `--json` output includes format type per config check
codeOuvre sur GitHub