Recovery: re-land fn goals CLI + pi tools onto main

This commit is contained in:
gsxdsm
2026-05-28 19:44:06 -07:00
parent be0be507b3
commit 009d569bdd
12 changed files with 554 additions and 1 deletions

View File

@@ -127,6 +127,7 @@ async function loadCommandHandlers() {
const { runBackupCreate, runBackupList, runBackupRestore, runBackupCleanup } = await import("./commands/backup.js");
const { runMemoryBackupCreate, runMemoryBackupList, runMemoryBackupRestore } = await import("./commands/memory-backup.js");
const { runMissionCreate, runMissionList, runMissionShow, runMissionDelete, runMissionActivateSlice } = await import("./commands/mission.js");
const { runGoalsList, runGoalsCreate, runGoalsArchive } = await import("./commands/goals.js");
const { runProjectList, runProjectAdd, runProjectRemove, runProjectShow, runProjectInfo, runProjectSetDefault, runProjectDetect } = await import("./commands/project.js");
const { runNodeList, runNodeConnect, runNodeDisconnect, runNodeShow, runNodeHealth, runMeshStatus } = await import("./commands/node.js");
const { runInit } = await import("./commands/init.js");
@@ -192,6 +193,9 @@ async function loadCommandHandlers() {
runMissionShow,
runMissionDelete,
runMissionActivateSlice,
runGoalsList,
runGoalsCreate,
runGoalsArchive,
runProjectList,
runProjectAdd,
runProjectRemove,
@@ -309,6 +313,9 @@ PR:
fn mission show | info <id> Show mission details
fn mission delete <id> [--force] Delete a mission
fn mission activate-slice <id> Mark a slice active
fn goals list [--status STATE] List goals (default: active)
fn goals create [title] [desc] Create a new goal
fn goals archive <id> Archive a goal
fn project list | ls [--json] List all registered projects
fn project add [name] [path] [opts] Register a new project
fn project remove | rm <name> [--force]
@@ -593,6 +600,9 @@ async function main() {
runMissionShow,
runMissionDelete,
runMissionActivateSlice,
runGoalsList,
runGoalsCreate,
runGoalsArchive,
runProjectList,
runProjectAdd,
runProjectRemove,
@@ -1334,6 +1344,37 @@ async function main() {
break;
}
case "goals": {
const subcommand = args[1];
switch (subcommand) {
case "list":
case "ls": {
const statusIdx = args.indexOf("--status");
const status = statusIdx !== -1 && statusIdx + 1 < args.length
? args[statusIdx + 1] as "active" | "archived" | "all"
: "active";
await runGoalsList(projectName, { status });
break;
}
case "create": {
const title = args[2];
const description = args.length > 3 ? args.slice(3).join(" ") : undefined;
await runGoalsCreate(title, description, projectName);
break;
}
case "archive": {
const id = args[2];
await runGoalsArchive(id, projectName);
break;
}
default:
console.error(`Unknown subcommand: goals ${subcommand || ""}`);
console.log("Try: fn goals list | create | archive");
process.exit(1);
}
break;
}
case "settings": {
const subcommand = args[1];
if (!subcommand || subcommand === "show") {