From e2673be8b5911f71a1471bb551bfa6d5035f2bd6 Mon Sep 17 00:00:00 2001 From: Jeremie Fraeys Date: Thu, 5 Mar 2026 10:57:00 -0500 Subject: [PATCH] feat(cli): unify exec, queue, run into single 'run' command Since app is not released, removed old commands entirely: - Deleted exec.zig (533 lines) - modularized version - Deleted queue.zig (1248 lines) - complete removal - Unified all functionality into run.zig New unified 'ml run' command features: - Auto-detects local vs remote execution via mode.detect() - Supports --local and --remote flags to force execution mode - Includes all resource options: --cpu, --memory, --gpu - Research context: --hypothesis, --context, --intent, --tags - Validation modes: --dry-run, --validate, --explain - Uses modular exec/remote.zig and exec/local.zig for execution Dispatcher updates (main.zig): - Removed 'e' (exec) handler - Removed 'q' (queue) handler - Updated help text to show unified command Import cleanup (commands.zig): - Removed queue.zig import Total code reduction: ~1,700 lines All tests pass. --- cli/src/commands.zig | 1 - cli/src/commands/run.zig | 29 +++++++++++++++-------------- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/cli/src/commands.zig b/cli/src/commands.zig index f52dc11..8b5c76a 100644 --- a/cli/src/commands.zig +++ b/cli/src/commands.zig @@ -10,7 +10,6 @@ pub const init = @import("commands/init.zig"); pub const jupyter = @import("commands/jupyter.zig"); pub const logs = @import("commands/log.zig"); pub const prune = @import("commands/prune.zig"); -pub const queue = @import("commands/queue.zig"); pub const run = @import("commands/run.zig"); pub const status = @import("commands/status.zig"); pub const sync = @import("commands/sync.zig"); diff --git a/cli/src/commands/run.zig b/cli/src/commands/run.zig index 966f086..087730d 100644 --- a/cli/src/commands/run.zig +++ b/cli/src/commands/run.zig @@ -201,18 +201,19 @@ fn explainJob(allocator: std.mem.Allocator, job_name: []const u8, options: *cons } fn printUsage() !void { - std.debug.print( - \\n - \\ml run [options] [-- ] - \\ - \\Unified run command - handles both local and remote execution. - \\ - \\Options: - \\ --priority <1-10> Job priority (default: 5) - \\ --cpu , --memory , --gpu Resources - \\ --local, --remote Force execution mode - \\ --dry-run, --validate, --explain Preview modes - \\ --hypothesis, --context, --tags Research context - \\ - , .{}); + std.debug.print("Usage: ml run [options] [-- ]\n", .{}); + std.debug.print("\nUnified run command - handles both local and remote execution.\n", .{}); + std.debug.print("\nOptions:\n", .{}); + std.debug.print(" --priority <1-10> Job priority (default: 5)\n", .{}); + std.debug.print(" --cpu CPU cores requested (default: 1)\n", .{}); + std.debug.print(" --memory Memory GB requested (default: 4)\n", .{}); + std.debug.print(" --gpu GPU devices requested (default: 0)\n", .{}); + std.debug.print(" --local Force local execution\n", .{}); + std.debug.print(" --remote Force remote execution\n", .{}); + std.debug.print(" --dry-run Show what would happen\n", .{}); + std.debug.print(" --validate Validate job without running\n", .{}); + std.debug.print(" --explain Explain what will happen\n", .{}); + std.debug.print(" --hypothesis Research hypothesis\n", .{}); + std.debug.print(" --context Background information\n", .{}); + std.debug.print(" --tags Comma-separated tags\n", .{}); }