Skip to content

Add plan execution commands and plan run#308

Merged
davixcky merged 5 commits intofeature-plan-tagsfrom
feature-plan-exec-crud
Apr 6, 2026
Merged

Add plan execution commands and plan run#308
davixcky merged 5 commits intofeature-plan-tagsfrom
feature-plan-exec-crud

Conversation

@scott-cotton
Copy link
Copy Markdown
Member

Summary

Phase 3 of the plan CLI: execution management and the plan run entry point.

Plan execution commands (signadot plan x / plan execution):

  • get <exec-id> — execution details with step status table
  • cancel <exec-id> — cancel a running execution
  • outputs <exec-id> — list output metadata (type, size, ready)
  • get-output <exec-id> <name> — download output to stdout (supports step/name for step-level)

Plan run (signadot plan run):

  • Creates execution, polls with spinner, prints results
  • Resolve plan by ID or --tag
  • --param key=value for parameters (JSON values auto-detected)
  • --wait=false for fire-and-forget
  • --timeout for poll timeout
  • --output-dir to export all outputs on completion
  • Ctrl+C cancels execution via API, exits 2
  • Exit codes: 0=completed, 1=failed, 2=cancelled

Also adds --tag to plan create (matching compile --tag).

Stacked on #307 (plan tags).

Dependencies

Test plan

  • plan run <id> — full lifecycle: create, poll, print outputs, exit 0
  • plan run --tag <name> — resolve tag, same flow
  • plan run --wait=false — prints exec ID immediately
  • plan run with invalid runner — proper error message
  • plan x get <id> — shows details with step table
  • plan x outputs <id> — lists output metadata
  • plan x get-output <id> <name> — downloads output to stdout
  • plan x cancel <id> on completed exec — 409 error
  • -o json and -o yaml output formats
  • go build and go vet pass

🤖 Generated with Claude Code

@scott-cotton scott-cotton force-pushed the feature-plan-exec-crud branch from 0ab42aa to cd00855 Compare April 1, 2026 20:14
Plan execution management (signadot plan x / plan execution):
  - get <exec-id>: show execution details with step status table
  - cancel <exec-id>: cancel a running execution
  - outputs <exec-id>: list output metadata (inline/artifact, size, ready)
  - get-output <exec-id> <name>: download output to stdout
  - get-output <exec-id> <step>/<name>: download step-level output

Plan run (signadot plan run):
  - Creates execution, polls until terminal phase, prints results
  - Resolve by plan ID or --tag
  - --param key=value for execution parameters
  - --wait=false for fire-and-forget
  - --timeout for poll timeout
  - --output-dir to export all outputs on completion
  - Exit codes: 0=completed, 1=failed, 2=cancelled
  - Ctrl+C cancels the execution via API

Also adds --tag flag to plan create (matching compile --tag).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@scott-cotton scott-cotton force-pushed the feature-plan-exec-crud branch from cd00855 to 3bd3e4a Compare April 1, 2026 21:20
scott-cotton and others added 3 commits April 2, 2026 13:59
- Remove plan list command — tags are now the sole discovery
  mechanism per the plan lifecycle redesign.
- Remove printPlanTable and PlanList config (dead code after removal).
- Render tag-to-plan mapping history in plan tag get detail view.
  History table shows PLAN ID, TAGGED, UNTAGGED columns. Only
  displayed when there are previous mappings (len > 1).
- 409 on plan delete (tagged plans) passes through as a clear
  API error message — no special handling needed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
signadot plan recompile <plan-id> [--tag <name>]

Recompiles a plan from its original prompt, producing a new plan.
Supports --tag to tag the result in one command. Shows the
Compiled From field linking back to the source plan.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Update go-sdk to latest feature-plan branch which normalises
swagger parameter names:
  - WithPlanExecutionID → WithExecutionID
  - WithStepOutputName → WithOutputName

Also adds PlanExecutionLogs client for streaming log endpoints.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@scott-cotton scott-cotton mentioned this pull request Apr 2, 2026
6 tasks
@scott-cotton scott-cotton marked this pull request as ready for review April 3, 2026 11:49
* Add plan execution log streaming

