Skip to content

Commit 5762a8a

Browse files
committed
feat(cli): add --name flag to update node command
Fixes issue #17: Users can now update the name field of existing nodes via \`sysprom update node <id> --name "New name"\`. Previously, only --status and --lifecycle could be updated; text fields like name, description, context, and rationale were documented as updatable but not actually exposed in the CLI. This change makes the update command consistent with the add command, allowing all text fields (name, description, context, rationale) to be modified after node creation. Closes #17
1 parent 55f8dc5 commit 5762a8a

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

src/cli/commands/update.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,7 @@ const updateNodeArgs = z.object({
6363
id: z.string().describe("node ID to update"),
6464
});
6565
const updateNodeOpts = mutationOpts.extend({
66+
name: z.string().optional().describe("update node name"),
6667
description: z.string().optional().describe("update node description"),
6768
status: NodeStatus.optional().describe("set lifecycle state to true"),
6869
context: z.string().optional().describe("update node context"),
@@ -118,6 +119,7 @@ const nodeSubcommand: CommandDef = {
118119

119120
const fields: Record<string, unknown> = {};
120121

122+
if (opts.name !== undefined) fields.name = opts.name;
121123
if (opts.description !== undefined) fields.description = opts.description;
122124
if (opts.context !== undefined) fields.context = opts.context;
123125
if (opts.rationale !== undefined) fields.rationale = opts.rationale;
@@ -135,7 +137,7 @@ const nodeSubcommand: CommandDef = {
135137
if (Object.keys(fields).length === 0) {
136138
console.error("No fields specified to update.");
137139
console.error(
138-
"Use --description, --status, --context, --rationale, --selected, or --lifecycle.",
140+
"Use --name, --description, --status, --context, --rationale, --selected, or --lifecycle.",
139141
);
140142
process.exit(1);
141143
}

0 commit comments

Comments
 (0)