Skip to content

Add .quiet() method to suppress console output#137

Merged
konard merged 5 commits into
mainfrom
issue-136-c2c75f0016c4
Jun 9, 2026
Merged

Add .quiet() method to suppress console output#137
konard merged 5 commits into
mainfrom
issue-136-c2c75f0016c4

Conversation

@konard

@konard konard commented Nov 30, 2025

Copy link
Copy Markdown
Member

Summary

This PR implements the .quiet() method on ProcessRunner, providing functionality similar to zx's quiet() method. This allows users to suppress console output (terminal mirroring) for a single command while still capturing the command result programmatically.

Changes

Core Implementation

  • Added chainable .quiet() method to ProcessRunner in js/src/$.process-runner-orchestration.mjs
    • Sets options.mirror = false to disable console output
    • Returns this for method chaining
    • Works seamlessly with existing await, pipe, and event patterns

Documentation

  • Documented .quiet() in js/README.md next to the existing mirror: false examples

Testing

  • Added test suite in js/tests/quiet-method.test.mjs (6 tests)
    • Suppression of stdout and stderr
    • Result capture still works
    • Method chaining / ProcessRunner return value
    • Compatibility with normal (non-quiet) mode

Examples

  • Added demonstration script in js/examples/quiet-method-demo.mjs

Release

  • Added a minor changeset (js/.changeset/quiet-method.md) so the feature triggers a release

Use Case (from Issue #136)

// Suppress console output but still capture the result
const result = await $`gh api gists/${gistId} --jq '{owner: .owner.login, files: .files, history: .history}'`.quiet();

Notes on this update

  • The default branch was restructured into a js/ package (src/$.mjs was split into multiple js/src/$.process-runner-*.mjs modules). This branch has been merged with the latest main and the .quiet() implementation, test, and example were ported into the new layout. Merge conflicts are resolved and the PR is mergeable.

Test Results

  • ✅ New .quiet() tests: 6/6 passing
  • ✅ Full suite failure set is identical to clean main (38 pre-existing/environmental failures — e.g. jq not installed, CTRL+C signal tests — present on main too). No regressions introduced.

Breaking Changes

None. This is a purely additive feature.

Related

Fixes #136


🤖 Generated with Claude Code

Adding CLAUDE.md with task information for AI processing.
This file will be removed when the task is complete.

Issue: #136
@konard konard self-assigned this Nov 30, 2025
This commit implements the .quiet() method on ProcessRunner, similar
to zx's quiet() functionality. When called, it disables console output
(mirroring) while still capturing stdout/stderr for programmatic use.

Implementation details:
- Added quiet() method that sets options.mirror = false
- Returns this for method chaining
- Works with both stdout and stderr suppression
- Compatible with existing pipeline and await patterns

Testing:
- Created comprehensive test suite in tests/quiet-method.test.mjs
- Added usage example in examples/quiet-method-demo.mjs
- All existing tests pass (617 pass, 5 skip, 2 pre-existing fails)

This enables the use case from issue #136:
await $\`gh api gists/\${gistId} --jq '...'\`.quiet();

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

Co-Authored-By: Claude <noreply@anthropic.com>
@konard konard changed the title [WIP] Support .quite() function like in zx. Add .quiet() method to suppress console output Nov 30, 2025
@konard konard marked this pull request as ready for review November 30, 2025 18:26
@konard konard marked this pull request as draft June 8, 2026 21:12
@konard

konard commented Jun 8, 2026

Copy link
Copy Markdown
Member Author

🤖 AI Work Session Started

Starting automated work session at 2026-06-08T21:12:35.810Z

The PR has been converted to draft mode while work is in progress.

This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback.

@konard

konard commented Jun 8, 2026

Copy link
Copy Markdown
Member Author

⏳ Usage Limit Reached

The automated solution draft was interrupted because the OpenAI Codex usage limit was reached.

📊 Limit Information

  • Tool: OpenAI Codex
  • Limit Type: Usage limit exceeded
  • Reset Time: in 3h 14m (Jun 9, 12:27 AM UTC)
  • Session ID: 019ea914-aa36-7a53-8e77-48d8fa5f59b7

🔄 How to Continue

Auto-resume is enabled. The session will automatically resume (with context preserved) when the limit resets.

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-5.5
  • Model: GPT-5.5 (gpt-5.5)

📎 Execution log uploaded as Gist (189KB)


This session was interrupted due to usage limits. The session will automatically resume when the limit resets.

@konard

konard commented Jun 9, 2026

Copy link
Copy Markdown
Member Author

Resolve conflict, and double check all changes.

@konard

konard commented Jun 9, 2026

Copy link
Copy Markdown
Member Author

🤖 AI Work Session Started

Starting automated work session at 2026-06-09T14:15:04.991Z

The PR has been converted to draft mode while work is in progress.

This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback.

konard added 2 commits June 9, 2026 14:18
# Conflicts:
#	js/examples/quiet-method-demo.mjs
#	js/tests/quiet-method.test.mjs
#	src/$.mjs
- Document the chainable .quiet() method in README alongside mirror: false
- Add a minor changeset so the feature triggers a release
- Apply prettier formatting to the example
@konard konard marked this pull request as ready for review June 9, 2026 14:27
@konard

konard commented Jun 9, 2026

Copy link
Copy Markdown
Member Author

Resolved the merge conflicts with main and double-checked all changes.

What happened: main was restructured into a js/ package and the monolithic src/$.mjs was split into multiple js/src/$.process-runner-*.mjs modules. I merged the latest main and ported the .quiet() implementation into the new layout:

  • .quiet() now lives on ProcessRunner.prototype in js/src/$.process-runner-orchestration.mjs (next to pipe()), following the new prototype-mixin style.
  • Test and example moved to js/tests/quiet-method.test.mjs and js/examples/quiet-method-demo.mjs.
  • Documented .quiet() in js/README.md and added a minor changeset.

Verification:

  • All CI checks pass ✅ (bun on macOS/Ubuntu/Windows, node on Ubuntu, lint/format, changeset gate).
  • New .quiet() tests: 6/6 passing.
  • Locally the full suite's failure set is identical to clean main (38 pre-existing, environment-only failures such as jq not installed) — no regressions introduced.

PR is now mergeable and out of draft.

@konard

konard commented Jun 9, 2026

Copy link
Copy Markdown
Member Author

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost: $1.895667

📊 Context and tokens usage:

  • 58.9K / 1M (6%) input tokens, 17.2K / 128K (13%) output tokens

Total: (3.6K new + 46.0K cache writes + 2.3M cache reads) input tokens, 17.2K output tokens, $1.895667 cost

🤖 Models used:

  • Tool: Anthropic Claude Code
  • Requested: opus
  • Model: Claude Opus 4.8 (claude-opus-4-8)

📎 Log file uploaded as Gist (1498KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard konard merged commit dfe32bf into main Jun 9, 2026
11 checks passed
@konard

konard commented Jun 9, 2026

Copy link
Copy Markdown
Member Author

🎉 Auto-merged

This pull request has been automatically merged by hive-mind.

  • All CI checks have passed

Auto-merged by hive-mind with --auto-merge flag

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.

Support .quite() function like in zx.

1 participant