Skip to content

[FEATURE]: Add non-interactive mode to "opencode run" #10411

Closed

Description

@smola

Feature hasn't been suggested before.

  • I have verified this feature I'm about to request hasn't been suggested before.

Describe the enhancement you want to request

Description

Add a non-interactive mode (e.g. --non-interactive) to opencode run. In this mode, opencode will never await for user input. Some choices will need to be made about how to react to expected input, but whatever these are, in this mode the command will eventually finish without ever expecting user input.

Use case

I'm using opencode run --format json to run opencode from non-interactive scripts. In this case, for a benchmark. I have a permission policy that I want to be respected. Once the run finishes, my script would inspect all tool calls that were made (or attempted).

Behavior details

  • It seems the main (or only?) thing that expects user input is permissions. So in non-interactive mode, a permission question should resolve to either reject or just abort the session. I think aborting and erroring out would probably make the most sense, and make this feature orthogonal to other proposed features for opencode run. In non-interactive mode, a permission question should just abort the session and exit the command. If someone wants the behavior to be answering allow/deny, that can be handled via explicit permissions.
  • If the output is not a TTY, then this mode should be enabled by default. It's better to let the user deal with a clear error, than letting a process hanging up indefinitely.

Related issues

Activity

  1. added
    discussionUsed for feature requests, proposals, ideas, etc. Open discussion
    on Jan 24, 2026
  2. github-actions commented on Jan 24, 2026

    @github-actions
    Contributor

    This issue might be a duplicate of existing issues. Please check:

    Feel free to ignore if none of these address your specific case.

  3. smola commented on Feb 14, 2026

    @smola
    Author

    This was fixed by #11814. Now opencode run auto-rejects tool calls if they would lead to a permission prompt. Making opencode run always non-interactive. Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

discussionUsed for feature requests, proposals, ideas, etc. Open discussion

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions