Skip to content

feat(cli): read fill values from stdin - #563

Open
Wang-Zephyr wants to merge 2 commits into
Tencent:mainfrom
Wang-Zephyr:feat/fill-value-stdin
Open

Wang-Zephyr wants to merge 2 commits into
Tencent:mainfrom
Wang-Zephyr:feat/fill-value-stdin

Conversation

@Wang-Zephyr

@Wang-Zephyr Wang-Zephyr commented Nov 3, 2026 •

Copy link
Copy Markdown

Summary

Adds bsk fill --value-stdin so callers can supply a fill value without putting it in the CLI's process arguments. Input is read as UTF-8 until EOF, preserving empty input, whitespace, CRLF and trailing newlines. Existing --value calls keep their behavior.

Exactly one value source is required. Input and target validation happen before daemon startup. --value-stdin rejects BSK_CANCEL_ON_STDIN_CLOSE=1, since that setting reserves stdin as a parent cancellation pipe.

Addresses #544's fill --value-stdin alternative.

Validation

Coverage Evidence
CLI parsing Requires one source, rejects conflicting sources, accepts empty inline values
Real CLI + daemon, mock browser connection Forwards exact empty/Unicode/CRLF input from stdin and inline values; preserves clear/append parameters and value-length-only human output
Process errors Invalid UTF-8 and cancellation-pipe conflicts fail before daemon startup without echoing input
Regression control New process test fails on base c134fbb because --value-stdin is unknown

Passed locally on Windows:

  • cargo fmt --all -- --check
  • cargo test -p bsk --lib --test cli_parse --test cli_usage_errors --test interaction_preferences --locked (579 passed, 2 ignored)
  • cargo test -p bsk-protocol --locked (181 passed)
  • node scripts/check-crate-skill.mjs
  • node scripts/check-skill-bundles.mjs
  • node --test scripts/check-skill-bundles.test.mjs (6 passed)
  • Extension suite with vitest run --maxWorkers=2 (3,604 passed, 418 skipped)

Platform limitations, checked against the same base:

  • Strict workspace Clippy reports the same four existing Windows-only diagnostics in file_transfer.rs, ipc.rs, and skill_install/harness.rs.
  • pnpm lint passes formatting, CSS and plugin type checks, then fails six existing plugin assertions that expect POSIX /tmp/... paths; base has the same six failures.
  • cargo test --workspace --locked passes the CLI library tests, then stops in auto_update_handover: this host's Windows Job does not allow detached-daemon breakaway. The same manual-update failure reproduces on base. Linux/full CI validation is still needed.

@Wang-Zephyr
Wang-Zephyr marked this pull request as ready for review November 3, 2026 15:40
@Wang-Zephyr

Copy link
Copy Markdown
Author

Merged current main (88ca431) in 54f15f2 and resolved the CLI context/test-directory conflicts. The fill stdin path keeps the new ClientContext and optional-session behavior. Verified against this merged tree: 719 CLI unit tests passed (2 ignored), 46 CLI parsing tests passed, 13 usage-error tests passed, and all 5 interaction-preferences CLI/daemon tests passed, including stdin and inline values. cargo fmt and both skill packaging checks passed. GitHub now reports the branch mergeable.

This branch has not been deployed

No deployments
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