Skip to content

fix(cli): support file input for stdin-backed ops#1396

Open
xuezhaolan wants to merge 1 commit into
garrytan:masterfrom
xuezhaolan:fix/windows-put-file-input
Open

fix(cli): support file input for stdin-backed ops#1396
xuezhaolan wants to merge 1 commit into
garrytan:masterfrom
xuezhaolan:fix/windows-put-file-input

Conversation

@xuezhaolan

Copy link
Copy Markdown

Summary

  • read piped CLI content from fd 0 instead of Unix-only /dev/stdin, so stdin-backed ops work on Windows
  • add --file / --input-file for stdin-backed operations such as gbrain put, bypassing Windows pipe-buffer limits for large pages
  • document the new flag in top-level help and pin argument parsing with tests

Fixes #1362
Fixes #1363

Tests

  • bun test test/cli-args.test.ts
  • bun run typecheck

Fixes garrytan#1362 and garrytan#1363.\n\nUse fd 0 instead of Unix-only /dev/stdin for piped content, and add --file/--input-file CLI-only input for stdin-backed operations so Windows users can bypass pipe-buffer limits.\n\nWhy: gbrain put currently fails on Windows because /dev/stdin is unavailable, and large piped content can be unreliable there.\n\nTests:\n- bun test test/cli-args.test.ts\n- bun run typecheck
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.

Add --file parameter to bypass Windows pipe buffer limitation gbrain put <slug> fails on Windows with ENOENT: /dev/stdin

1 participant