You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[FEATURE]: Native --stdin support for opencode run to handle large prompts without ARG_MAX errors #25508
When using opencode run with large prompts (e.g., code reviews of 1700+ line files), the prompt is passed as a positional argument. This causes critical issues:
ARG_MAX limit: On Linux, the maximum argument length is ~2MB. Large prompts exceed this, causing E2BIG: argument list too long errors before the command even executes.
Performance: Passing large strings as command-line arguments is inefficient and slow.
Workaround complexity: Currently requires writing to a temp file and using -f flag, which has security restrictions (files must be within project directory, see related issues).
Current Behavior
# This fails with large prompts (>2MB)
opencode run --model kimi-for-coding/kimi-k2-thinking "very large prompt..."# Current workaround: write to file in project directoryecho"$prompt"> ./temp_prompt.txt
opencode run --model kimi-for-coding/kimi-k2-thinking "Review this" -f ./temp_prompt.txt
Proposed Solution
Add native --stdin support for opencode run:
# Option 1: Explicit --stdin flagprintf'%s'"$prompt"| opencode run --model kimi-for-coding/kimi-k2-thinking --stdin
# Option 2: Auto-detect stdin when no positional argsprintf'%s'"$prompt"| opencode run --model kimi-for-coding/kimi-k2-thinking
Benefits
No ARG_MAX issues: Stdin has no practical size limit
Better performance: No command-line parsing of large strings
Simpler integration: Tools can pipe content directly without temp files
Security: No need to create temp files in project directory
This issue was discovered while working with GGA, a tool that uses OpenCode for automated code reviews. When reviewing commits with large files, the prompt exceeds ARG_MAX limits, causing timeouts and failures.
Environment
OpenCode version: 1.14.33
OS: Linux (Ubuntu/Debian)
Shell: Bash 5.x
Use case: Automated code review via CI/CD pipelines
Verification
I have searched existing issues and this feature has not been suggested before
The title should start with [FEATURE]: (e.g., [FEATURE]: Native --stdin support for opencode run...)
The Feature Request template requires a verification checkbox confirming the feature hasn't been suggested before — this is missing from the issue body
Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
changed the title [-]Feature Request: Native --stdin support for opencode run to handle large prompts without ARG_MAX errors[/-][+][FEATURE]: Native --stdin support for opencode run to handle large prompts without ARG_MAX errors[/+]on May 3, 2026
Thanks for updating the issue! Everything looks good now — the feature request is clear, includes real context, system info, and proper verification. We appreciate you taking the time to fix it up.
Activity
github-actions commentedon May 3, 2026
This issue doesn't fully meet our contributing guidelines.
What needs to be fixed:
[FEATURE]:(e.g.,[FEATURE]: Native --stdin support for opencode run...)Please edit this issue to address the above within 2 hours, or it will be automatically closed.
This issue might be a duplicate of existing issues. Please check:
If you believe this was flagged incorrectly, please let a maintainer know.
[-]Feature Request: Native --stdin support for opencode run to handle large prompts without ARG_MAX errors[/-][+][FEATURE]: Native --stdin support for opencode run to handle large prompts without ARG_MAX errors[/+]github-actions commentedon May 3, 2026
Thanks for updating the issue! Everything looks good now — the feature request is clear, includes real context, system info, and proper verification. We appreciate you taking the time to fix it up.
github-actions commentedon Jul 3, 2026
To stay organized issues are automatically closed after 60 days of no activity. If the issue is still relevant please open a new one.
docs(cli-executor-presets-1): add antigravity (agy) + opencode preset…