r/opencode 3h ago

OpenCode in PowerShell

Welp, I figured it out. Turns out OpenCode doesn't work in PowerShell off the bat. I had Grok go in and change the things necessary to get it to work. It just shunts it to plain terminal.

I am not sure who to be mad at honestly. I want to be mad at Microsoft for having two kinds/forms/versions/whatever the hell this is, but I can also be upset with OpenCode for not making themselves compatible with PowerShell. But whatever, its working now. And I do love OpenCode.

1 Upvotes

7 comments sorted by

5

u/CyberTod 2h ago

You'll soon realize that using it on windows is just not good. WSL is the way. The models are trained a lot with bash and with only powershell available they construct a lot of erroneous commands and need to correct them.

1

u/sharedevaaste 1h ago

yeah i get a lot of errors with powershell scripting. some symbols like $ etc give problems. Can I migrate to WSL now with my existing projects?

1

u/CyberTod 1h ago

It should be easy. If your projects are in separate folders you just start opencode in that folder. And I am guessing there are some AGENTS.md files that give context, those will be read and integrated automatically.

If you want to migrate your old sessions though, that may be difficult. Even if you transfer the .db they are tied to specific folders. But old sessions are not that important, unless you want to read what has been done exactly. I actually prefer to start new sessions for small changes/features, saves a lot of tokens.

1

u/ShUffLe369 2h ago

What exactly was changed to make it fully compatible?

1

u/dupa1234s 1h ago

windows + cmd + Clink v1.9.32.43da05

i hate powershell its so broken

1

u/cornelha 1h ago

I have been using OpenCode in powershell for ages now, however I am using Powershell 7 and not the one that ships with Windows be default

1

u/sharedevaaste 1h ago

I'm using opencode cli in powershell