Skip to content

feat: add /compare-models and /compare-models-free slash commands (t168)#660

Merged
marcusquinn merged 1 commit intomainfrom
feature/t168
Feb 8, 2026
Merged

feat: add /compare-models and /compare-models-free slash commands (t168)#660
marcusquinn merged 1 commit intomainfrom
feature/t168

Conversation

@marcusquinn
Copy link
Owner

@marcusquinn marcusquinn commented Feb 8, 2026

Summary

  • Add /compare-models and /compare-models-free slash commands for AI model capability comparison across providers
  • Create compare-models-helper.sh CLI with embedded database of 17 models from 6 providers (Anthropic, OpenAI, Google, DeepSeek, Meta)
  • Create compare-models.md subagent in tools/ai-assistants/ with full comparison workflow

What's New

Slash Commands

  • /compare-models [models...] [--task TASK] — Full comparison with optional live web fetch for latest pricing
  • /compare-models-free [models...] [--task TASK] — Offline comparison using embedded data only (no API calls, no web fetches)

Helper Script (compare-models-helper.sh)

7 subcommands: list, compare, recommend, pricing, context, capabilities, providers

Features:

  • Embedded model database with pricing, context windows, capabilities, and task suitability
  • Partial name matching (e.g. sonnet matches claude-sonnet-4)
  • Task recommendation engine (15 task types → best/runner-up/budget models)
  • Maps to aidevops internal tiers (haiku/flash/sonnet/pro/opus)
  • Cost analysis with cheapest input/output identification

Subagent

  • tools/ai-assistants/compare-models.md — Orchestrates the comparison workflow, optionally enriches with live pricing data

Files Changed

File Change
.agents/tools/ai-assistants/compare-models.md New subagent
.agents/scripts/compare-models-helper.sh New helper script (executable)
.agents/scripts/commands/compare-models.md New slash command
.agents/scripts/commands/compare-models-free.md New slash command (offline)
.agents/subagent-index.toon Updated script count and references

Quality

  • ShellCheck: zero warnings/errors
  • All 7 subcommands tested and verified
  • Follows existing patterns: local var="$1", explicit returns, shared-constants.sh sourcing

Summary by CodeRabbit

  • Documentation

    • Added guides for comparing AI models offline and with live data enrichment.
  • New Features

    • Introduced model comparison utility enabling side-by-side analysis by pricing (per 1M tokens), context windows, and capabilities.
    • Added task-based model recommendations and capability matrix viewer.
    • Enabled listing of available models and providers with integrated tier mapping.

… model capability comparison (t168)

Create subagent, helper script, and two slash commands for comparing AI model
capabilities, pricing, context windows, and task suitability across providers.

Components:
- .agents/tools/ai-assistants/compare-models.md: Subagent with full comparison workflow
- .agents/scripts/compare-models-helper.sh: CLI with embedded model database (17 models,
  6 providers) supporting list/compare/recommend/pricing/context/capabilities/providers
- .agents/scripts/commands/compare-models.md: Full comparison with optional live web fetch
- .agents/scripts/commands/compare-models-free.md: Offline comparison using embedded data only
- .agents/subagent-index.toon: Updated with new script and subagent reference

Design decisions:
- Embedded model data in helper script for offline/free usage (no API calls needed)
- Partial name matching for model queries (e.g. 'sonnet' matches 'claude-sonnet-4')
- Task recommendation engine maps 15 task types to best/runner-up/budget models
- Maps to aidevops internal tiers (haiku/flash/sonnet/pro/opus)
- Used heredoc redirect instead of pipe for while loops to avoid subshell variable scoping
@gemini-code-assist
Copy link

Summary of Changes

Hello @marcusquinn, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request significantly enhances the AI model management capabilities by introducing a robust system for comparing various AI models. It provides users with flexible tools to evaluate models based on pricing, context windows, and capabilities, either using an embedded, up-to-date database for offline use or by fetching live data for the most current information. This empowers users to make informed decisions when selecting AI models for specific tasks, improving efficiency and cost-effectiveness within the AI DevOps framework.

Highlights

  • New Slash Commands for AI Model Comparison: Introduces two new slash commands: '/compare-models' for comprehensive AI model comparison with optional live data fetching, and '/compare-models-free' for offline comparison using embedded data.
  • Dedicated Helper Script: Adds a new 'compare-models-helper.sh' script which acts as a CLI tool, featuring an embedded database of 17 AI models from 6 providers, task-based recommendations, cost analysis, and various comparison subcommands.
  • New Subagent for Workflow Orchestration: Implements a new 'compare-models.md' subagent to orchestrate the model comparison workflow, including steps for argument parsing, data gathering, live data enrichment, and structured result presentation.
  • Updated Tool Index: Updates the '.agents/subagent-index.toon' file to register the new model comparison tools and reflect the increased script count.
