cli: add more execution output format options#11439
Merged
Conversation
24ee649 to
83fc501
Compare
83fc501 to
8cdc1e4
Compare
maggie-lou
approved these changes
Mar 2, 2026
Collaborator
maggie-lou
left a comment
There was a problem hiding this comment.
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
cli/executions/executions.go
Outdated
| return b.String() | ||
| } | ||
|
|
||
| func colorHeading(s string) string { |
Collaborator
There was a problem hiding this comment.
Maybe these should go in mardown parsing util?
Member
Author
There was a problem hiding this comment.
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.
863390d to
93558ca
Compare
4eb7d14 to
c679f23
Compare
c679f23 to
86a917f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Support more flexible output options in
bb execute, and add abb executions getcommand for fetching execution details for an execution ID, supporting the same new output options asbb execute. This makes it easier to look at server logs etc. from ad-hocbb executecommands, 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 addbb executions wait,bb executions status, andbb executions cancel, but didn't think it was worth bloatingbb --helpwith all of these different commands)--output={id|stdio|json|md|markdown}which defaults tostdio(stdout + stderr) forbb execute, which is what we show today, and defaults tomarkdownforbb executions get.idoutput 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)jsonoutput 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.markdown/mdformat contains a human-readable presentation of the JSON format (i.e. it's optimized for readability). Example: