refactor(cmds): move all cmds under Opencode#84
Conversation
|
Ooh, good catch. I'll take a look. Thanks! |
26f8d35 to
6519b59
Compare
|
I had a few mins to look at this. I agree; I really don't like plucking the extra arguments from the prompt. I propose we break backwards compatibility here (it probably isn't used very often anyway) and do the following: FormatAll three are optional, can appear in any order, but must come before the prompt. ExamplesSingle prefix: :OpencodeRun agent=plan what's the architecture here?
:OpencodeRunNewSession model=github-copilot/gpt-4.1 fix this bug
:OpencodeRun context=current_file.enabled=false analyze the projectMultiple prefixes (any order): :OpencodeRun agent=plan model=github-copilot/claude-sonnet-4 review my code
:OpencodeRunNewSession model=anthropic/claude-3.5 agent=build context=selection.enabled=false refactor this
:OpencodeRun context=diagnostics.error=true,current_file.enabled=false agent=plan model=openai/gpt-4 what are the errors?No prefixes: :OpencodeRun Fix the bug in the current fileComplex context with multiple overrides: :OpencodeRunNewSession agent=plan context=current_file.enabled=false,selection.enabled=true,diagnostics.warn=false help me understand thisParsing Logic
Context value formatThe
How's that sound? |
|
To.me it sounds pretty reasonable. I agree that by looking at usage on GitHub it does not seem to be a used feature at the moment. So I would be ok with your solution. |
Backwards compatibility maintained with config.legacy_commands option. It's currently true but should be set to false at some point in the future. Fixes sudo-tee#82
6519b59 to
46b8469
Compare
As discussed in sudo-tee#84, the previous cmd refactor had broken argument handling for run/run_new. The old format had an ambiguity between prompt and context args. This change is breaking because we no longer support the old format. The new format is: :OpencodeRun [agent=<name>] [model=<model>] [context=<overrides>] <prompt> :OpencodeRunNewSession [agent=<name>] [model=<model>] [context=<overrides>] <prompt>
|
Ok, I think this is all set. Whenever you have time, let me know if you see any other issues. |
|
Looks good to me. I think there is an issue where the context is not loaded properly whan using the context params, but it's not a bug in your MR. This should be adressed in the context bar i'm doing. Thanks a lot for your great PR |



Backwards compatibility maintained with config.legacy_commands option.
It's currently true but should be set to false at some point in the
future.
Fixes #82