Initial Commit

This commit is contained in:
2026-05-27 23:29:53 +01:00
commit fbc70f96e6
10000 changed files with 1102152 additions and 0 deletions

View File

@@ -0,0 +1,42 @@
#!/usr/bin/env node
import {
confirm,
multiselect,
select,
text,
} from "@suaveplan/cli/prompt/prompt";
import { runCli } from "../cli/cli.js";
import type { Prompter } from "../types/electrobun.types.js";
const cliPrompter: Prompter = {
text: (opts) => text(opts),
confirm: (opts) => confirm(opts),
select: <T extends string>(opts: {
message: string;
choices: ReadonlyArray<{ value: T; label: string }>;
default?: T;
}): Promise<T> =>
select<T>({
message: opts.message,
choices: [...opts.choices],
...(opts.default === undefined ? {} : { default: opts.default }),
}),
multiselect: <T extends string>(opts: {
message: string;
choices: ReadonlyArray<{ value: T; label: string }>;
}): Promise<readonly T[]> =>
multiselect<T>({
message: opts.message,
choices: [...opts.choices],
}) as Promise<readonly T[]>,
};
runCli(process.argv.slice(2), { prompter: cliPrompter }).then(
({ code }) => {
process.exit(code);
},
(err) => {
process.stderr.write(`${String(err)}\n`);
process.exit(2);
}
);