@motiondevlab/opencode-git-noninteractive-env
v0.1.0
Published
Non-interactive git environment for OpenCode bash-tool calls under PowerShell (OpenCode V1 only).
Readme
opencode-git-noninteractive-env
OpenCode V1 only. V2's Bash tool ignores legacy
shell.envhooks (anomalyco/opencode#41117). The V2 port usesctx.shell.hook("create.before", ...)and matches git onevent.commanddirectly. That port is tracked separately and is NOT in this package.
Replaces Oh My OpenAgent 5.1.29's non-interactive-env hook, which prefixes
commands with VAR=value — a syntax error in Windows PowerShell 5.1. Same
variables (CI, GIT_TERMINAL_PROMPT=0, GCM_INTERACTIVE=never,
GIT_EDITOR=:, GIT_PAGER=cat, …), delivered via OpenCode's shell.env
hook, scoped to bash-tool calls matching /\bgit\b/.
Install
// opencode.jsonc
{
"plugin": [
"@motiondevlab/[email protected]"
]
}Required companion setting — this plugin and the entry below are a pair:
// ~/.omo/omo.jsonc, inside the [opencode] block
{
"opencode": {
"disabled_hooks": ["non-interactive-env"]
}
}Then restart OpenCode (plugins load once at startup).
Coupled-pair warning
- Deleting only this plugin loses non-interactive protection (git may hang on prompts).
- Deleting only the
disabled_hooksentry restores theVAR=valueprefix errors under PowerShell 5.1. - Remove as a pair, and only if leaving Oh My OpenAgent or upstream fixes the prefix hook.
Verify
Run git status via the bash tool under pwsh: no prefix error, and
non-interactive vars present in the spawned environment.
