Skip to content

feat(cli): add agk doctor environment diagnostics#14

Open
kunalkushwaha wants to merge 1 commit into
mainfrom
feat/agk-doctor
Open

feat(cli): add agk doctor environment diagnostics#14
kunalkushwaha wants to merge 1 commit into
mainfrom
feat/agk-doctor

Conversation

@kunalkushwaha

Copy link
Copy Markdown
Member

What

Adds a preflight agk doctor command that surfaces common first-run failures before an agent runs, instead of letting them appear as cryptic runtime errors deep inside the framework.

This is feature B3 from the FEATURES.md roadmap.

Checks

Check OK Warn Error
Go toolchain go present, ≥ go1.24 missing / too old
LLM credentials a cloud key is set no cloud keys set (with --provider X) X's key missing
Ollama reachable + model count not reachable
Template registry reachable + template count unreachable
Project workspace go.mod found (+ trace run count) not in a project dir

Exits non-zero if any error-level check fails, so it can gate a CI preflight step. --provider openai|anthropic|azure|ollama makes that provider's credential a hard requirement.

Example

🩺 AGK Doctor — environment diagnostics
  ✓ Go toolchain             go1.26.4
  ⚠ LLM credentials          no cloud provider keys set
    ↳ export OPENAI_API_KEY / ANTHROPIC_API_KEY, or use Ollama locally
  ✓ Ollama                   running at http://localhost:11434 (6 model(s))
  ✓ Template registry        reachable (3 template(s))
  ✓ Project                  go.mod found; 0 trace run(s) in .agk/runs

⚠ 1 warning(s) — you can still build and run

Testing

  • go build, go vet, go test ./... green; gofmt clean.
  • Verified live: default run (Ollama detected with real model count, registry reachable), --provider openai with key unset (→ error, exit 1), key configured (→ OK), and outside a project dir (→ workspace warning).

Note on branch

Branched from main, so the roadmap docs (FEATURES.md/CLAUDE.md, introduced in #13) aren't in this PR. I'll mark B3 as shipped in FEATURES.md once #13 lands. There will be a trivial commands-table conflict with #13 — straightforward to resolve.

🤖 Generated with Claude Code

Adds a preflight `agk doctor` command that surfaces common first-run failures
before an agent runs, instead of letting them appear as cryptic runtime errors.

Checks:
- Go toolchain present and >= go1.24
- LLM credentials (OPENAI/ANTHROPIC/AZURE keys); `--provider` makes a specific
  provider's key required (error if missing)
- Ollama reachability + model count (OLLAMA_HOST aware)
- Template registry reachability
- Current project workspace (.agk/ trace run count)

Exits non-zero on any error-level check so it can gate CI preflight.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant