Lines 454-494javascript
455 description: opts.description,
456 complexity: opts.complexity,
457 tags: opts.tags ? opts.tags.split(",").map((t) => t.trim()) : []
460 console.log(JSON.stringify(task, null, 2));
462taskCmd.command("list").description("List tasks").option("--project <id>", "filter by project id").action(async (opts) => {
463 const query = opts.project ? `?projectId=${opts.project}` : "";
464 const tasks = await apiFetch(`/tasks${query}`);
465 console.log(JSON.stringify(tasks, null, 2));
467taskCmd.command("run").description("Run a task through the router").argument("<id>", "task id").action(async (id) => {
468 const result = await apiFetch(`/tasks/${id}/run`, { method: "POST" });
469 console.log(JSON.stringify(result, null, 2));
471taskCmd.addCommand(taskFeedCmd);
473// ../../apps/cli/src/commands/ui.ts
474import { Command as Command4 } from "commander";
475import { spawn } from "child_process";
476import { existsSync as existsSync2 } from "fs";
477import net from "net";
478import path2 from "path";
479import { fileURLToPath as fileURLToPath2 } from "url";
480import open from "open";
481import { render } from "ink";
482import React2 from "react";
483var __filename2 = fileURLToPath2(import.meta.url);
484var __dirname2 = path2.dirname(__filename2);
485var DEFAULT_PORT = 4e3;
487var DEFAULT_GRPC_PORT = 50051;
488var MAX_GRPC_PORT = 50061;
489function findAvailablePort(preferred = DEFAULT_PORT, max = MAX_PORT) {
490 return new Promise((resolve, reject) => {
491 if (preferred > max) {
492 reject(new Error(`No available ports between ${DEFAULT_PORT.toString()} and ${max.toString()}`));