Skip to content

feat: support reading message text from stdin pipe#23

Merged
lewiszlw merged 2 commits into
masterfrom
feat/stdin-text-support
Apr 24, 2026
Merged

feat: support reading message text from stdin pipe#23
lewiszlw merged 2 commits into
masterfrom
feat/stdin-text-support

Conversation

@lewiszlw
Copy link
Copy Markdown
Member

When neither --text nor --file is provided, the send command now reads text from stdin if it is a pipe or redirected file.

Behavior:

  • --text takes priority over stdin when explicitly provided
  • --file takes priority over stdin when explicitly provided
  • If neither --text nor --file is given and stdin is a tty, a clear error is returned instead of waiting for interactive input
  • Empty piped stdin produces a clear error message

Changes:

  • Extract resolve_send_content() with injectable stdin reader for testability
  • Add SendContent enum to represent text vs file content
  • Update CLI ArgGroup to make text/file optional (still mutually exclusive)
  • Expand send help text with Message Sources section
  • Add 6 unit tests covering all stdin behavior combinations
  • Update README.md and SKILL.md with stdin examples and priority rules

When neither --text nor --file is provided, the send command now reads
text from stdin if it is a pipe or redirected file.

Behavior:
- --text takes priority over stdin when explicitly provided
- --file takes priority over stdin when explicitly provided
- If neither --text nor --file is given and stdin is a tty, a clear
  error is returned instead of waiting for interactive input
- Empty piped stdin produces a clear error message

Changes:
- Extract resolve_send_content() with injectable stdin reader for testability
- Add SendContent enum to represent text vs file content
- Update CLI ArgGroup to make text/file optional (still mutually exclusive)
- Expand send help text with Message Sources section
- Add 6 unit tests covering all stdin behavior combinations
- Update README.md and SKILL.md with stdin examples and priority rules
@lewiszlw lewiszlw merged commit 1cbfa57 into master Apr 24, 2026
3 checks passed
@lewiszlw lewiszlw deleted the feat/stdin-text-support branch April 24, 2026 08:31
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