@cli-use/tui 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,526 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * @license MIT
4
+ * cli-use - React-based Terminal UI Framework
5
+ * Inspired by Ratatui (https://ratatui.rs)
6
+ */
7
+ var __getOwnPropNames = Object.getOwnPropertyNames;
8
+ var __esm = (fn, res) => function __init() {
9
+ return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
10
+ };
11
+
12
+ // node_modules/tsup/assets/esm_shims.js
13
+ import path from "path";
14
+ import { fileURLToPath } from "url";
15
+ var init_esm_shims = __esm({
16
+ "node_modules/tsup/assets/esm_shims.js"() {
17
+ "use strict";
18
+ }
19
+ });
20
+
21
+ // src/examples/ink-demo.tsx
22
+ var ink_demo_exports = {};
23
+ import { useState } from "react";
24
+ import { render, Box, Text, useInput } from "ink";
25
+ import { jsx, jsxs } from "react/jsx-runtime";
26
+ var Counter;
27
+ var init_ink_demo = __esm({
28
+ "src/examples/ink-demo.tsx"() {
29
+ "use strict";
30
+ init_esm_shims();
31
+ Counter = () => {
32
+ const [count, setCount] = useState(0);
33
+ useInput((input, key) => {
34
+ if (key.escape || key.ctrl("c")) {
35
+ process.exit(0);
36
+ }
37
+ if (key.return) {
38
+ setCount((c) => c + 1);
39
+ }
40
+ });
41
+ return /* @__PURE__ */ jsxs(Box, { flexDirection: "column", padding: 1, children: [
42
+ /* @__PURE__ */ jsx(Box, { borderStyle: "double", borderColor: "cyan", padding: 1, marginBottom: 1, children: /* @__PURE__ */ jsx(Text, { bold: true, color: "magenta", children: "\u2728 cli-use Demo - Beautiful Terminal UIs (Ink)" }) }),
43
+ /* @__PURE__ */ jsx(Box, { borderStyle: "single", borderColor: "blue", padding: 1, marginBottom: 1, children: /* @__PURE__ */ jsxs(Box, { flexDirection: "column", gap: 1, children: [
44
+ /* @__PURE__ */ jsx(Text, { bold: true, children: "Features:" }),
45
+ /* @__PURE__ */ jsx(Text, { children: "\u2022 Cross-platform (macOS, Linux, Windows)" }),
46
+ /* @__PURE__ */ jsx(Text, { children: "\u2022 React-based components" }),
47
+ /* @__PURE__ */ jsx(Text, { children: "\u2022 Beautiful styling out of the box" }),
48
+ /* @__PURE__ */ jsx(Text, { children: "\u2022 TypeScript support" })
49
+ ] }) }),
50
+ /* @__PURE__ */ jsx(Box, { borderStyle: "round", borderColor: "green", padding: 1, marginBottom: 1, children: /* @__PURE__ */ jsxs(Box, { flexDirection: "column", alignItems: "center", gap: 1, children: [
51
+ /* @__PURE__ */ jsx(Text, { bold: true, color: "green", children: "\u{1F522} Interactive Counter" }),
52
+ /* @__PURE__ */ jsxs(Text, { children: [
53
+ "Count: ",
54
+ count
55
+ ] }),
56
+ /* @__PURE__ */ jsx(Text, { dim: true, children: "Press Enter to increment, ESC to exit" })
57
+ ] }) }),
58
+ /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(Text, { dim: true, color: "gray", children: "Built with \u2764\uFE0F for beautiful terminal interfaces" }) })
59
+ ] });
60
+ };
61
+ render(/* @__PURE__ */ jsx(Counter, {}));
62
+ }
63
+ });
64
+
65
+ // src/cli/index.ts
66
+ init_esm_shims();
67
+ import { Command } from "commander";
68
+ import chalk from "chalk";
69
+ import { createRequire } from "module";
70
+ import { spawn } from "child_process";
71
+ import { fileURLToPath as fileURLToPath2 } from "url";
72
+ import path2 from "path";
73
+ var require2 = createRequire(import.meta.url);
74
+ var __filename2 = fileURLToPath2(import.meta.url);
75
+ var __dirname2 = path2.dirname(__filename2);
76
+ var program = new Command();
77
+ program.name("cli-use").description("React-based Terminal UI Framework").version("0.1.0");
78
+ program.command("dev").description("Start development mode").action(() => {
79
+ showDevTUI();
80
+ });
81
+ program.command("build").description("Build project").action(() => {
82
+ showBuildTUI();
83
+ });
84
+ program.command("init [project-name]").description("Create a new cli-use project").action((projectName) => {
85
+ showInitTUI(projectName || "my-tui-app");
86
+ });
87
+ program.command("run <example>").description("Run an example application").action((exampleName) => {
88
+ if (exampleName === "ratatui") {
89
+ showRustDemo();
90
+ } else {
91
+ showRunTUI(exampleName);
92
+ }
93
+ });
94
+ program.command("examples").description("List available examples").action(() => {
95
+ showExamplesTUI();
96
+ });
97
+ program.option("-d, --demo", "Run the ink demo").action(() => {
98
+ });
99
+ var options = program.parse(process.argv);
100
+ if (options.opts().demo) {
101
+ Promise.resolve().then(() => (init_ink_demo(), ink_demo_exports)).catch((err) => {
102
+ console.error("Failed to run demo:", err);
103
+ process.exit(1);
104
+ });
105
+ }
106
+ function showRustDemo() {
107
+ const isWindows = process.platform === "win32";
108
+ const extension = isWindows ? ".exe" : "";
109
+ const binaryPath = path2.resolve(
110
+ __dirname2,
111
+ `../../native/target/release/ratatui-demo${extension}`
112
+ );
113
+ console.log(chalk.cyan("Starting Ratatui Demo..."));
114
+ const child = spawn(binaryPath, [], {
115
+ stdio: "inherit"
116
+ });
117
+ child.on("error", (err) => {
118
+ console.error(chalk.red("Failed to start demo:"), err.message);
119
+ console.log(
120
+ chalk.yellow(
121
+ "\nMake sure you have built the Rust binary first by running: npm run build:rust"
122
+ )
123
+ );
124
+ });
125
+ }
126
+ function showDevTUI() {
127
+ console.clear();
128
+ console.log("");
129
+ console.log(
130
+ chalk.cyan("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510")
131
+ );
132
+ console.log(chalk.cyan("\u2502") + " " + chalk.bold.white("cli-use ") + chalk.cyan("\u2502"));
133
+ console.log(
134
+ chalk.cyan("\u2502") + " " + chalk.bold("Development Mode") + " ".repeat(46) + chalk.cyan("\u2502")
135
+ );
136
+ console.log(
137
+ chalk.cyan("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524")
138
+ );
139
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
140
+ console.log(
141
+ chalk.cyan("\u2502") + " " + chalk.yellow("\u25CF") + " " + chalk.white("Watching for changes...") + " ".repeat(36) + chalk.cyan("\u2502")
142
+ );
143
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
144
+ console.log(
145
+ chalk.cyan("\u2502") + " " + chalk.green("\u2713") + " " + chalk.white("Build completed") + " ".repeat(39) + chalk.cyan("\u2502")
146
+ );
147
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
148
+ console.log(
149
+ chalk.cyan("\u2502") + " " + chalk.yellow("\u25CF") + " " + chalk.white("Hot Reload: Active") + " ".repeat(37) + chalk.cyan("\u2502")
150
+ );
151
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
152
+ console.log(
153
+ chalk.cyan("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524")
154
+ );
155
+ console.log(
156
+ chalk.cyan("\u2502") + " " + chalk.bold("Quick Actions") + " ".repeat(43) + chalk.cyan("\u2502")
157
+ );
158
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
159
+ console.log(
160
+ chalk.cyan("\u2502") + " " + chalk.white("[r]") + " " + chalk.white("Rebuild") + " ".repeat(43) + chalk.cyan("\u2502")
161
+ );
162
+ console.log(
163
+ chalk.cyan("\u2502") + " " + chalk.white("[t]") + " " + chalk.white("Run tests") + " ".repeat(43) + chalk.cyan("\u2502")
164
+ );
165
+ console.log(
166
+ chalk.cyan("\u2502") + " " + chalk.white("[e]") + " " + chalk.white("Run example") + " ".repeat(41) + chalk.cyan("\u2502")
167
+ );
168
+ console.log(
169
+ chalk.cyan("\u2502") + " " + chalk.white("[q]") + " " + chalk.white("Quit") + " ".repeat(46) + chalk.cyan("\u2502")
170
+ );
171
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
172
+ console.log(
173
+ chalk.cyan("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524")
174
+ );
175
+ console.log(chalk.cyan("\u2502") + " " + chalk.bold("Output") + " ".repeat(48) + chalk.cyan("\u2502"));
176
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
177
+ console.log(
178
+ chalk.cyan("\u2502") + " " + chalk.green("\u2713") + " " + chalk.white("Starting dev server...") + " ".repeat(36) + chalk.cyan("\u2502")
179
+ );
180
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
181
+ console.log(
182
+ chalk.cyan("\u2502") + " " + chalk.dim("Waiting for file changes...") + " ".repeat(34) + chalk.cyan("\u2502")
183
+ );
184
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
185
+ console.log(
186
+ chalk.cyan("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524")
187
+ );
188
+ console.log(
189
+ chalk.cyan("\u2502") + " " + chalk.bold("Project Status") + " ".repeat(43) + chalk.cyan("\u2502")
190
+ );
191
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
192
+ console.log(
193
+ chalk.cyan("\u2502") + " " + chalk.white("Files: ") + chalk.cyan("142") + " ".repeat(4) + chalk.white("Lines: ") + chalk.cyan("8,547") + " ".repeat(35) + chalk.cyan("\u2502")
194
+ );
195
+ console.log(
196
+ chalk.cyan("\u2502") + " " + chalk.white("Components: ") + chalk.green("7") + " ".repeat(2) + chalk.white("Hooks: ") + chalk.green("8") + " ".repeat(40) + chalk.cyan("\u2502")
197
+ );
198
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
199
+ console.log(
200
+ chalk.cyan("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518")
201
+ );
202
+ console.log("");
203
+ console.log(
204
+ chalk.dim("Press ") + chalk.cyan("Ctrl+C") + chalk.dim(" to exit") + " | " + chalk.dim("Version: ") + chalk.white("0.1.0")
205
+ );
206
+ console.log("");
207
+ }
208
+ function showBuildTUI() {
209
+ console.clear();
210
+ console.log("");
211
+ console.log(
212
+ chalk.cyan("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510")
213
+ );
214
+ console.log(chalk.cyan("\u2502") + " " + chalk.bold.white("cli-use ") + chalk.cyan(" \u2502"));
215
+ console.log(
216
+ chalk.cyan("\u2502") + " " + chalk.bold("Build Progress") + " ".repeat(45) + chalk.cyan("\u2502")
217
+ );
218
+ console.log(
219
+ chalk.cyan("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524")
220
+ );
221
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
222
+ console.log(chalk.cyan("\u2502") + " " + chalk.bold("Building...") + " ".repeat(43) + chalk.cyan("\u2502"));
223
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
224
+ console.log(
225
+ chalk.cyan("\u2502") + " " + chalk.green("\u2713") + " " + chalk.white("TypeScript compilation") + " ".repeat(35) + chalk.cyan("\u2502")
226
+ );
227
+ console.log(
228
+ chalk.cyan("\u2502") + " " + chalk.green("\u2713") + " " + chalk.white("Bundle with tsup") + " ".repeat(38) + chalk.cyan("\u2502")
229
+ );
230
+ console.log(
231
+ chalk.cyan("\u2502") + " " + chalk.green("\u2713") + " " + chalk.white("Generate declarations") + " ".repeat(33) + chalk.cyan("\u2502")
232
+ );
233
+ console.log(
234
+ chalk.cyan("\u2502") + " " + chalk.yellow("\u25CB") + " " + chalk.white("Optimize") + " ".repeat(45) + chalk.cyan("\u2502")
235
+ );
236
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
237
+ console.log(
238
+ chalk.cyan("\u2502") + " [" + chalk.green("\u2588".repeat(30)) + chalk.dim("\u2591".repeat(10)) + "] " + chalk.white("75%") + " ".repeat(4) + chalk.cyan("\u2502")
239
+ );
240
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
241
+ console.log(
242
+ chalk.cyan("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524")
243
+ );
244
+ console.log(
245
+ chalk.cyan("\u2502") + " " + chalk.bold("Output Files") + " ".repeat(43) + chalk.cyan("\u2502")
246
+ );
247
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
248
+ console.log(chalk.cyan("\u2502") + " " + chalk.cyan("dist/") + " ".repeat(49) + chalk.cyan("\u2502"));
249
+ console.log(
250
+ chalk.cyan("\u2502") + " " + chalk.dim("\u251C\u2500\u2500 index.js ") + chalk.dim("(") + chalk.white("21.2 KB") + chalk.dim(")") + " ".repeat(36) + chalk.cyan("\u2502")
251
+ );
252
+ console.log(chalk.cyan("\u2502") + " " + chalk.dim("\u251C\u2500\u2500 cli/") + " ".repeat(47) + chalk.cyan("\u2502"));
253
+ console.log(
254
+ chalk.cyan("\u2502") + " " + chalk.dim("\u2502 \u2514\u2500\u2500 index.js ") + chalk.dim("(") + chalk.white("3.0 KB") + chalk.dim(")") + " ".repeat(34) + chalk.cyan("\u2502")
255
+ );
256
+ console.log(chalk.cyan("\u2502") + " " + chalk.dim("\u251C\u2500\u2500 hooks/") + " ".repeat(45) + chalk.cyan("\u2502"));
257
+ console.log(
258
+ chalk.cyan("\u2502") + " " + chalk.dim("\u2502 \u2514\u2500\u2500 index.js ") + chalk.dim("(") + chalk.white("7.3 KB") + chalk.dim(")") + " ".repeat(34) + chalk.cyan("\u2502")
259
+ );
260
+ console.log(
261
+ chalk.cyan("\u2502") + " " + chalk.dim("\u251C\u2500\u2500 *.d.ts ") + chalk.dim("(") + chalk.white("4.2 KB") + chalk.dim(")") + " ".repeat(39) + chalk.cyan("\u2502")
262
+ );
263
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
264
+ console.log(
265
+ chalk.cyan("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524")
266
+ );
267
+ console.log(
268
+ chalk.cyan("\u2502") + " " + chalk.bold("Build Summary") + " ".repeat(43) + chalk.cyan("\u2502")
269
+ );
270
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
271
+ console.log(
272
+ chalk.cyan("\u2502") + " " + chalk.white("Duration: ") + chalk.cyan("2.4s") + " ".repeat(45) + chalk.cyan("\u2502")
273
+ );
274
+ console.log(
275
+ chalk.cyan("\u2502") + " " + chalk.white("Bundles: ") + chalk.green("3") + " ".repeat(45) + chalk.cyan("\u2502")
276
+ );
277
+ console.log(
278
+ chalk.cyan("\u2502") + " " + chalk.white("Size: ") + chalk.cyan("31.5 KB") + " ".repeat(45) + chalk.cyan("\u2502")
279
+ );
280
+ console.log(
281
+ chalk.cyan("\u2502") + " " + chalk.white("Status: ") + chalk.green("\u2713 Success") + " ".repeat(42) + chalk.cyan("\u2502")
282
+ );
283
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
284
+ console.log(
285
+ chalk.cyan("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518")
286
+ );
287
+ console.log("");
288
+ }
289
+ function showInitTUI(projectName) {
290
+ console.clear();
291
+ console.log("");
292
+ console.log(
293
+ chalk.cyan("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510")
294
+ );
295
+ console.log(chalk.cyan("\u2502") + " " + chalk.bold.white("cli-use ") + chalk.cyan("\u2502"));
296
+ console.log(
297
+ chalk.cyan("\u2502") + " " + chalk.bold("Project Setup") + " ".repeat(45) + chalk.cyan("\u2502")
298
+ );
299
+ console.log(
300
+ chalk.cyan("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524")
301
+ );
302
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
303
+ console.log(
304
+ chalk.cyan("\u2502") + " " + chalk.bold("Creating new project:") + " ".repeat(37) + chalk.cyan("\u2502")
305
+ );
306
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
307
+ console.log(
308
+ chalk.cyan("\u2502") + " " + chalk.cyan("\u25CB") + " " + chalk.white("Project name: ") + chalk.green(projectName) + " ".repeat(34) + chalk.cyan("\u2502")
309
+ );
310
+ console.log(
311
+ chalk.cyan("\u2502") + " " + chalk.green("\u2713") + " " + chalk.white("Package: ") + chalk.cyan("cli-use@0.1.0") + " ".repeat(32) + chalk.cyan("\u2502")
312
+ );
313
+ console.log(
314
+ chalk.cyan("\u2502") + " " + chalk.green("\u2713") + " " + chalk.white("Template: ") + chalk.cyan("default") + " ".repeat(38) + chalk.cyan("\u2502")
315
+ );
316
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
317
+ console.log(
318
+ chalk.cyan("\u2502") + " " + chalk.bold("Project Structure") + " ".repeat(39) + chalk.cyan("\u2502")
319
+ );
320
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
321
+ console.log(chalk.cyan("\u2502") + " " + chalk.cyan("src/") + " ".repeat(49) + chalk.cyan("\u2502"));
322
+ console.log(
323
+ chalk.cyan("\u2502") + " " + chalk.dim("\u251C\u2500\u2500 components/") + " ".repeat(45) + chalk.cyan("\u2502")
324
+ );
325
+ console.log(
326
+ chalk.cyan("\u2502") + " " + chalk.dim("\u2502 \u251C\u2500\u2500 Box.tsx") + " ".repeat(42) + chalk.cyan("\u2502")
327
+ );
328
+ console.log(
329
+ chalk.cyan("\u2502") + " " + chalk.dim("\u2502 \u251C\u2500\u2500 Text.tsx") + " ".repeat(42) + chalk.cyan("\u2502")
330
+ );
331
+ console.log(
332
+ chalk.cyan("\u2502") + " " + chalk.dim("\u2502 \u251C\u2500\u2500 Button.tsx") + " ".repeat(40) + chalk.cyan("\u2502")
333
+ );
334
+ console.log(chalk.cyan("\u2502") + " " + chalk.dim("\u2502 \u2514\u2500\u2500 ...") + " ".repeat(47) + chalk.cyan("\u2502"));
335
+ console.log(chalk.cyan("\u2502") + " " + chalk.dim("\u251C\u2500\u2500 hooks/") + " ".repeat(47) + chalk.cyan("\u2502"));
336
+ console.log(
337
+ chalk.cyan("\u2502") + " " + chalk.dim("\u251C\u2500\u2500 renderer/") + " ".repeat(44) + chalk.cyan("\u2502")
338
+ );
339
+ console.log(chalk.cyan("\u2502") + " " + chalk.dim("\u251C\u2500\u2500 App.tsx") + " ".repeat(45) + chalk.cyan("\u2502"));
340
+ console.log(chalk.cyan("\u2502") + " " + chalk.dim("\u251C\u2500\u2500 index.ts") + " ".repeat(45) + chalk.cyan("\u2502"));
341
+ console.log(
342
+ chalk.cyan("\u2502") + " " + chalk.dim("\u2514\u2500\u2500 package.json") + " ".repeat(43) + chalk.cyan("\u2502")
343
+ );
344
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
345
+ console.log(
346
+ chalk.cyan("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524")
347
+ );
348
+ console.log(chalk.cyan("\u2502") + " " + chalk.bold("Next Steps") + " ".repeat(45) + chalk.cyan("\u2502"));
349
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
350
+ console.log(
351
+ chalk.cyan("\u2502") + " " + chalk.cyan("1.") + " " + chalk.white("cd " + projectName) + " ".repeat(40) + chalk.cyan("\u2502")
352
+ );
353
+ console.log(
354
+ chalk.cyan("\u2502") + " " + chalk.cyan("2.") + " " + chalk.white("npm install") + " ".repeat(44) + chalk.cyan("\u2502")
355
+ );
356
+ console.log(
357
+ chalk.cyan("\u2502") + " " + chalk.cyan("3.") + " " + chalk.white("npm run dev") + " ".repeat(43) + chalk.cyan("\u2502")
358
+ );
359
+ console.log(
360
+ chalk.cyan("\u2502") + " " + chalk.cyan("4.") + " " + chalk.white("Start building!") + " ".repeat(42) + chalk.cyan("\u2502")
361
+ );
362
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
363
+ console.log(
364
+ chalk.cyan("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518")
365
+ );
366
+ console.log("");
367
+ }
368
+ function showRunTUI(exampleName) {
369
+ console.clear();
370
+ console.log("");
371
+ console.log(
372
+ chalk.cyan("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510")
373
+ );
374
+ console.log(chalk.cyan("\u2502") + " " + chalk.bold.white("cli-use ") + chalk.cyan(" \u2502"));
375
+ console.log(
376
+ chalk.cyan("\u2502") + " " + chalk.bold("Example Runner") + " ".repeat(44) + chalk.cyan("\u2502")
377
+ );
378
+ console.log(
379
+ chalk.cyan("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524")
380
+ );
381
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
382
+ console.log(
383
+ chalk.cyan("\u2502") + " " + chalk.bold("Running: ") + chalk.cyan(exampleName) + " ".repeat(39) + chalk.cyan("\u2502")
384
+ );
385
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
386
+ const examples = [
387
+ {
388
+ name: "counter",
389
+ title: "Counter",
390
+ desc: "Interactive counter with keyboard controls",
391
+ tags: ["beginner", "hooks"]
392
+ },
393
+ { name: "demo", title: "Demo", desc: "Feature demonstration showcase", tags: ["overview"] },
394
+ {
395
+ name: "todos",
396
+ title: "Todo List",
397
+ desc: "Todo list with navigation",
398
+ tags: ["interactive", "state"]
399
+ },
400
+ {
401
+ name: "ratatui",
402
+ title: "Rust Demo",
403
+ desc: "Native Rust TUI integration",
404
+ tags: ["rust", "advanced"]
405
+ }
406
+ ];
407
+ examples.forEach((ex, i) => {
408
+ const isCurrent = ex.name === exampleName;
409
+ const status = isCurrent ? chalk.green("\u25CF") : chalk.dim("\u25CB");
410
+ const marker = isCurrent ? chalk.cyan("\u25B6") : chalk.dim(" ");
411
+ console.log(
412
+ chalk.cyan("\u2502") + " " + marker + " " + status + " " + chalk.white(ex.name) + " ".repeat(39) + chalk.cyan("\u2502")
413
+ );
414
+ console.log(chalk.cyan("\u2502") + " " + chalk.dim(ex.desc) + " ".repeat(47) + chalk.cyan("\u2502"));
415
+ if (i < examples.length - 1) {
416
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
417
+ }
418
+ });
419
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
420
+ console.log(
421
+ chalk.cyan("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524")
422
+ );
423
+ console.log(chalk.cyan("\u2502") + " " + chalk.bold("Controls") + " ".repeat(46) + chalk.cyan("\u2502"));
424
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
425
+ console.log(
426
+ chalk.cyan("\u2502") + " " + chalk.cyan("\u2191/\u2193") + " " + chalk.white("Navigate") + " ".repeat(43) + chalk.cyan("\u2502")
427
+ );
428
+ console.log(
429
+ chalk.cyan("\u2502") + " " + chalk.cyan("q") + " " + chalk.white("Quit") + " ".repeat(46) + chalk.cyan("\u2502")
430
+ );
431
+ console.log(
432
+ chalk.cyan("\u2502") + " " + chalk.cyan("r") + " " + chalk.white("Restart") + " ".repeat(43) + chalk.cyan("\u2502")
433
+ );
434
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
435
+ console.log(
436
+ chalk.cyan("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524")
437
+ );
438
+ console.log(chalk.cyan("\u2502") + " " + chalk.bold("Output") + " ".repeat(47) + chalk.cyan("\u2502"));
439
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
440
+ console.log(
441
+ chalk.cyan("\u2502") + " " + chalk.green("\u2713") + " " + chalk.white("Example started successfully") + " ".repeat(32) + chalk.cyan("\u2502")
442
+ );
443
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
444
+ console.log(
445
+ chalk.cyan("\u2502") + " " + chalk.dim("Use arrow keys to interact with example") + " ".repeat(19) + chalk.cyan("\u2502")
446
+ );
447
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
448
+ console.log(
449
+ chalk.cyan("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518")
450
+ );
451
+ console.log("");
452
+ }
453
+ function showExamplesTUI() {
454
+ console.clear();
455
+ console.log("");
456
+ console.log(
457
+ chalk.cyan("\u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510")
458
+ );
459
+ console.log(chalk.cyan("\u2502") + " " + chalk.bold.white("cli-use ") + chalk.cyan(" \u2502"));
460
+ console.log(
461
+ chalk.cyan("\u2502") + " " + chalk.bold("Example Gallery") + " ".repeat(43) + chalk.cyan("\u2502")
462
+ );
463
+ console.log(
464
+ chalk.cyan("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524")
465
+ );
466
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
467
+ const examples = [
468
+ {
469
+ name: "counter",
470
+ title: "Counter",
471
+ desc: "Interactive counter with keyboard controls",
472
+ tags: ["beginner", "hooks"]
473
+ },
474
+ { name: "demo", title: "Demo", desc: "Feature demonstration showcase", tags: ["overview"] },
475
+ {
476
+ name: "todos",
477
+ title: "Todo List",
478
+ desc: "Todo list with navigation",
479
+ tags: ["interactive", "state"]
480
+ }
481
+ ];
482
+ examples.forEach((ex, i) => {
483
+ const status = i === 0 ? chalk.cyan("\u25B6") : chalk.dim("\u25CB");
484
+ const tags = ex.tags.map((t) => chalk.dim("[") + chalk.cyan(t) + chalk.dim("]")).join(" ");
485
+ console.log(
486
+ chalk.cyan("\u2502") + " " + status + " " + chalk.bold(ex.name) + " - " + chalk.white(ex.title) + " ".repeat(26) + chalk.cyan("\u2502")
487
+ );
488
+ console.log(
489
+ chalk.cyan("\u2502") + " " + chalk.dim(ex.desc) + " ".repeat(33) + tags + " ".repeat(5) + chalk.cyan("\u2502")
490
+ );
491
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
492
+ });
493
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
494
+ console.log(
495
+ chalk.cyan("\u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524")
496
+ );
497
+ console.log(chalk.cyan("\u2502") + " " + chalk.bold("Commands") + " ".repeat(46) + chalk.cyan("\u2502"));
498
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
499
+ console.log(
500
+ chalk.cyan("\u2502") + " " + chalk.cyan("cli-use run counter") + " ".repeat(34) + chalk.cyan("\u2502")
501
+ );
502
+ console.log(
503
+ chalk.cyan("\u2502") + " " + chalk.cyan("cli-use run demo") + " ".repeat(36) + chalk.cyan("\u2502")
504
+ );
505
+ console.log(
506
+ chalk.cyan("\u2502") + " " + chalk.cyan("cli-use run todos") + " ".repeat(35) + chalk.cyan("\u2502")
507
+ );
508
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
509
+ console.log(chalk.cyan("\u2502") + " " + chalk.bold("Shortcuts") + " ".repeat(46) + chalk.cyan("\u2502"));
510
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
511
+ console.log(
512
+ chalk.cyan("\u2502") + " " + chalk.cyan("n") + "/" + chalk.cyan("p") + " " + chalk.white("Next/Prev example") + " ".repeat(36) + chalk.cyan("\u2502")
513
+ );
514
+ console.log(
515
+ chalk.cyan("\u2502") + " " + chalk.cyan("enter") + " " + chalk.white("Run selected") + " ".repeat(39) + chalk.cyan("\u2502")
516
+ );
517
+ console.log(
518
+ chalk.cyan("\u2502") + " " + chalk.cyan("q") + " " + chalk.white("Quit") + " ".repeat(44) + chalk.cyan("\u2502")
519
+ );
520
+ console.log(chalk.cyan("\u2502") + " " + " ".repeat(54) + chalk.cyan("\u2502"));
521
+ console.log(
522
+ chalk.cyan("\u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518")
523
+ );
524
+ console.log("");
525
+ }
526
+ //# sourceMappingURL=index.js.map