Repository navigation
Add plan action list/get commands - #325
Conversation
Wires the new plan-actions API (ListPlanActions, GetPlanAction) into the CLI as `signadot plan action list` and `signadot plan action get NAME` (alias `a`). The get view shows the action header (Enabled, Description, Revision, Image, Requires), parsed Inputs/Outputs/Validations tables, and the raw markdown body. When stdout is a TTY, the body is rendered through glamour for headings, tables, code blocks, and inline code; when piped, raw markdown is preserved so output stays usable for grep/redirect. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
From claude:
|
- formatAny: render object/array defaults as JSON so {"a": 1} prints
faithfully instead of map[a:1]; the reader can paste it back into
a plan spec. Scalars still pass through fmt.Sprintf.
- formatSchema: recognise enum schemas with an enum(N) summary so
enum-restricted fields don't fall through to the generic (custom)
bucket.
- formatImage: render the input-bound case as (from input "name")
rather than input=name, which read ambiguously next to literal
image refs that may legitimately contain '='.
- printBody: surface write errors from fmt.Fprint(ln) instead of
silently swallowing them, so a broken pipe doesn't look like
success.
Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]>
|
@scott-cotton, feedback addressed in 2a031d6. |
) * plan: align display across plan-family commands; surface CreatedBy The plan-family commands had drifted from each other in several small ways since the previous PR. Audit + fixes: - plan tag get rendered the embedded plan as a thin metadata blurb (ID, Steps count, prompt first line, Created) — the shape we replaced in plan get during the previous PR. It now embeds the full plan body (Inputs / Steps / Outputs sections) using the same arrow form plan get uses. Plan-level metadata is omitted: ID and SelectionHint already appear in the tag header above; the rest is one signadot plan get away. The tag header also gains a Selection Hint: line so plan tag list and plan tag get agree on what summarises a tag. To make this shareable without a circular import (plan imports plantag for tag-application after compile/create), the plan-detail printer moved into the planshared package as PrintPlanDetails alongside a PrintPlanBody variant that skips the top-level header for embedded use. plan/printers.go collapses to a thin wrapper. - Surface PlanStatus.CreatedBy (added in the latest go-sdk drop) as a Created By: row in the plan header — used by plan get, compile, create, recompile, run, and the embedded view in plan tag get (where it renders as Plan Created By: to disambiguate against the tag-level Created/Updated fields). Resolution by ActorType: user → email, api_key → "api key" + masked id, system → "system". - plan action get's Outputs table no longer carries REQUIRED / DEFAULT columns. Those are input concepts that always rendered as false / empty for outputs (review feedback on PR #325 that hadn't landed). Separate row type with just NAME / SCHEMA. - planrunnergroup/printers.go: migrate inline time.Parse + timeago.NoMax to utils.TimeAgo, matching the cleanup we'd already done in plantag and planexec. Drops the time and timeago imports. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> * planshared: render empty strings as the literal "" in FormatValue Empty-string values previously collapsed to the same shape as nil/missing values: name (set in plan) with no detail. That hides the distinction between "value not provided" and "deliberately empty," which matters when an action interprets the empty string specifically — e.g. run-image treats image:"" as "run on the host runner without a container," a meaningful authoring choice the reader needs to see. Now an empty string renders as the literal "" (with quotes): image ← "" (set in plan) and an unset/nil value still renders as no-detail: image (set in plan) Same disambiguation applies wherever FormatValue is used (plan get's plan-level Inputs, plan x get's resolved inputs, plan get's declared param defaults, output rows). Scalars still pass through unchanged; objects and arrays continue to round-trip through json.Marshal. Co-Authored-By: Claude Opus 4.7 (1M context) <[email protected]> --------- Co-authored-by: Claude Opus 4.7 (1M context) <[email protected]>
Summary
signadot plan action listandsignadot plan action get NAME(aliasa), under the existingplanparent.listshowsNAME / MANAGED BY / ENABLED / REVISION / DESCRIPTION / UPDATED—MANAGED BYdistinguishes system actions from org-owned actions.getshows action header (Enabled, Description, Revision, Image, Requires), parsed Inputs/Outputs/Validations tables, and the action body. Body is rendered throughglamourwhen stdout is a TTY (headings, tables, code blocks, inline code); raw markdown when piped.-o json/-o yamlreturns the rawPlanActionpayload at both list and get.Builds on go-sdk
feature-plan(PlanActionStatus.Enabled,PlanActionStatus.BodyImage).Test plan
signadot plan action listshows all visible actions with the columns abovesignadot plan action get checkshows header + Inputs/Outputs/Validations tables + rendered bodysignadot plan action get k6shows theImage:line populated fromStatus.BodyImagesignadot plan action get k6 | cat(non-TTY) prints raw markdownsignadot plan action get check -o jsonreturns the rawPlanActionpayloadsignadot plan action get nonexistentsurfaces a 404 from the API