How ranjithrajv/opencode-model-recommender works
This is an OpenCode plugin that turns the host’s model catalog and current-session model into ranked pricing recommendations, model detail reports, and sidebar picks. The graph follows those distinct user-facing stages and includes the shared pricing-metrics layer. README documents commands and sidebar capabilities whose full implementations were not sampled; those links are shown only where documented, and unsampled internals are not inferred.
Main entry points: index.ts Recommendation and details tools · tui.tsx Sidebar picks widget · metrics.ts Cost metrics
Components 13
Plugin tools
- Recommendation and details tools
index.ts - Catalog filtering and ranking
index.ts - Recommendation and price reports
index.ts - Slash commands
index.ts
Pricing analysis
- Cost metrics
metrics.ts
Sidebar experience
- Sidebar picks widget
tui.tsx - Provider view picker
tui.tsx - Cached catalog picks
tui.tsx
Other components
- OpenCode user
- OpenCode host
- Model catalog
- Plugin kit
- OpenCode agent
Connections 17
- OpenCode user → OpenCode host: uses plugin
README.md - OpenCode host → Recommendation and details tools: loads tools
index.ts - Recommendation and details tools → Model catalog: lists models
index.ts - Recommendation and details tools → Catalog filtering and ranking: filters and ranks
index.ts - Catalog filtering and ranking → Cost metrics: computes costs
index.ts - Recommendation and details tools → Recommendation and price reports: formats results
index.ts - Recommendation and price reports → OpenCode user: returns reports
README.md - OpenCode host → Slash commands: registers commands
index.ts - Slash commands → OpenCode agent: prompts agent
index.ts - OpenCode agent → Recommendation and details tools: runs tool
README.md - OpenCode host → Sidebar picks widget: loads widget
README.md - Sidebar picks widget → Cached catalog picks: loads cached picks
tui.tsx - Cached catalog picks → Model catalog: loads models
tui.tsx - Sidebar picks widget → Provider view picker: filters picks
tui.tsx - Provider view picker → Plugin kit: uses picker helpers
tui.tsx - Cached catalog picks → Cost metrics: computes costs
tui.tsx - Sidebar picks widget → OpenCode user: shows picks
README.md