Add Drush AI Command
>>> [!note] Migrated issue <!-- Drupal.org comment --> <!-- Migrated from issue #3525015. --> Reported by: [robloach](https://www.drupal.org/user/61114) Related to !609 >>> <h3 id="summary-problem-motivation">Problem/Motivation</h3> <p>While using the web chat interface is fine, I'm most often in the command line interface. It would be great to be able to interact with the AI module from Drush.</p> <h3 id="summary-steps-reproduce">Steps to reproduce</h3> <ol> <li>Open up your terminal prompt</li> <li>Run <code>drush ai "Hello?"</code></li> <li>Expect to see a response</li> </ol> <h3 id="summary-proposed-resolution">Proposed resolution</h3> <p>Add a Drush command to the AI module to engage the chat in a <a href="https://git.drupalcode.org/project/ai/-/merge_requests/609">Merge Request</a>.</p> <pre>$ drush ai "What are some modules great for displaying sliders?"<br>1. Views Slideshow: Creates a slideshow from any content.<br>2. Flex Slider: Integrates the FlexSlider library with fields, views, panels and other Drupal entities.<br>3. Revolution Slider: A robust slider with many customization options.<br>4. Nivo Slider: A simple and beautiful jQuery slider plugin.<br>5. Field Slideshow: Provides a field-based slideshow for image fields.<br>6. Galleria: Merges gallery and slideshow functionalities. <br><br>You can search for and install these modules via Drush using the drush dl [module-name] and drush en [module-name] commands.</pre><h3 id="summary-remaining-tasks">Remaining tasks</h3> <p>Would be awesome to have some of the following features...</p> <ul> <li>AI Assistant integration</li> <li>Streaming responses</li> <li>Allow chatting through an interactive shell</li> <li>Enable tooling capabilities from Drush, allowing the AI to run Drush commands?</li> </ul> <h3 id="summary-ui-changes">User interface changes</h3> <p>Nothing in the UI, except a new CLI <code>drush ai</code> command...</p> <pre>$ drush help ai<br>Send a message through to an AI provider.<br><br>Examples:<br> drush ai:chat "Hello, how are you?" Sends a message to your chat provider. <br><br>Arguments:<br> input The message to send to the chat. <br><br>Options:<br> --provider[=PROVIDER] Indicates a provider to use other than the default.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br> --model[=MODEL]&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Indicates which model to use, other than the default.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br> --system[=SYSTEM]&nbsp;&nbsp;&nbsp;&nbsp; Indicates the system message to use, other than the default.&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <br><br>Aliases: chat, ai</pre>
issue