Split out from #31 (the optional follow-ups listed there; #31's acceptance criteria — update --plan, --clear-plan, bulk plan/move-plan, error handling, docs — are done and closed by #91).
Two plan-lifecycle gaps remain on the CLI:
1. Plans cannot be renamed or edited from the CLI
todos plans supports --add, --show, --delete, --complete, --artifact, --write-artifacts — but there is no way to change a plan's name, slug, description, or status back off completed.
The backend already exists: updatePlan(id, { name, description, status }, db) in src/db/plans.ts, covered by src/db/plans.test.ts. Only the CLI surface (and a cloud/PATCH /v1/plans/<id> path, which the fixture server in remote-entrypoint.test.ts already models) is missing.
Suggested surface, mirroring projects --update / lists --update:
todos plans --update <id-or-slug> --name "New name" --description "..." --slug new-slug
todos plans --rename <id-or-slug> "New name" # convenience alias
2. Deleting a plan silently orphans its tasks
todos plans --delete <id> relies on ON DELETE SET NULL, so every task's plan_id quietly becomes null with no warning and no migration path. Suggested:
todos plans --delete <id> --move-tasks-to <other-plan-id> # reassign, then delete
todos plans --delete <id> # warn when tasks would be orphaned
Both should work under a remote (self_hosted/cloud) authority as well as local SQLite — see the Stage-A gating pattern and the built-entrypoint lifecycle test used by #91.
Rough size: small-to-medium. Files: src/cli/commands/task-commands.ts (or wherever plans is registered), src/cli/cloud-router.ts, src/cli/stage-a.ts, src/server/routes.ts + openapi.ts if a plan PATCH/DELETE query param is added, plus src/cli/cli-qol.test.ts and src/cli/remote-entrypoint.test.ts coverage and a README/CHANGELOG update.
Split out from #31 (the optional follow-ups listed there; #31's acceptance criteria —
update --plan,--clear-plan,bulk plan/move-plan, error handling, docs — are done and closed by #91).Two plan-lifecycle gaps remain on the CLI:
1. Plans cannot be renamed or edited from the CLI
todos planssupports--add,--show,--delete,--complete,--artifact,--write-artifacts— but there is no way to change a plan's name, slug, description, or status back offcompleted.The backend already exists:
updatePlan(id, { name, description, status }, db)insrc/db/plans.ts, covered bysrc/db/plans.test.ts. Only the CLI surface (and a cloud/PATCH /v1/plans/<id>path, which the fixture server inremote-entrypoint.test.tsalready models) is missing.Suggested surface, mirroring
projects --update/lists --update:2. Deleting a plan silently orphans its tasks
todos plans --delete <id>relies onON DELETE SET NULL, so every task'splan_idquietly becomes null with no warning and no migration path. Suggested:Both should work under a remote (
self_hosted/cloud) authority as well as local SQLite — see the Stage-A gating pattern and the built-entrypoint lifecycle test used by #91.Rough size: small-to-medium. Files:
src/cli/commands/task-commands.ts(or whereverplansis registered),src/cli/cloud-router.ts,src/cli/stage-a.ts,src/server/routes.ts+openapi.tsif a plan PATCH/DELETE query param is added, plussrc/cli/cli-qol.test.tsandsrc/cli/remote-entrypoint.test.tscoverage and a README/CHANGELOG update.