Two ways to stream plan execution logs:

  signadot plan x logs <exec-id> [step-id]
  signadot logs --plan <exec-id> [--step <step-id>]

Without a step ID, streams aggregated logs for all steps.
With a step ID, streams stdout or stderr (--stream flag) for that step.

Extracts ParseSSEStream from the logs package into internal/print/sse.go
to avoid an import cycle between logs and planexec packages.

Also adds --plan and --step flags to the existing signadot logs command
(previously job-only), making --job and --plan mutually exclusive.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add plan execution list command (#310)

* Add plan execution list command

signadot plan x list [--plan <id>] [--tag <name>] [--phase <phase>]

Lists plan executions with pagination support. Filters:
  --plan: filter by plan ID
  --tag: filter by tag name (resolved server-side)
  --phase: filter by execution phase

Also unexports ShowPlanLogs (unused cross-package after import cycle fix).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add plan run --attach for structured event streaming (#311)

* Add plan run --attach for structured event streaming

Streams execution events (logs, outputs, result) to stdout in real-time.

Text mode (default):
  time=12:08:18 type=log step=greet stream=stdout msg="step starting"
  time=12:08:23 type=output name=greeting value="hello world"
  time=12:08:23 type=result id=abc123 phase=completed

JSON mode (-o json):
  {"time":"...","type":"log","step":"greet","stream":"stdout","msg":"step starting\n"}

Pipe-friendly: plan run --attach | grep type=output
stderr reserved for CLI messages (Created execution...).

Also fixes non-attach mode to write failure/cancellation details to
stderr so stdout stays clean, and rejects -o yaml with --attach.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Plan outputs list fixes (#312)

- Show both plan-level and step-level outputs in plan x outputs
  (previously only plan-level, which was often empty)
- Add SCOPE column (plan/step) and rename TYPE to STORAGE
- Compute inline output size from value length
- Show READY as true for inline outputs (always available)
- Deduplicate: step outputs already shown as plan outputs are skipped

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@davixcky davixcky merged commit 4f04bb5 into feature-plan-tags Apr 6, 2026
@davixcky davixcky deleted the feature-plan-exec-crud branch April 6, 2026 16:42
davixcky pushed a commit that referenced this pull request Apr 6, 2026
* Add plan tag commands (list, get, apply, delete)

Phase 2 of the plan CLI: named references to plans.

Commands:
  signadot plan tag list
  signadot plan tag get <tag-name>
  signadot plan tag apply <tag-name> --plan <plan-id>
  signadot plan tag delete <tag-name>

Alias: signadot plan t <subcommand>

ApplyTag is exported from the plantag package so compile --tag
can reuse it. The local plan/tag.go wrapper is removed.

Also extracts print.FirstLine as a shared helper, and improves
command help text for agent discoverability.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add plan execution commands and plan run (#308)

* Add plan execution commands and plan run

Plan execution management (signadot plan x / plan execution):
  - get <exec-id>: show execution details with step status table
  - cancel <exec-id>: cancel a running execution
  - outputs <exec-id>: list output metadata (inline/artifact, size, ready)
  - get-output <exec-id> <name>: download output to stdout
  - get-output <exec-id> <step>/<name>: download step-level output

Plan run (signadot plan run):
  - Creates execution, polls until terminal phase, prints results
  - Resolve by plan ID or --tag
  - --param key=value for execution parameters
  - --wait=false for fire-and-forget
  - --timeout for poll timeout
  - --output-dir to export all outputs on completion
  - Exit codes: 0=completed, 1=failed, 2=cancelled
  - Ctrl+C cancels the execution via API

Also adds --tag flag to plan create (matching compile --tag).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Remove plan list and add tag history rendering

- Remove plan list command — tags are now the sole discovery
  mechanism per the plan lifecycle redesign.
- Remove printPlanTable and PlanList config (dead code after removal).
- Render tag-to-plan mapping history in plan tag get detail view.
  History table shows PLAN ID, TAGGED, UNTAGGED columns. Only
  displayed when there are previous mappings (len > 1).
- 409 on plan delete (tagged plans) passes through as a clear
  API error message — no special handling needed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add plan recompile command

signadot plan recompile <plan-id> [--tag <name>]

Recompiles a plan from its original prompt, producing a new plan.
Supports --tag to tag the result in one command. Shows the
Compiled From field linking back to the source plan.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Update go-sdk and adapt to param renames

Update go-sdk to latest feature-plan branch which normalises
swagger parameter names:
  - WithPlanExecutionID → WithExecutionID
  - WithStepOutputName → WithOutputName

Also adds PlanExecutionLogs client for streaming log endpoints.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add plan execution log streaming (#309)

* Add plan execution log streaming

Two ways to stream plan execution logs:

  signadot plan x logs <exec-id> [step-id]
  signadot logs --plan <exec-id> [--step <step-id>]

Without a step ID, streams aggregated logs for all steps.
With a step ID, streams stdout or stderr (--stream flag) for that step.

Extracts ParseSSEStream from the logs package into internal/print/sse.go
to avoid an import cycle between logs and planexec packages.

Also adds --plan and --step flags to the existing signadot logs command
(previously job-only), making --job and --plan mutually exclusive.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add plan execution list command (#310)

* Add plan execution list command

signadot plan x list [--plan <id>] [--tag <name>] [--phase <phase>]

Lists plan executions with pagination support. Filters:
  --plan: filter by plan ID
  --tag: filter by tag name (resolved server-side)
  --phase: filter by execution phase

Also unexports ShowPlanLogs (unused cross-package after import cycle fix).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add plan run --attach for structured event streaming (#311)

* Add plan run --attach for structured event streaming

Streams execution events (logs, outputs, result) to stdout in real-time.

Text mode (default):
  time=12:08:18 type=log step=greet stream=stdout msg="step starting"
  time=12:08:23 type=output name=greeting value="hello world"
  time=12:08:23 type=result id=abc123 phase=completed

JSON mode (-o json):
  {"time":"...","type":"log","step":"greet","stream":"stdout","msg":"step starting\n"}

Pipe-friendly: plan run --attach | grep type=output
stderr reserved for CLI messages (Created execution...).

Also fixes non-attach mode to write failure/cancellation details to
stderr so stdout stays clean, and rejects -o yaml with --attach.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Plan outputs list fixes (#312)

- Show both plan-level and step-level outputs in plan x outputs
  (previously only plan-level, which was often empty)
- Add SCOPE column (plan/step) and rename TYPE to STORAGE
- Compute inline output size from value length
- Show READY as true for inline outputs (always available)
- Deduplicate: step outputs already shown as plan outputs are skipped

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
davixcky pushed a commit that referenced this pull request Apr 6, 2026
* Add plan CRUD commands (compile, create, list, get, delete)

Phase 1 of the plan CLI: basic plan management against the API.

Commands:
  signadot plan compile -f <prompt-file> [--tag <name>]
  signadot plan create -f <spec.yaml> [--set var=val]
  signadot plan list
  signadot plan get <plan-id>
  signadot plan delete <plan-id>

All commands support -o json and -o yaml output formats.
Compile supports -f - for stdin. Create supports --set template
substitution via the existing LoadUnstructuredTemplate path.
Compile --tag compiles then tags the plan via PutPlanTag.

Depends on go-sdk with plan CRUD client (signadot/signadot#6825).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add plan tag commands (list, get, apply, delete) (#307)

* Add plan tag commands (list, get, apply, delete)

Phase 2 of the plan CLI: named references to plans.

Commands:
  signadot plan tag list
  signadot plan tag get <tag-name>
  signadot plan tag apply <tag-name> --plan <plan-id>
  signadot plan tag delete <tag-name>

Alias: signadot plan t <subcommand>

ApplyTag is exported from the plantag package so compile --tag
can reuse it. The local plan/tag.go wrapper is removed.

Also extracts print.FirstLine as a shared helper, and improves
command help text for agent discoverability.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add plan execution commands and plan run (#308)

* Add plan execution commands and plan run

Plan execution management (signadot plan x / plan execution):
  - get <exec-id>: show execution details with step status table
  - cancel <exec-id>: cancel a running execution
  - outputs <exec-id>: list output metadata (inline/artifact, size, ready)
  - get-output <exec-id> <name>: download output to stdout
  - get-output <exec-id> <step>/<name>: download step-level output

Plan run (signadot plan run):
  - Creates execution, polls until terminal phase, prints results
  - Resolve by plan ID or --tag
  - --param key=value for execution parameters
  - --wait=false for fire-and-forget
  - --timeout for poll timeout
  - --output-dir to export all outputs on completion
  - Exit codes: 0=completed, 1=failed, 2=cancelled
  - Ctrl+C cancels the execution via API

Also adds --tag flag to plan create (matching compile --tag).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Remove plan list and add tag history rendering

- Remove plan list command — tags are now the sole discovery
  mechanism per the plan lifecycle redesign.
- Remove printPlanTable and PlanList config (dead code after removal).
- Render tag-to-plan mapping history in plan tag get detail view.
  History table shows PLAN ID, TAGGED, UNTAGGED columns. Only
  displayed when there are previous mappings (len > 1).
- 409 on plan delete (tagged plans) passes through as a clear
  API error message — no special handling needed.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add plan recompile command

signadot plan recompile <plan-id> [--tag <name>]

Recompiles a plan from its original prompt, producing a new plan.
Supports --tag to tag the result in one command. Shows the
Compiled From field linking back to the source plan.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Update go-sdk and adapt to param renames

Update go-sdk to latest feature-plan branch which normalises
swagger parameter names:
  - WithPlanExecutionID → WithExecutionID
  - WithStepOutputName → WithOutputName

Also adds PlanExecutionLogs client for streaming log endpoints.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add plan execution log streaming (#309)

* Add plan execution log streaming

Two ways to stream plan execution logs:

  signadot plan x logs <exec-id> [step-id]
  signadot logs --plan <exec-id> [--step <step-id>]

Without a step ID, streams aggregated logs for all steps.
With a step ID, streams stdout or stderr (--stream flag) for that step.

Extracts ParseSSEStream from the logs package into internal/print/sse.go
to avoid an import cycle between logs and planexec packages.

Also adds --plan and --step flags to the existing signadot logs command
(previously job-only), making --job and --plan mutually exclusive.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add plan execution list command (#310)

* Add plan execution list command

signadot plan x list [--plan <id>] [--tag <name>] [--phase <phase>]

Lists plan executions with pagination support. Filters:
  --plan: filter by plan ID
  --tag: filter by tag name (resolved server-side)
  --phase: filter by execution phase

Also unexports ShowPlanLogs (unused cross-package after import cycle fix).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Add plan run --attach for structured event streaming (#311)

* Add plan run --attach for structured event streaming

Streams execution events (logs, outputs, result) to stdout in real-time.

Text mode (default):
  time=12:08:18 type=log step=greet stream=stdout msg="step starting"
  time=12:08:23 type=output name=greeting value="hello world"
  time=12:08:23 type=result id=abc123 phase=completed

JSON mode (-o json):
  {"time":"...","type":"log","step":"greet","stream":"stdout","msg":"step starting\n"}

Pipe-friendly: plan run --attach | grep type=output
stderr reserved for CLI messages (Created execution...).

Also fixes non-attach mode to write failure/cancellation details to
stderr so stdout stays clean, and rejects -o yaml with --attach.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

* Plan outputs list fixes (#312)

- Show both plan-level and step-level outputs in plan x outputs
  (previously only plan-level, which was often empty)
- Add SCOPE column (plan/step) and rename TYPE to STORAGE
- Compute inline output size from value length
- Show READY as true for inline outputs (always available)
- Deduplicate: step outputs already shown as plan outputs are skipped

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@davixcky davixcky mentioned this pull request Apr 6, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants