Skip to content

cli: add more execution output format options#11439

Merged
bduffany merged 2 commits intomasterfrom
cli-verbose-response
Mar 10, 2026
Merged

cli: add more execution output format options#11439
bduffany merged 2 commits intomasterfrom
cli-verbose-response

Conversation

@bduffany
Copy link
Member

@bduffany bduffany commented Feb 27, 2026

Support more flexible output options in bb execute, and add a bb executions get command for fetching execution details for an execution ID, supporting the same new output options as bb execute. This makes it easier to look at server logs etc. from ad-hoc bb execute commands, or from execution IDs that we see in logs (especially useful for workflow execution debugging since failed workflows don't always display properly in the UI for various reasons).

(re. bb executions, I went with a subcommand approach because at some point it'll probably be useful to add bb executions wait, bb executions status, and bb executions cancel, but didn't think it was worth bloating bb --help with all of these different commands)

  • Add a new flag --output={id|stdio|json|md|markdown} which defaults to stdio (stdout + stderr) for bb execute, which is what we show today, and defaults to markdown for bb executions get.
  • id output prints just the execution ID and skips fetching any additional data from cache. This is useful for testing lots of executions and then later analyzing them using a separate pipeline (e.g. in parallel)
  • The json output contains more detailed execution info - similar information to we show in the execution card in the UI, including stdout, stderr, server logs, timing information, and metadata. This is useful for scripting.
  • The markdown/md format contains a human-readable presentation of the JSON format (i.e. it's optimized for readability). Example:
image

@bduffany bduffany changed the title cli: add more execution fetching/formatting capabilities cli: add more execution output format options Feb 27, 2026
@bduffany bduffany force-pushed the cli-verbose-response branch from 24ee649 to 83fc501 Compare February 27, 2026 16:07
@bduffany bduffany force-pushed the cli-verbose-response branch from 83fc501 to 8cdc1e4 Compare February 27, 2026 16:30
Copy link
Collaborator

@maggie-lou maggie-lou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Non-blocking and there's a general CLI documentation hole, but it would be nice to have internal docs about using this tool to debug

Generally LGTM - some small comments

return b.String()
}

func colorHeading(s string) string {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe these should go in mardown parsing util?

Copy link
Member Author

@bduffany bduffany Mar 3, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good - I added a cli/markdown package that gives us a markdown.Writer - it accepts a stream of markdown and automatically colorizes it. I figured it's easier to just write markdown to a writer and not have to worry about colors / formatting etc.

Right now it just colorizes headers - later we can get fancier if we want. If we wind up needing this for other stuff too, we can move it to server/util.

@bduffany bduffany force-pushed the cli-verbose-response branch 3 times, most recently from 863390d to 93558ca Compare March 4, 2026 02:17
@bduffany bduffany force-pushed the cli-verbose-response branch 2 times, most recently from 4eb7d14 to c679f23 Compare March 10, 2026 20:52
@bduffany bduffany force-pushed the cli-verbose-response branch from c679f23 to 86a917f Compare March 10, 2026 20:54
@bduffany bduffany merged commit 83a2a91 into master Mar 10, 2026
11 of 12 checks passed
@bduffany bduffany deleted the cli-verbose-response branch March 10, 2026 21:08
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