@zuke/cli
`@zuke/cli` — the `zuke` command. Install it globally with
@zuke/cli on JSR ↗ 11 symbols
Symbols
const defaultPrompter: Prompter The real Prompter, backed by Deno's prompt/confirm.
type DocRunner = unknown Runs deno doc <args> — the injectable subprocess seam for commandDoc, so the command is testable without spawning deno.
interface ImportFlags Flags accepted by zuke import — the setup flags plus --from.
| Member | Signature | Doc |
|---|---|---|
from? | from?: ImportSource | Force a source (package.json or makefile); auto-detected when unset. |
type ImportSource = package.json | Makefile The kinds of project zuke import can read.
async function main(args: string[], host?: SetupHost, prompter?: Prompter, docRunner?: DocRunner): Promise<number> The CLI entry point. Returns a process exit code; host/prompter/docRunner are injectable for testing.
function parseImportFlags(args: string[]): ImportFlags Parse the argument list following zuke import.
function parseSetupFlags(args: string[]): SetupFlags Parse the argument list following zuke setup.
interface Prompter The interactive surface, injectable so the wizard is testable without a TTY.
| Member | Signature | Doc |
|---|---|---|
interactive | interactive(): boolean | Whether prompts should be shown (i.e. stdin is a terminal). |
ask | ask(question: string, fallback: string): string | Ask a free-text question, returning fallback if unanswered. |
confirm | confirm(question: string): boolean | Ask a yes/no question. |
function resolveDocSpec(pkg: string | undefined): string | undefined Resolve a zuke doc argument to a deno doc specifier: a bare package name (core) becomes jsr:@zuke/core, a scoped name (@scope/pkg) becomes jsr:@scope/pkg, and an explicit jsr:/npm:/https:/file:/path specifier is passed through unchanged. Returns undefined for no argument.
interface SetupFlags Flags accepted by zuke setup.
| Member | Signature | Doc |
|---|---|---|
force | force: boolean | Overwrite existing files. |
yes | yes: boolean | Skip prompts and accept defaults. |
name? | name?: string | Build class name for the starter zuke.ts. |
dir? | dir?: string | Directory to scaffold into (defaults to the current directory). |
launcherName? | launcherName?: string | Base name for the launcher scripts, when zuke is taken by a directory. |
interface SetupHost Injected side effects, so runSetup is unit-testable.
| Member | Signature | Doc |
|---|---|---|
exists | exists(path: string): Promise<boolean> | Whether a path exists. |
isDirectory | isDirectory(path: string): Promise<boolean> | Whether a path exists and is a directory (a reserved-name collision). |
readText | readText(path: string): Promise<string> | Read a file as UTF-8 text. |
writeText | writeText(path: string, content: string): Promise<void> | Write UTF-8 text to a file, creating or truncating it. |
chmod | chmod(path: string, mode: number): Promise<void> | Set a file's permission bits (may be unsupported on some platforms). |
log | log(message: string): void | Emit a line of progress output. |