imhcode 2.0.0 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/imhcode.js +42 -1
  2. package/package.json +1 -1
package/bin/imhcode.js CHANGED
@@ -3046,6 +3046,17 @@ async function runGuiCommand(restArgs) {
3046
3046
  // 3. Inject customized views, routes, models, migrations and controllers
3047
3047
  setupLaravelGui(guiPath);
3048
3048
 
3049
+ // 3b. Automatically register the folder from which imhcode gui was executed
3050
+ const currentPath = process.cwd();
3051
+ const folderName = path.basename(currentPath);
3052
+ try {
3053
+ const escapedPath = currentPath.replace(/\\/g, '\\\\');
3054
+ execSync(`php artisan imhcode:register "${folderName}" "${escapedPath}"`, { cwd: guiPath, stdio: 'ignore' });
3055
+ console.log(`āœ… Automatically registered project "${folderName}" (${currentPath})`);
3056
+ } catch (e) {
3057
+ // Suppress errors if database is not migrated yet or locked
3058
+ }
3059
+
3049
3060
  // 4. Serve
3050
3061
  console.log(`\nšŸš€ Starting Laravel server on http://localhost:${port}`);
3051
3062
  if (openBrowser) {
@@ -3107,7 +3118,7 @@ class Project extends Model {
3107
3118
  namespace App\\Http\\Controllers;
3108
3119
 
3109
3120
  use Illuminate\\Http\\Request;
3110
- use Illuminate\\Support\Facades\\Process;
3121
+ use Illuminate\\Support\\Facades\\Process;
3111
3122
  use Illuminate\\Support\\Facades\\DB;
3112
3123
 
3113
3124
  class DashboardController extends Controller {
@@ -3457,6 +3468,36 @@ return new class extends Migration {
3457
3468
  `;
3458
3469
  fs.writeFileSync(path.join(viewsDir, 'project.blade.php'), projectView, 'utf8');
3459
3470
 
3471
+ // Generate Command: RegisterProject.php
3472
+ const consoleDir = path.join(guiPath, 'app', 'Console', 'Commands');
3473
+ if (!fs.existsSync(consoleDir)) fs.mkdirSync(consoleDir, { recursive: true });
3474
+ const commandContent = `<?php
3475
+ namespace App\\Console\\Commands;
3476
+
3477
+ use Illuminate\\Console\\Command;
3478
+ use Illuminate\\Support\\Facades\\DB;
3479
+
3480
+ class RegisterProject extends Command {
3481
+ protected $signature = 'imhcode:register {name} {path}';
3482
+ protected $description = 'Register a project in the dashboard';
3483
+
3484
+ public function handle() {
3485
+ $name = $this->argument('name');
3486
+ $path = $this->argument('path');
3487
+
3488
+ DB::table('projects')->updateOrInsert(
3489
+ ['path' => $path],
3490
+ [
3491
+ 'name' => $name,
3492
+ 'created_at' => now(),
3493
+ 'updated_at' => now()
3494
+ ]
3495
+ );
3496
+ }
3497
+ }
3498
+ `;
3499
+ fs.writeFileSync(path.join(consoleDir, 'RegisterProject.php'), commandContent, 'utf8');
3500
+
3460
3501
  // Trigger migration
3461
3502
  try {
3462
3503
  execSync('php artisan migrate --force', { cwd: guiPath, stdio: 'ignore' });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "imhcode",
3
- "version": "2.0.0",
3
+ "version": "2.0.1",
4
4
  "description": "IMH-Code — Imam Hussain Coding Harness Platform. A fast-first multi-agent AI coding framework with intelligent model routing. 19 generic role-based agents (planner, nextjs-executor, laravel-executor, etc.), configurable testing strategy, and 7 token-saving optimizations for rapid MVP development.",
5
5
  "main": "index.js",
6
6
  "bin": {