Skip to content

The open source coding agent.

TypeScript

fix: report config errors instead of silent termination (#7522)

Ariane Emory75df5040ea45
diff --git a/packages/opencode/src/index.ts b/packages/opencode/src/index.ts
index e1c2cbd1d51..6099443e798 100644
--- a/packages/opencode/src/index.ts
+++ b/packages/opencode/src/index.ts
@@ -99,14 +99,16 @@ const cli = yargs(hideBin(process.argv))
.command(GithubCommand)
.command(PrCommand)
.command(SessionCommand)
- .fail((msg) => {
+ .fail((msg, err) => {
if (
msg?.startsWith("Unknown argument") ||
msg?.startsWith("Not enough non-option arguments") ||
msg?.startsWith("Invalid values:")
) {
+ if (err) throw err
cli.showHelp("log")
}
+ if (err) throw err
process.exit(1)
})
.strict()