effect-cli

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

1|Updated Aug 24, 2026
One-click install
npx skills add https://github.com/lambdasolver2/opencode-effect-harness --skill effect-cli-lambdasolver2
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: effect-cli
Source: https://github.com/lambdasolver2/opencode-effect-harness/tree/main/packages/module-typescript/assets/skills/effect-cli
Command: npx skills add https://github.com/lambdasolver2/opencode-effect-harness --skill effect-cli-lambdasolver2

SYSTEM DOCUMENTATION & REQUIREMENTS

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

What problem does it solve? Writing CLI applications in TypeScript often means manual argument parsing, untyped flags, and ad-hoc help text. This Skill provides the patterns for building fully typed command-line tools with the Effect v4 CLI module, including validation, dependency injection, and auto-generated help. ## Core Features & Use Cases - Typed Arguments and Flags: Define positional arguments and named flags with constructors like Argument.string, Flag.integer, Flag.choice, plus combinators for defaults, aliases, validation schemas, and variadic inputs. - Commands and Subcommands: Compose commands with Command.make, nest subcommands, share parent flags via Command.withSharedFlags, and attach handlers written with Effect.fn. - Dependency Injection and Runtime: Provide layers and services per command with Command.provide, and run the CLI through NodeServices.layer and NodeRuntime.runMain. - Use Case: Build a task manager CLI where tasks create "Ship 4.0" --priority high parses typed input, reads a shared --workspace flag from the parent command, and executes an Effect-based handler. ## Quick Start Ask the AI to scaffold an Effect CLI command with typed flags, a subcommand structure, and a Node runtime entry point for your application.

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 your command with Command.make and a typed config object, then attach a handler using Effect.fn. Run it by piping through Command.run, Effect.provide(NodeServices.layer), and NodeRuntime.runMain.

How do I parse positional arguments and flags in Effect CLI?

Use Argument constructors like Argument.string or Argument.integer for positional inputs and Flag constructors like Flag.boolean or Flag.choice for named options. Combinators such as Flag.withDefault, Flag.withAlias, and Argument.variadic refine parsing behavior.

Does Effect CLI support subcommands and shared flags?

Yes. Nest commands with Command.withSubcommands and define parent-level options using Command.withSharedFlags. Subcommand handlers access parent config by yielding the parent command inside the Effect.fn generator.

Why is there no Argument.boolean in Effect CLI?

Argument.boolean intentionally does not exist because booleans are modeled as toggles, not positional values. Use Flag.boolean for --verbose style switches, or Argument.choice with ["true", "false"] if a positional boolean is required.

Can I inject services into Effect CLI command handlers?

Yes. Use Command.provide with a Layer, or Command.provideSync and Command.provideEffect for individual services. The provided layer can depend on the parsed config, letting you switch implementations based on flag values.

How do I test an Effect CLI command with explicit arguments?

Use Command.runWith to create a runnable function that accepts an argument array directly, bypassing process argv. This returns an Effect you can execute in tests with controlled inputs like ["--name", "Alice"].