@pokit/prompter-clack
v0.0.20
Published
Clack-based prompter adapter for pok CLI applications
Maintainers
Readme
@pokit/prompter-clack
Interactive prompts adapter for pok using Clack.
Installation
bun add @pokit/prompter-clackUsage
import { run } from '@pokit/core';
import { createPrompter } from '@pokit/prompter-clack';
await run(args, {
prompter: createPrompter(),
// ...
});Features
- Text input prompts
- Password/secret input
- Confirmation prompts
- Select menus (single choice)
- Multi-select menus
What It Does
When a command defines required context fields that aren't provided via flags, pok uses the prompter to interactively request them:
export const command = defineCommand({
context: {
env: {
from: 'flag',
schema: z.enum(['dev', 'staging', 'prod']),
description: 'Target environment',
},
},
run: async (r, ctx) => {
// If --env not provided, prompter asks user to select
},
});$ mycli deploy
? Select environment > dev / staging / prodDocumentation
See the full documentation.
