[FEATURE]: Support for --dir with opencode run for both local and remote sessions #8695

Closed
opened 2026-02-16 18:10:36 -05:00 by yindo · 1 comment
Owner

Originally created by @BlankParticle on GitHub (Feb 6, 2026).

Originally assigned to: @thdxr on GitHub.

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

The attach command supports --dir to specify the working directory, but run doesn't have this option when using --attach.

It would be useful to have --dir on run for both:

  • Local runs: change to that directory before starting
  • Remote runs with --attach: pass the directory to the remote server

Example usage:

opencode run --dir /path/to/project "do something"
opencode run --attach http://localhost:4096 --dir /path/to/project "do something"

I already made the PR before realising I needed the issue, #12443

Originally created by @BlankParticle on GitHub (Feb 6, 2026). Originally assigned to: @thdxr on GitHub. ### Feature hasn't been suggested before. - [x] I have verified this feature I'm about to request hasn't been suggested before. ### Describe the enhancement you want to request The `attach` command supports `--dir` to specify the working directory, but `run` doesn't have this option when using `--attach`. It would be useful to have `--dir` on `run` for both: - Local runs: change to that directory before starting - Remote runs with `--attach`: pass the directory to the remote server Example usage: ```bash opencode run --dir /path/to/project "do something" opencode run --attach http://localhost:4096 --dir /path/to/project "do something" ``` I already made the PR before realising I needed the issue, #12443
yindo added the discussion label 2026-02-16 18:10:36 -05:00
yindo closed this issue 2026-02-16 18:10:36 -05:00
Author
Owner

@github-actions[bot] commented on GitHub (Feb 6, 2026):

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

  • #1143: Create session with a different root/working directory
  • #2177: Allow explicitly changing working directory
  • #10615: [FEATURE]:Use attach to reference a local directory.
  • #11046: opencode attach --dir does not use project commands

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

@github-actions[bot] commented on GitHub (Feb 6, 2026): This issue might be a duplicate of existing issues. Please check: - #1143: Create session with a different root/working directory - #2177: Allow explicitly changing working directory - #10615: [FEATURE]:Use attach to reference a local directory. - #11046: `opencode attach --dir` does not use project commands Feel free to ignore if none of these address your specific case.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: anomalyco/opencode#8695