Skip to content

Fix -n flag ignored by adding --file prompt input and stdin support#90

Merged
that-github-user merged 1 commit intomainfrom
issue-87-fix-n-flag
Mar 28, 2026
Merged

Fix -n flag ignored by adding --file prompt input and stdin support#90
that-github-user merged 1 commit intomainfrom
issue-87-fix-n-flag

Conversation

@that-github-user
Copy link
Copy Markdown
Owner

Summary

  • Make prompt argument optional, add --file flag and stdin piping
  • resolvePrompt() utility: file → positional arg → stdin, with clear errors
  • Sidesteps shell expansion issues that caused -n to be consumed by bash
  • 5 new tests for resolvePrompt covering file, arg, empty, and error cases

Generated by thinktank Opus — 5 agents, all pass tests. Agent #1 recommended (+111/-2). Agents 2-5 clustered (58%) but Agent #1 took a cleaner approach.

Change type

  • Bug fix
  • New feature
  • Refactor
  • Documentation
  • CI / infrastructure
  • Chore

Related issue

Closes #87

How to test

thinktank run "simple prompt" -n 5        # works
thinktank run -f prompt.txt -n 5          # works (new)
echo "prompt" | thinktank run -n 5        # works (new)
npm test                                   # 72 tests pass

Breaking changes

  • This PR introduces breaking changes

🤖 Generated with thinktank (Opus) + Claude Code

The -n flag was consumed by shell expansion when prompts contained
special characters. Fix: make prompt optional, add --file flag to read
from file, and support stdin piping. resolvePrompt() utility handles
all three input methods with clear error messages.

Generated by thinktank Opus (5 agents, all pass, Agent #1 recommended).

Closes #87

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@that-github-user
Copy link
Copy Markdown
Owner Author

Self-review: resolvePrompt prioritizes --file over positional over stdin. Error messages show all usage options. Tests cover file read, empty file, missing file, positional arg, and no-input error. 72 tests pass, lint clean.

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.

Bug: -n flag ignored when prompt contains special characters

1 participant