effect-cli

Build type-safe command-line applications with Effect CLI argument parsing, flags, and subcommands.

3|Updated Apr 1, 2026
One-click install
npx skills add https://github.com/mpsuesser/opencode-effect-enforcer --skill effect-cli-mpsuesser
Or copy as Structured Prompt for Agent▼
Please help me install this Agent Skill.
Skill: effect-cli
Source: https://github.com/mpsuesser/opencode-effect-enforcer/tree/main/skills/effect-cli
Command: npx skills add https://github.com/mpsuesser/opencode-effect-enforcer --skill effect-cli-mpsuesser

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill requires effect, @effect/platform-node.

What problem does it solve? Building command-line tools in TypeScript often means hand-rolling argument parsing, help text, and validation. This Skill guides an agent to construct type-safe CLIs with the Effect v4 CLI module, covering positional arguments, named flags, subcommands, prompts, and dependency injection without ad-hoc parsing code. ## Core Features & Use Cases - Typed Arguments and Flags: Define positional arguments and named flags with constructors like Argument.String, Flag.Int, and Flag.Boolean, plus combinators for defaults, aliases, validation via Schema, and fallback prompts or env config. - Subcommands and Shared Flags: Compose nested command trees with Command.withSubcommands, grouped listings, and Command.withSharedFlags so parent options flow into subcommand handlers. - Dependency Injection and Runtime: Wire handlers to services with Command.provide, and run the CLI through Command.run with NodeServices.layer and NodeRuntime.runMain. - Use Case: Scaffold a task manager CLI where 'tasks create "Ship 4.0" --priority high' parses typed input, inherits a shared --workspace flag, and executes an Effect handler with injected platform services. ## Quick Start Ask the agent to build an Effect CLI command named 'greet' that accepts a name flag and prints a greeting using Command.make and NodeRuntime.runMain.

Frequently Asked Questions about effect-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I build a CLI with Effect in TypeScript?▼

Import Argument, Command, and Flag from effect/unstable/cli, define a command with Command.make including a config object and an Effect.fn handler, then pipe it through Command.run with a version, provide NodeServices.layer, and execute with NodeRuntime.runMain.

How do I add subcommands to an Effect CLI application?▼

Create each subcommand with Command.make and attach them to a parent using Command.withSubcommands, optionally grouping them with labeled groups. Subcommand handlers access parent config by yielding the parent command inside the generator.

Why does my Effect CLI boolean flag fail when omitted?▼

Bare Flag.Boolean flags are required in Effect v4, so omitting them produces CliError.MissingOption. Add Flag.withDefault(false) for standard opt-in switch behavior, or use Flag.optional when absence carries separate meaning.

Can Effect CLI commands use dependency injection?▼

Yes, Command.provide attaches a Layer to a command, and Command.provideSync or Command.provideEffect supply individual services. These combinators can also receive the parsed config to select layers based on flag values.

How do I test an Effect CLI command with specific arguments?▼

Use Command.runWith with your command and a version to get a function that accepts an argument array directly. Calling it with values like ["--name", "Alice"] returns an Effect you can run in tests without a real terminal.