Changelog
  • .agents/scripts/commands/compare-models-free.md
    • Added a new slash command definition for offline AI model comparison.
    • Includes instructions for using the 'compare-models-helper.sh' script with various subcommands (list, compare, recommend, pricing, capabilities) without web fetches.
  • .agents/scripts/commands/compare-models.md
    • Added a new slash command definition for comprehensive AI model comparison.
    • Outlines instructions for using the helper script and mentions live data enrichment for pricing.
  • .agents/scripts/compare-models-helper.sh
    • Added a new executable shell script containing an embedded database of 17 AI models from 6 providers.
    • Implements multiple subcommands: 'list', 'compare', 'recommend', 'pricing', 'context', 'capabilities', and 'providers'.
    • Includes helper functions for data parsing, model searching, and formatting output.
    • Features task-to-model recommendations and aidevops tier mapping.
  • .agents/subagent-index.toon
    • Modified the 'tools/ai-assistants/' entry to include 'compare-models' in its list of associated tools.
    • Updated the script count reference from '[44]' to '[45]' to account for the new script.
  • .agents/tools/ai-assistants/compare-models.md
    • Added a new subagent definition for the AI model comparison workflow.
    • Details the usage of both '/compare-models' and '/compare-models-free' commands.
    • Outlines a 5-step workflow: parse arguments, gather data, enrich with live data (for full mode), present comparison, and provide actionable advice.
Activity
  • The pull request introduces new features for AI model comparison.
  • New slash commands '/compare-models' and '/compare-models-free' have been added.
  • A new helper script 'compare-models-helper.sh' and a subagent 'compare-models.md' have been created to support these commands.
  • The 'subagent-index.toon' file has been updated to integrate the new tools.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here.

You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Feb 8, 2026

Caution

Review failed

The pull request is closed.

Walkthrough

Introduces a comprehensive AI model comparison framework with offline-capable documentation files, a Bash helper script featuring embedded model data and CLI commands for listing/comparing/recommending models, and metadata updates. Enables model evaluation across capabilities, pricing, context windows, and task suitability without external API calls.

Changes

Cohort / File(s) Summary
Documentation
.agents/scripts/commands/compare-models.md, .agents/scripts/commands/compare-models-free.md, .agents/tools/ai-assistants/compare-models.md
Three new Markdown guides describing model comparison workflows: full mode with live data enrichment and offline/free mode using only embedded data. Includes usage examples, command patterns, output formatting specifications, and reference materials for capabilities matrices and tier mappings.
Helper Script
.agents/scripts/compare-models-helper.sh
New 541-line Bash utility with embedded model registry, tier mappings, and task recommendations. Provides CLI commands (list, compare, recommend, pricing, context, capabilities, providers) with formatted tabular output, cost analysis, and error handling. Strict bash options and shared constants integration.
Metadata
.agents/subagent-index.toon
Updates AI assistants tooling index to include compare-models capability and registers compare-models-helper.sh as a new script entry.

Estimated Code Review Effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly Related Issues

Poem

Models aligned in a structured view,
Pricing and context, capabilities too,
No network calls to cloud or beyond—
Embedded wisdom, a self-contained bond! 🤖✨

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/t168

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link

github-actions bot commented Feb 8, 2026

🔍 Code Quality Report

�[0;35m[MONITOR]�[0m Code Review Monitoring Report

�[0;34m[INFO]�[0m Latest Quality Status:
SonarCloud: 0 bugs, 0 vulnerabilities, 38 code smells

�[0;34m[INFO]�[0m Recent monitoring activity:
Sun Feb 8 20:49:10 UTC 2026: Code review monitoring started
Sun Feb 8 20:49:10 UTC 2026: SonarCloud - Bugs: 0, Vulnerabilities: 0, Code Smells: 38

📈 Current Quality Metrics

  • BUGS: 0
  • CODE SMELLS: 38
  • VULNERABILITIES: 0

Generated on: Sun Feb 8 20:49:13 UTC 2026


Generated by AI DevOps Framework Code Review Monitoring

@marcusquinn marcusquinn merged commit a8ee5cd into main Feb 8, 2026
7 of 10 checks passed
@sonarqubecloud
Copy link

sonarqubecloud bot commented Feb 8, 2026

Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request introduces a new feature to compare AI models through two slash commands, /compare-models and /compare-models-free, supported by a new helper script compare-models-helper.sh. The implementation is well-structured and the documentation is clear. My review focuses on the new bash script, where I've identified a high-severity security issue related to potential code injection in awk commands. I've provided a suggestion to refactor this for improved security and readability, in line with the repository's style guide on safe command construction.

Comment on lines +262 to +270
# Use awk for float comparison
if awk "BEGIN{exit !($input < $cheapest_input_price)}"; then
cheapest_input="$model_id"
cheapest_input_price="$input"
fi
if awk "BEGIN{exit !($output < $cheapest_output_price)}"; then
cheapest_output="$model_id"
cheapest_output_price="$output"
fi

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-high high

Directly embedding shell variables into the awk script string poses a potential code injection vulnerability and reduces readability. It's much safer to pass variables to awk using the -v flag. This change refactors the float comparison to use this safer method.

Suggested change
# Use awk for float comparison
if awk "BEGIN{exit !($input < $cheapest_input_price)}"; then
cheapest_input="$model_id"
cheapest_input_price="$input"
fi
if awk "BEGIN{exit !($output < $cheapest_output_price)}"; then
cheapest_output="$model_id"
cheapest_output_price="$output"
fi
# Use awk for float comparison, passing variables safely with -v
if awk -v price="$input" -v cheapest="$cheapest_input_price" 'BEGIN{exit !(price < cheapest)}'; then
cheapest_input="$model_id"
cheapest_input_price="$input"
fi
if awk -v price="$output" -v cheapest="$cheapest_output_price" 'BEGIN{exit !(price < cheapest)}'; then
cheapest_output="$model_id"
cheapest_output_price="$output"
fi
References
  1. The style guide (line 32) prohibits using eval and recommends safe ways to construct dynamic commands. While not strictly eval, injecting shell variables directly into an awk script string is a similar code injection risk that should be avoided. (link)

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