Summary
Add a semctl template update (or edit) command to mutate an existing template's fields — repository, playbook, inventory, environment, name, arguments, etc. — without recreating it.
Motivation
semctl template currently exposes only clone, delete, get, list, tasks. There is no way to change an existing template's configuration from the CLI. Today the only options are the Semaphore web UI or a raw PUT /api/project/{id}/templates/{tid} curl call.
Real case that triggered this: a template ("003 [RASPI] Install Tailscale") was pointed at the wrong repository, so every run failed with the playbook ... could not be found. The fix is a one-field change (repository_id), but there is no semctl command for it — had to fall back to the REST API.
Proposed behavior
semctl template update <id|name> \
--repository <id|name> \
--playbook <path> \
--inventory <id|name> \
--environment <id|name> \
--name <string> \
--arguments <json>
- Only the flags passed are changed; everything else preserved (read-modify-write against the existing template so unset fields are not wiped).
- Accept either numeric IDs or resolvable names for repository/inventory/environment (consistent with other subcommands).
- Honor
--json / -o output like get.
- Underlying call is
PUT /api/project/{project}/templates/{id} with the full template body.
Notes
Prior template bugs (#43 partial-field get, #65/#66 clone) show the template body round-trip already needs care — please confirm a partial update does not blank vaults, view_id, environment_ids, or survey vars. A read-modify-write (GET then PUT) is the safe implementation.
Summary
Add a
semctl template update(oredit) command to mutate an existing template's fields — repository, playbook, inventory, environment, name, arguments, etc. — without recreating it.Motivation
semctl templatecurrently exposes onlyclone,delete,get,list,tasks. There is no way to change an existing template's configuration from the CLI. Today the only options are the Semaphore web UI or a rawPUT /api/project/{id}/templates/{tid}curl call.Real case that triggered this: a template ("003 [RASPI] Install Tailscale") was pointed at the wrong repository, so every run failed with
the playbook ... could not be found. The fix is a one-field change (repository_id), but there is nosemctlcommand for it — had to fall back to the REST API.Proposed behavior
--json/-ooutput likeget.PUT /api/project/{project}/templates/{id}with the full template body.Notes
Prior template bugs (#43 partial-field
get, #65/#66 clone) show the template body round-trip already needs care — please confirm a partial update does not blankvaults,view_id,environment_ids, or survey vars. A read-modify-write (GET then PUT) is the safe implementation.