This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| declare(strict_types=1); // enforce strict typing so PHP catches bad stuff early | |
| // Simple coding agent in a single PHP 8.4 file inspired by Radan Skorić's 94‑line Ruby agent. | |
| // https://radanskoric.com/articles/coding-agent-in-ruby | |
| // Gives OpenAI‑backed chat plus four tools: read_file, list_files, edit_file, run_shell_command. | |
| // Every line is commented with the "why" to align with your preference. | |
| $apiKey = getenv('OPENAI_API_KEY'); // Pull the API key from env vars for security and portability | |
| if (!$apiKey) { // Fail fast if we can't talk to the model |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| namespace App\Console\Commands; | |
| use Exception; | |
| use Illuminate\Console\Command; | |
| use Illuminate\Support\Facades\DB; | |
| /** | |
| * SingleStore pre-checks command for migration evaluation. |
OlderNewer