Composio powers 1000+ toolkits, tool search, context management, authentication, and a sandboxed workbench to help you build AI agents that turn intent into action.
fix(cli): suppress duplicate validation error output from @effect/cli
@effect/cli already prints validation errors (missing args, invalid flags) via its internal printDocs before re-failing with ValidationError. The generic error handler was then dumping the raw JSON structure. Swallow the re-thrown ValidationError to avoid the duplicate/malformed output. Before: raw JSON dump like `{"_tag":"MissingValue","error":...}` After: single clean `Missing argument <slug>` printed by @effect/cli
jkomyno committed
Feb 18, 2026 at 19:27 UTC
1d3b6057426bf002764862b48e5f3f35eb740822
1 file changed
+5
-1
ts/packages/cli/src/bin.ts
+5
-1
@@ -1,7 +1,7 @@
1
import process from 'node:process';
2
import { Cause, Console, Effect, Exit, Layer, Logger } from 'effect';
3
import { captureErrors, prettyPrintFromCapturedErrors } from 'effect-errors/index';
4
-import { CliConfig } from '@effect/cli';
4
+import { CliConfig, ValidationError } from '@effect/cli';
5
import { FetchHttpClient } from '@effect/platform';
6
import { BunContext, BunRuntime, BunFileSystem } from '@effect/platform-bun';
7
import type { Teardown } from '@effect/platform/Runtime';
@@ -100,6 +100,10 @@ const runWithArgs = Effect.flatMap(runWithConfig, run => run(process.argv)) sati
100
*/
101
runWithArgs.pipe(
102
Effect.scoped,
103
+ // @effect/cli already prints validation errors (missing args, invalid flags, etc.)
104
+ // via its own printDocs before re-failing. Swallow the error here to avoid
105
+ // routing it through the generic error box which would dump raw JSON.
106
+ Effect.catchIf(ValidationError.isValidationError, () => Effect.void),
107
Effect.withSpan('composio-cli', {
108
attributes: {
109
name: constants.APP_NAME,