Skip to content

pkg/cg: Command Guard#144

Merged
ripta merged 10 commits intomainfrom
cg
Feb 27, 2026
Merged

pkg/cg: Command Guard#144
ripta merged 10 commits intomainfrom
cg

Conversation

@ripta
Copy link
Copy Markdown
Owner

@ripta ripta commented Feb 25, 2026

cg wraps a child process and prefixes each stdout / stderr line with a timestamp and stream indicator (O/E/I), like annotate-output.

  • --capture for writing raw output to files;
  • --buffered for deferred logging; and
  • structured log extraction from JSON and logfmt'd lines

ripta added 10 commits February 22, 2026 19:58
Wraps a child process and prefixes each stdout / stderr line with a
timestamp and stream indicator (O/E/I), à la annotate-output.

Adds tests lol.
When `--capture` is active, stdout and stderr are written to separate
temporary files containing raw, unannotated output. A separate lifecycle
file captures all I: messages.
When set, stdout / stderr is accumulated in memory and replayed after
exit preceded by a section header. When `--capture` is active, writes
into the files happen immediately instead of deferred.
Extract human-readable messages from JSON log lines, replacing raw JSON
with the message field value while preserving cg's annotation format;
non-JSON lines pass through unchanged.
Exercise the compiled binary end-to-end using txtar scripts.
@ripta ripta merged commit c8254e5 into main Feb 27, 2026
1 check passed
@ripta ripta deleted the cg branch February 27, 2026 04:46
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.

1 participant