Add --stream flag for workspace script execution

Implements a --stream flag for `bun run` that streams logs immediately without
buffering or eliding when running scripts across workspace packages. This is
similar to pnpm's --stream flag and addresses user feedback about log display
in workspace environments.

Changes:
- Add --stream flag to CLI parameters for both run and auto commands
- Implement streaming output in filter_run.zig that bypasses buffering
- Add validation to prevent using --stream with --elide-lines
- Add comprehensive test coverage for the new flag
- Update documentation in filter.md and run.md

The flag provides immediate, unbuffered output which is useful for:
- Real-time monitoring of long-running processes
- CI/CD environments where immediate feedback is important
- Debugging scripts that may hang or have timing issues

Fixes the issue where workspace script output was being buffered and elided
by default, making it difficult to see logs in real-time.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Claude Bot
2025-09-07 08:06:37 +00:00
parent 2daf7ed02e
commit 690ca26414
6 changed files with 277 additions and 2 deletions

View File

@@ -419,6 +419,7 @@ pub const Command = struct {
env_behavior: api.DotEnvBehavior = .disable,
env_prefix: []const u8 = "",
elide_lines: ?usize = null,
stream_logs: bool = false,
// Compile options
compile: bool = false,
compile_target: Cli.CompileTarget = .{},