Compare commits

...
1 Commits
Author SHA1 Message Date
Kit Langton 6b04d490a6 fix(cli): remove inherited wizard and log-level flags 2026-09-12 11:52:17 -07:00
+8 -6
View File
@@ -1,5 +1,5 @@
import { Effect, FileSystem, Scope } from "effect"
import { Command } from "effect/unstable/cli"
import { CliConfig, Command, GlobalFlag } from "effect/unstable/cli"
import { PrintLogs } from "../commands/commands"
import { Spec } from "./spec"
import { Global } from "@opencode/util/global"
@@ -82,11 +82,13 @@ export function handlers<const Root extends Spec.Any>(root: Root, handlers: Hand
}
export function run(commands: Spec.Any, handlers: ReadonlyArray<LazyHandler>, options: { readonly version: string }) {
return Command.run(provide(commands, handlers).pipe(Command.withGlobalFlags([PrintLogs])), options) as Effect.Effect<
void,
unknown,
Command.Environment
>
return Command.run(provide(commands, handlers).pipe(Command.withGlobalFlags([PrintLogs])), options).pipe(
Effect.provide(
CliConfig.layer({
builtIns: [GlobalFlag.Help, GlobalFlag.Version, GlobalFlag.Completions],
}),
),
) as Effect.Effect<void, unknown, Command.Environment>
}
function provide(node: Spec.Any, handlers: ReadonlyArray<LazyHandler>): ProvidedCommand {