@optique/clack
v1.3.0
Published
Interactive prompt support for Optique via Clack
Maintainers
Readme
@optique/clack
Interactive prompt support for Optique via Clack.
This package wraps any Optique parser with a Clack prompt that fires when no CLI value is provided.
Installation
deno add jsr:@optique/clack
npm add @optique/clack
pnpm add @optique/clack
yarn add @optique/clack
bun add @optique/clackDocumentation
For full documentation, visit https://optique.dev/integrations/clack.
The guide covers dependency-derived prompt options with
derivePromptConfig(), along with shared validation, retry limits, and
abort signals.
Quick start
import { object } from "@optique/core/constructs";
import { option } from "@optique/core/primitives";
import { integer, string } from "@optique/core/valueparser";
import { prompt } from "@optique/clack";
import { run } from "@optique/run";
const parser = object({
name: prompt(option("--name", string()), {
type: "text",
message: "Project name:",
}),
port: prompt(option("--port", integer()), {
type: "number",
message: "Port:",
initialValue: 3000,
}),
});
await run(parser);License
MIT License. See LICENSE for details.
