anomalyco / anomalyco/opencode
run: -f FILE followed by a positional prompt swallows the prompt as a file path
@nexxeln is already working on this.
Since Aug 27, 2026.
- Dominant language
- TypeScript
- Stars
- 209k
- Forks
- 27.5k
- PR merge metrics
- PR metrics pending
Description
Description
opencode run -f <file> "<prompt>" treats the trailing positional prompt as another file argument and fails with File not found: <your prompt text>. Both -f/--file and the message positional are declared as arrays, so yargs greedily consumes the positional into -f.
Workaround is to put the message before the flag (opencode run "<prompt>" -f <file>), but the natural flag-then-prompt order failing makes -f look broken.
Also worth noting: the failure exits 0, so scripts can't detect it.
OpenCode version
1.18.23 (brew tap, macOS). Also previously reproduced against main on 2026-08-21.
Steps to reproduce
opencode run -m deepseek/deepseek-v4-flash -f /etc/hosts "summarize this" < /dev/null- Output:
Error: File not found: summarize this(exit code 0)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.