alimberdi 0.0.0-stage → 0.2.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.
Files changed (55) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +50 -2
  3. package/dist/app/interactive-app.d.ts +19 -0
  4. package/dist/app/interactive-app.d.ts.map +1 -0
  5. package/dist/app/interactive-app.js +231 -0
  6. package/dist/app/interactive-app.js.map +1 -0
  7. package/dist/app/run-cli.d.ts +3 -0
  8. package/dist/app/run-cli.d.ts.map +1 -0
  9. package/dist/app/run-cli.js +33 -0
  10. package/dist/app/run-cli.js.map +1 -0
  11. package/dist/cli.d.ts +3 -0
  12. package/dist/cli.d.ts.map +1 -0
  13. package/dist/cli.js +4 -0
  14. package/dist/cli.js.map +1 -0
  15. package/dist/commands/contact.d.ts +2 -0
  16. package/dist/commands/contact.d.ts.map +1 -0
  17. package/dist/commands/contact.js +10 -0
  18. package/dist/commands/contact.js.map +1 -0
  19. package/dist/commands/help.d.ts +2 -0
  20. package/dist/commands/help.d.ts.map +1 -0
  21. package/dist/commands/help.js +15 -0
  22. package/dist/commands/help.js.map +1 -0
  23. package/dist/commands/home.d.ts +2 -0
  24. package/dist/commands/home.d.ts.map +1 -0
  25. package/dist/commands/home.js +17 -0
  26. package/dist/commands/home.js.map +1 -0
  27. package/dist/commands/play.d.ts +2 -0
  28. package/dist/commands/play.d.ts.map +1 -0
  29. package/dist/commands/play.js +37 -0
  30. package/dist/commands/play.js.map +1 -0
  31. package/dist/commands/projects.d.ts +2 -0
  32. package/dist/commands/projects.d.ts.map +1 -0
  33. package/dist/commands/projects.js +10 -0
  34. package/dist/commands/projects.js.map +1 -0
  35. package/dist/domain/profile.d.ts +12 -0
  36. package/dist/domain/profile.d.ts.map +1 -0
  37. package/dist/domain/profile.js +14 -0
  38. package/dist/domain/profile.js.map +1 -0
  39. package/dist/ui/ansi.d.ts +20 -0
  40. package/dist/ui/ansi.d.ts.map +1 -0
  41. package/dist/ui/ansi.js +39 -0
  42. package/dist/ui/ansi.js.map +1 -0
  43. package/dist/ui/box.d.ts +2 -0
  44. package/dist/ui/box.d.ts.map +1 -0
  45. package/dist/ui/box.js +13 -0
  46. package/dist/ui/box.js.map +1 -0
  47. package/dist/ui/format.d.ts +5 -0
  48. package/dist/ui/format.d.ts.map +1 -0
  49. package/dist/ui/format.js +9 -0
  50. package/dist/ui/format.js.map +1 -0
  51. package/dist/ui/frame.d.ts +17 -0
  52. package/dist/ui/frame.d.ts.map +1 -0
  53. package/dist/ui/frame.js +60 -0
  54. package/dist/ui/frame.js.map +1 -0
  55. package/package.json +42 -4
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Adilkhan Alimberdi
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,3 +1,51 @@
1
- # Temporary Holding Version
1
+ # Alimberdi CLI
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ An interactive personal terminal application for Adilkhan Alimberdi.
4
+
5
+ The default command opens a centered full-screen terminal interface. Navigate
6
+ with the arrow keys, select with Enter, go back with Escape, and quit with Q.
7
+
8
+ ## Run
9
+
10
+ ```bash
11
+ npx alimberdi
12
+ ```
13
+
14
+ Available commands:
15
+
16
+ ```bash
17
+ npx alimberdi projects
18
+ npx alimberdi contact
19
+ npx alimberdi play rock
20
+ npx alimberdi help
21
+ ```
22
+
23
+ ## Controls
24
+
25
+ | Key | Action |
26
+ | --- | --- |
27
+ | `↑` / `↓` | Move between actions |
28
+ | `Enter` | Select |
29
+ | `Esc` / `←` | Go back |
30
+ | `Q` | Exit and restore the terminal |
31
+
32
+ ## Local development
33
+
34
+ Requires Node.js 22 or newer.
35
+
36
+ ```bash
37
+ npm install
38
+ npm run dev
39
+ npm test
40
+ ```
41
+
42
+ ## Project structure
43
+
44
+ - `src/app` coordinates command execution.
45
+ - `src/commands` contains independent CLI commands.
46
+ - `src/domain` contains profile data and domain types.
47
+ - `src/ui` contains terminal presentation helpers.
48
+
49
+ ## License
50
+
51
+ MIT
@@ -0,0 +1,19 @@
1
+ export declare class InteractiveApp {
2
+ private readonly input;
3
+ private readonly output;
4
+ private screen;
5
+ private selectedIndex;
6
+ private gameResult;
7
+ private resolve;
8
+ constructor(input: NodeJS.ReadStream, output: NodeJS.WriteStream);
9
+ run(): Promise<void>;
10
+ private readonly onKeypress;
11
+ private readonly render;
12
+ private content;
13
+ private actions;
14
+ private goTo;
15
+ private play;
16
+ private exit;
17
+ }
18
+ export declare function runInteractiveApp(input: NodeJS.ReadStream, output: NodeJS.WriteStream): Promise<void>;
19
+ //# sourceMappingURL=interactive-app.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interactive-app.d.ts","sourceRoot":"","sources":["../../src/app/interactive-app.ts"],"names":[],"mappings":"AAwCA,qBAAa,cAAc;IAOvB,OAAO,CAAC,QAAQ,CAAC,KAAK;IACtB,OAAO,CAAC,QAAQ,CAAC,MAAM;IAPzB,OAAO,CAAC,MAAM,CAAkB;IAChC,OAAO,CAAC,aAAa,CAAK;IAC1B,OAAO,CAAC,UAAU,CAAqB;IACvC,OAAO,CAAC,OAAO,CAA2B;gBAGvB,KAAK,EAAE,MAAM,CAAC,UAAU,EACxB,MAAM,EAAE,MAAM,CAAC,WAAW;IAGtC,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IAa3B,OAAO,CAAC,QAAQ,CAAC,UAAU,CA0BzB;IAEF,OAAO,CAAC,QAAQ,CAAC,MAAM,CAerB;IAEF,OAAO,CAAC,OAAO;IAyDf,OAAO,CAAC,OAAO;IA+Df,OAAO,CAAC,IAAI;IAMZ,OAAO,CAAC,IAAI;IAYZ,OAAO,CAAC,IAAI;CASb;AAED,wBAAsB,iBAAiB,CACrC,KAAK,EAAE,MAAM,CAAC,UAAU,EACxB,MAAM,EAAE,MAAM,CAAC,WAAW,GACzB,OAAO,CAAC,IAAI,CAAC,CAEf"}
@@ -0,0 +1,231 @@
1
+ import { spawn } from "node:child_process";
2
+ import readline from "node:readline";
3
+ import { profile } from "../domain/profile.js";
4
+ import { color, control } from "../ui/ansi.js";
5
+ import { centerInTerminal, renderFrame } from "../ui/frame.js";
6
+ const winningMove = {
7
+ rock: "scissors",
8
+ paper: "rock",
9
+ scissors: "paper",
10
+ };
11
+ function openExternal(url) {
12
+ const command = process.platform === "win32"
13
+ ? { file: "cmd.exe", args: ["/d", "/s", "/c", "start", "", url] }
14
+ : process.platform === "darwin"
15
+ ? { file: "open", args: [url] }
16
+ : { file: "xdg-open", args: [url] };
17
+ spawn(command.file, command.args, {
18
+ detached: true,
19
+ stdio: "ignore",
20
+ windowsHide: true,
21
+ }).unref();
22
+ }
23
+ export class InteractiveApp {
24
+ input;
25
+ output;
26
+ screen = "home";
27
+ selectedIndex = 0;
28
+ gameResult;
29
+ resolve;
30
+ constructor(input, output) {
31
+ this.input = input;
32
+ this.output = output;
33
+ }
34
+ run() {
35
+ return new Promise((resolve) => {
36
+ this.resolve = resolve;
37
+ readline.emitKeypressEvents(this.input);
38
+ this.input.setRawMode?.(true);
39
+ this.input.resume();
40
+ this.input.on("keypress", this.onKeypress);
41
+ this.output.on("resize", this.render);
42
+ this.output.write(`${control.alternateScreen}${control.hideCursor}${control.clear}`);
43
+ this.render();
44
+ });
45
+ }
46
+ onKeypress = (_input, key) => {
47
+ if ((key.ctrl === true && key.name === "c") || key.name === "q") {
48
+ this.exit();
49
+ return;
50
+ }
51
+ if (key.name === "escape" || key.name === "left" || key.name === "backspace") {
52
+ if (this.screen === "home") {
53
+ this.exit();
54
+ }
55
+ else {
56
+ this.goTo("home");
57
+ }
58
+ return;
59
+ }
60
+ const actions = this.actions();
61
+ if (key.name === "up" || key.name === "k") {
62
+ this.selectedIndex = (this.selectedIndex - 1 + actions.length) % actions.length;
63
+ this.render();
64
+ }
65
+ else if (key.name === "down" || key.name === "j") {
66
+ this.selectedIndex = (this.selectedIndex + 1) % actions.length;
67
+ this.render();
68
+ }
69
+ else if (key.name === "return" || key.name === "enter" || key.name === "right") {
70
+ actions[this.selectedIndex]?.run();
71
+ this.render();
72
+ }
73
+ };
74
+ render = () => {
75
+ const columns = Math.max(48, this.output.columns ?? 80);
76
+ const rows = Math.max(20, this.output.rows ?? 24);
77
+ const width = Math.min(76, columns - 4);
78
+ const actions = this.actions();
79
+ const frame = renderFrame({
80
+ ...this.content(),
81
+ menu: actions.map((action) => action.row),
82
+ selectedIndex: this.selectedIndex,
83
+ }, width);
84
+ this.output.write(`${control.clear}${centerInTerminal(frame, columns, rows)}`);
85
+ };
86
+ content() {
87
+ switch (this.screen) {
88
+ case "about":
89
+ return {
90
+ title: "About me",
91
+ subtitle: `@${profile.handle}`,
92
+ body: [
93
+ ...profile.bio,
94
+ "",
95
+ `${color.gray("FOCUS")} software · tools · experiments`,
96
+ `${color.gray("NOW")} building one useful thing at a time`,
97
+ ],
98
+ };
99
+ case "projects":
100
+ return {
101
+ title: "Projects",
102
+ subtitle: "ideas becoming software",
103
+ body: [
104
+ `${color.cyan("alimberdi-cli")} personal terminal experience`,
105
+ `${color.gray("status")} v0.2 · open source soon`,
106
+ "",
107
+ "More projects are on the way.",
108
+ ],
109
+ };
110
+ case "contact":
111
+ return {
112
+ title: "Let's connect",
113
+ subtitle: "the internet is one click away",
114
+ body: [
115
+ `${color.gray("GitHub")} github.com/adilkhanalimberdi`,
116
+ `${color.gray("Telegram")} t.me/adilkhanalimberdi`,
117
+ "",
118
+ color.dim("Select a link and press Enter to open it."),
119
+ ],
120
+ };
121
+ case "play":
122
+ return {
123
+ title: "Rock · Paper · Scissors",
124
+ subtitle: "pick your move",
125
+ body: [
126
+ "A tiny game living inside the terminal.",
127
+ ...(this.gameResult === undefined ? [] : ["", color.yellow(this.gameResult)]),
128
+ ],
129
+ };
130
+ case "home":
131
+ return {
132
+ title: profile.displayName,
133
+ subtitle: profile.tagline,
134
+ body: [
135
+ "Welcome to my corner of the terminal.",
136
+ "Explore, connect, or stay for a tiny game.",
137
+ ],
138
+ footer: "↑↓ navigate enter select q quit",
139
+ };
140
+ }
141
+ }
142
+ actions() {
143
+ const back = {
144
+ row: { label: "Back", description: "Return to the main screen" },
145
+ run: () => this.goTo("home"),
146
+ };
147
+ switch (this.screen) {
148
+ case "about":
149
+ return [back];
150
+ case "projects":
151
+ return [
152
+ {
153
+ row: { label: "GitHub", description: "Open my repositories" },
154
+ run: () => openExternal(profile.links.github),
155
+ },
156
+ back,
157
+ ];
158
+ case "contact":
159
+ return [
160
+ {
161
+ row: { label: "GitHub", description: "Open my profile" },
162
+ run: () => openExternal(profile.links.github),
163
+ },
164
+ {
165
+ row: { label: "Telegram", description: "Start a conversation" },
166
+ run: () => openExternal(profile.links.telegram),
167
+ },
168
+ back,
169
+ ];
170
+ case "play":
171
+ return [
172
+ ...["rock", "paper", "scissors"].map((move) => ({
173
+ row: { label: move[0]?.toUpperCase() + move.slice(1), description: "Choose this move" },
174
+ run: () => this.play(move),
175
+ })),
176
+ back,
177
+ ];
178
+ case "home":
179
+ return [
180
+ {
181
+ row: { label: "About", description: "A little context about me" },
182
+ run: () => this.goTo("about"),
183
+ },
184
+ {
185
+ row: { label: "Projects", description: "Things I am building" },
186
+ run: () => this.goTo("projects"),
187
+ },
188
+ {
189
+ row: { label: "Contact", description: "Find me online" },
190
+ run: () => this.goTo("contact"),
191
+ },
192
+ {
193
+ row: { label: "Play", description: "Rock, paper, scissors" },
194
+ run: () => this.goTo("play"),
195
+ },
196
+ {
197
+ row: { label: "Exit", description: "Return to your terminal" },
198
+ run: () => this.exit(),
199
+ },
200
+ ];
201
+ }
202
+ }
203
+ goTo(screen) {
204
+ this.screen = screen;
205
+ this.selectedIndex = 0;
206
+ this.gameResult = undefined;
207
+ }
208
+ play(move) {
209
+ const moves = ["rock", "paper", "scissors"];
210
+ const computer = moves[Math.floor(Math.random() * moves.length)] ?? "rock";
211
+ const outcome = move === computer
212
+ ? "Draw. Great minds think alike."
213
+ : winningMove[move] === computer
214
+ ? "You win. The terminal accepts defeat."
215
+ : "Computer wins. Rematch?";
216
+ this.gameResult = `You: ${move} · CPU: ${computer} — ${outcome}`;
217
+ }
218
+ exit() {
219
+ this.input.off("keypress", this.onKeypress);
220
+ this.output.off("resize", this.render);
221
+ this.input.setRawMode?.(false);
222
+ this.input.pause();
223
+ this.input.unref?.();
224
+ this.output.write(`${control.showCursor}${control.mainScreen}`);
225
+ this.resolve?.();
226
+ }
227
+ }
228
+ export async function runInteractiveApp(input, output) {
229
+ await new InteractiveApp(input, output).run();
230
+ }
231
+ //# sourceMappingURL=interactive-app.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interactive-app.js","sourceRoot":"","sources":["../../src/app/interactive-app.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,QAAQ,MAAM,eAAe,CAAC;AACrC,OAAO,EAAE,OAAO,EAAE,MAAM,sBA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C,KAAK,EAAE,CAAC;QAClB,IAAI,CAAC,KAAoD,CAAC,KAAK,EAAE,EAAE,CAAC;QACrE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC,CAAC;QAChE,IAAI,CAAC,OAAO,EAAE,EAAE,CAAC;IACnB,CAAC;CACF;AAED,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,KAAwB,EACxB,MAA0B;IAE1B,MAAM,IAAI,cAAc,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC;AAChD,CAAC"}
@@ -0,0 +1,3 @@
1
+ export declare function execute(args: readonly string[]): string;
2
+ export declare function runCli(args: readonly string[], input: NodeJS.ReadStream, output: NodeJS.WriteStream): Promise<void>;
3
+ //# sourceMappingURL=run-cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-cli.d.ts","sourceRoot":"","sources":["../../src/app/run-cli.ts"],"names":[],"mappings":"AAkBA,wBAAgB,OAAO,CAAC,IAAI,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CAavD;AAED,wBAAsB,MAAM,CAC1B,IAAI,EAAE,SAAS,MAAM,EAAE,EACvB,KAAK,EAAE,MAAM,CAAC,UAAU,EACxB,MAAM,EAAE,MAAM,CAAC,WAAW,GACzB,OAAO,CAAC,IAAI,CAAC,CAOf"}
@@ -0,0 +1,33 @@
1
+ import { renderContact } from "../commands/contact.js";
2
+ import { renderHelp } from "../commands/help.js";
3
+ import { renderHome } from "../commands/home.js";
4
+ import { renderPlay } from "../commands/play.js";
5
+ import { renderProjects } from "../commands/projects.js";
6
+ import { runInteractiveApp } from "./interactive-app.js";
7
+ const commands = {
8
+ contact: () => renderContact(),
9
+ help: () => renderHelp(),
10
+ play: (args) => renderPlay(args[0]),
11
+ projects: () => renderProjects(),
12
+ "--help": () => renderHelp(),
13
+ "-h": () => renderHelp(),
14
+ };
15
+ export function execute(args) {
16
+ const [command, ...commandArgs] = args;
17
+ if (command === undefined) {
18
+ return renderHome();
19
+ }
20
+ const renderer = commands[command];
21
+ if (renderer === undefined) {
22
+ return `Unknown command: ${command}\n\n${renderHelp()}`;
23
+ }
24
+ return renderer(commandArgs);
25
+ }
26
+ export async function runCli(args, input, output) {
27
+ if (args.length === 0 && input.isTTY === true && output.isTTY === true) {
28
+ await runInteractiveApp(input, output);
29
+ return;
30
+ }
31
+ output.write(`${execute(args)}\n`);
32
+ }
33
+ //# sourceMappingURL=run-cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"run-cli.js","sourceRoot":"","sources":["../../src/app/run-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AACvD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAIzD,MAAM,QAAQ,GAAuC;IACnD,OAAO,EAAE,GAAG,EAAE,CAAC,aAAa,EAAE;IAC9B,IAAI,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE;IACxB,IAAI,EAAE,CAAC,IAAI,EAAE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IACnC,QAAQ,EAAE,GAAG,EAAE,CAAC,cAAc,EAAE;IAChC,QAAQ,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE;IAC5B,IAAI,EAAE,GAAG,EAAE,CAAC,UAAU,EAAE;CACzB,CAAC;AAEF,MAAM,UAAU,OAAO,CAAC,IAAuB;IAC7C,MAAM,CAAC,OAAO,EAAE,GAAG,WAAW,CAAC,GAAG,IAAI,CAAC;IAEvC,IAAI,OAAO,KAAK,SAAS,EAAE,CAAC;QAC1B,OAAO,UAAU,EAAE,CAAC;IACtB,CAAC;IAED,MAAM,QAAQ,GAAG,QAAQ,CAAC,OAAO,CAAC,CAAC;IACnC,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;QAC3B,OAAO,oBAAoB,OAAO,OAAO,UAAU,EAAE,EAAE,CAAC;IAC1D,CAAC;IAED,OAAO,QAAQ,CAAC,WAAW,CAAC,CAAC;AAC/B,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,MAAM,CAC1B,IAAuB,EACvB,KAAwB,EACxB,MAA0B;IAE1B,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC,IAAI,KAAK,CAAC,KAAK,KAAK,IAAI,IAAI,MAAM,CAAC,KAAK,KAAK,IAAI,EAAE,CAAC;QACvE,MAAM,iBAAiB,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;QACvC,OAAO;IACT,CAAC;IAED,MAAM,CAAC,KAAK,CAAC,GAAG,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACrC,CAAC"}
package/dist/cli.d.ts ADDED
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=cli.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.d.ts","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":""}
package/dist/cli.js ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import { runCli } from "./app/run-cli.js";
3
+ await runCli(process.argv.slice(2), process.stdin, process.stdout);
4
+ //# sourceMappingURL=cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,MAAM,EAAE,MAAM,kBAAkB,CAAC;AAE1C,MAAM,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,OAAO,CAAC,KAAK,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function renderContact(): string;
2
+ //# sourceMappingURL=contact.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contact.d.ts","sourceRoot":"","sources":["../../src/commands/contact.ts"],"names":[],"mappings":"AAGA,wBAAgB,aAAa,IAAI,MAAM,CAMtC"}
@@ -0,0 +1,10 @@
1
+ import { profile } from "../domain/profile.js";
2
+ import { heading, label } from "../ui/format.js";
3
+ export function renderContact() {
4
+ return [
5
+ heading("Contact"),
6
+ `${label("GitHub")} ${profile.links.github}`,
7
+ `${label("Telegram")} ${profile.links.telegram}`,
8
+ ].join("\n");
9
+ }
10
+ //# sourceMappingURL=contact.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contact.js","sourceRoot":"","sources":["../../src/commands/contact.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,UAAU,aAAa;IAC3B,OAAO;QACL,OAAO,CAAC,SAAS,CAAC;QAClB,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE;QAC5C,GAAG,KAAK,CAAC,UAAU,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,QAAQ,EAAE;KACjD,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function renderHelp(): string;
2
+ //# sourceMappingURL=help.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"help.d.ts","sourceRoot":"","sources":["../../src/commands/help.ts"],"names":[],"mappings":"AAUA,wBAAgB,UAAU,IAAI,MAAM,CAKnC"}
@@ -0,0 +1,15 @@
1
+ import { heading, label } from "../ui/format.js";
2
+ const commandRows = [
3
+ ["alimberdi", "Open the personal terminal profile"],
4
+ ["alimberdi projects", "Show projects and GitHub"],
5
+ ["alimberdi contact", "Show contact links"],
6
+ ["alimberdi play <move>", "Play rock, paper, scissors"],
7
+ ["alimberdi help", "Show this help"],
8
+ ];
9
+ export function renderHelp() {
10
+ return [
11
+ heading("Usage"),
12
+ ...commandRows.map(([command, description]) => `${label(command.padEnd(24))} ${description}`),
13
+ ].join("\n");
14
+ }
15
+ //# sourceMappingURL=help.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"help.js","sourceRoot":"","sources":["../../src/commands/help.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,WAAW,GAAG;IAClB,CAAC,WAAW,EAAE,oCAAoC,CAAC;IACnD,CAAC,oBAAoB,EAAE,0BAA0B,CAAC;IAClD,CAAC,mBAAmB,EAAE,oBAAoB,CAAC;IAC3C,CAAC,uBAAuB,EAAE,4BAA4B,CAAC;IACvD,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;CAC5B,CAAC;AAEX,MAAM,UAAU,UAAU;IACxB,OAAO;QACL,OAAO,CAAC,OAAO,CAAC;QAChB,GAAG,WAAW,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,EAAE,WAAW,CAAC,EAAE,EAAE,CAAC,GAAG,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,IAAI,WAAW,EAAE,CAAC;KAC9F,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function renderHome(): string;
2
+ //# sourceMappingURL=home.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"home.d.ts","sourceRoot":"","sources":["../../src/commands/home.ts"],"names":[],"mappings":"AAIA,wBAAgB,UAAU,IAAI,MAAM,CAYnC"}
@@ -0,0 +1,17 @@
1
+ import { profile } from "../domain/profile.js";
2
+ import { box } from "../ui/box.js";
3
+ import { accent, dim } from "../ui/format.js";
4
+ export function renderHome() {
5
+ return box([
6
+ accent(profile.displayName.toUpperCase()),
7
+ dim(profile.tagline),
8
+ "",
9
+ "projects Explore what I build",
10
+ "contact Find me online",
11
+ "play Play a terminal mini-game",
12
+ "help See every command",
13
+ "",
14
+ dim("Try: npx alimberdi projects"),
15
+ ]);
16
+ }
17
+ //# sourceMappingURL=home.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"home.js","sourceRoot":"","sources":["../../src/commands/home.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,iBAAiB,CAAC;AAE9C,MAAM,UAAU,UAAU;IACxB,OAAO,GAAG,CAAC;QACT,MAAM,CAAC,OAAO,CAAC,WAAW,CAAC,WAAW,EAAE,CAAC;QACzC,GAAG,CAAC,OAAO,CAAC,OAAO,CAAC;QACpB,EAAE;QACF,iCAAiC;QACjC,2BAA2B;QAC3B,sCAAsC;QACtC,8BAA8B;QAC9B,EAAE;QACF,GAAG,CAAC,6BAA6B,CAAC;KACnC,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function renderPlay(choice: string | undefined): string;
2
+ //# sourceMappingURL=play.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"play.d.ts","sourceRoot":"","sources":["../../src/commands/play.ts"],"names":[],"mappings":"AAmBA,wBAAgB,UAAU,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,CAyB7D"}
@@ -0,0 +1,37 @@
1
+ import { heading } from "../ui/format.js";
2
+ const moves = ["rock", "paper", "scissors"];
3
+ const winningMove = {
4
+ rock: "scissors",
5
+ paper: "rock",
6
+ scissors: "paper",
7
+ };
8
+ function isMove(value) {
9
+ return value !== undefined && moves.includes(value);
10
+ }
11
+ function computerMove() {
12
+ return moves[Math.floor(Math.random() * moves.length)] ?? "rock";
13
+ }
14
+ export function renderPlay(choice) {
15
+ if (!isMove(choice)) {
16
+ return [
17
+ heading("Rock, paper, scissors"),
18
+ "Choose a move:",
19
+ " alimberdi play rock",
20
+ " alimberdi play paper",
21
+ " alimberdi play scissors",
22
+ ].join("\n");
23
+ }
24
+ const computer = computerMove();
25
+ const outcome = choice === computer
26
+ ? "Draw."
27
+ : winningMove[choice] === computer
28
+ ? "You win!"
29
+ : "Computer wins.";
30
+ return [
31
+ heading("Rock, paper, scissors"),
32
+ `You: ${choice}`,
33
+ `Computer: ${computer}`,
34
+ `Result: ${outcome}`,
35
+ ].join("\n");
36
+ }
37
+ //# sourceMappingURL=play.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"play.js","sourceRoot":"","sources":["../../src/commands/play.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAE1C,MAAM,KAAK,GAAG,CAAC,MAAM,EAAE,OAAO,EAAE,UAAU,CAAU,CAAC;AAGrD,MAAM,WAAW,GAAiC;IAChD,IAAI,EAAE,UAAU;IAChB,KAAK,EAAE,MAAM;IACb,QAAQ,EAAE,OAAO;CAClB,CAAC;AAEF,SAAS,MAAM,CAAC,KAAyB;IACvC,OAAO,KAAK,KAAK,SAAS,IAAI,KAAK,CAAC,QAAQ,CAAC,KAAa,CAAC,CAAC;AAC9D,CAAC;AAED,SAAS,YAAY;IACnB,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,IAAI,MAAM,CAAC;AACnE,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,MAA0B;IACnD,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC;QACpB,OAAO;YACL,OAAO,CAAC,uBAAuB,CAAC;YAChC,gBAAgB;YAChB,uBAAuB;YACvB,wBAAwB;YACxB,2BAA2B;SAC5B,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IACf,CAAC;IAED,MAAM,QAAQ,GAAG,YAAY,EAAE,CAAC;IAChC,MAAM,OAAO,GACX,MAAM,KAAK,QAAQ;QACjB,CAAC,CAAC,OAAO;QACT,CAAC,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,QAAQ;YAChC,CAAC,CAAC,UAAU;YACZ,CAAC,CAAC,gBAAgB,CAAC;IAEzB,OAAO;QACL,OAAO,CAAC,uBAAuB,CAAC;QAChC,aAAa,MAAM,EAAE;QACrB,aAAa,QAAQ,EAAE;QACvB,aAAa,OAAO,EAAE;KACvB,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function renderProjects(): string;
2
+ //# sourceMappingURL=projects.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/commands/projects.ts"],"names":[],"mappings":"AAGA,wBAAgB,cAAc,IAAI,MAAM,CAMvC"}
@@ -0,0 +1,10 @@
1
+ import { profile } from "../domain/profile.js";
2
+ import { heading, label } from "../ui/format.js";
3
+ export function renderProjects() {
4
+ return [
5
+ heading("Projects"),
6
+ "New terminal projects are on the way.",
7
+ `${label("GitHub")} ${profile.links.github}`,
8
+ ].join("\n");
9
+ }
10
+ //# sourceMappingURL=projects.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"projects.js","sourceRoot":"","sources":["../../src/commands/projects.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,sBAAsB,CAAC;AAC/C,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,iBAAiB,CAAC;AAEjD,MAAM,UAAU,cAAc;IAC5B,OAAO;QACL,OAAO,CAAC,UAAU,CAAC;QACnB,uCAAuC;QACvC,GAAG,KAAK,CAAC,QAAQ,CAAC,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,EAAE;KAC7C,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACf,CAAC"}
@@ -0,0 +1,12 @@
1
+ export interface Profile {
2
+ readonly displayName: string;
3
+ readonly handle: string;
4
+ readonly tagline: string;
5
+ readonly bio: readonly string[];
6
+ readonly links: {
7
+ readonly github: string;
8
+ readonly telegram: string;
9
+ };
10
+ }
11
+ export declare const profile: Profile;
12
+ //# sourceMappingURL=profile.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/domain/profile.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,GAAG,EAAE,SAAS,MAAM,EAAE,CAAC;IAChC,QAAQ,CAAC,KAAK,EAAE;QACd,QAAQ,CAAC,MAAM,EAAE,MAAM,CAAC;QACxB,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;KAC3B,CAAC;CACH;AAED,eAAO,MAAM,OAAO,EAAE,OAYrB,CAAC"}
@@ -0,0 +1,14 @@
1
+ export const profile = {
2
+ displayName: "Adilkhan Alimberdi",
3
+ handle: "alimberdi",
4
+ tagline: "Developer · Builder · Curious mind",
5
+ bio: [
6
+ "I build useful software, explore new ideas,",
7
+ "and turn curiosity into working projects.",
8
+ ],
9
+ links: {
10
+ github: "https://github.com/adilkhanalimberdi",
11
+ telegram: "https://t.me/adilkhanalimberdi",
12
+ },
13
+ };
14
+ //# sourceMappingURL=profile.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile.js","sourceRoot":"","sources":["../../src/domain/profile.ts"],"names":[],"mappings":"AAWA,MAAM,CAAC,MAAM,OAAO,GAAY;IAC9B,WAAW,EAAE,oBAAoB;IACjC,MAAM,EAAE,WAAW;IACnB,OAAO,EAAE,oCAAoC;IAC7C,GAAG,EAAE;QACH,6CAA6C;QAC7C,2CAA2C;KAC5C;IACD,KAAK,EAAE;QACL,MAAM,EAAE,sCAAsC;QAC9C,QAAQ,EAAE,gCAAgC;KAC3C;CACF,CAAC"}
@@ -0,0 +1,20 @@
1
+ export declare const control: {
2
+ readonly alternateScreen: "\u001B[?1049h";
3
+ readonly mainScreen: "\u001B[?1049l";
4
+ readonly clear: "\u001B[2J\u001B[H";
5
+ readonly hideCursor: "\u001B[?25l";
6
+ readonly showCursor: "\u001B[?25h";
7
+ };
8
+ export declare const color: {
9
+ readonly bold: (value: string) => string;
10
+ readonly dim: (value: string) => string;
11
+ readonly cyan: (value: string) => string;
12
+ readonly magenta: (value: string) => string;
13
+ readonly yellow: (value: string) => string;
14
+ readonly white: (value: string) => string;
15
+ readonly gray: (value: string) => string;
16
+ readonly selected: (value: string) => string;
17
+ };
18
+ export declare function stripAnsi(value: string): string;
19
+ export declare function visibleLength(value: string): number;
20
+ //# sourceMappingURL=ansi.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ansi.d.ts","sourceRoot":"","sources":["../../src/ui/ansi.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO;;;;;;CAMV,CAAC;AAmBX,eAAO,MAAM,KAAK;2BACF,MAAM,KAAG,MAAM;0BAChB,MAAM,KAAG,MAAM;2BACd,MAAM,KAAG,MAAM;8BACZ,MAAM,KAAG,MAAM;6BAChB,MAAM,KAAG,MAAM;4BAChB,MAAM,KAAG,MAAM;2BAChB,MAAM,KAAG,MAAM;+BACX,MAAM,KAAG,MAAM;CAEzB,CAAC;AAEX,wBAAgB,SAAS,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAE/C;AAED,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEnD"}
@@ -0,0 +1,39 @@
1
+ export const control = {
2
+ alternateScreen: "\u001B[?1049h",
3
+ mainScreen: "\u001B[?1049l",
4
+ clear: "\u001B[2J\u001B[H",
5
+ hideCursor: "\u001B[?25l",
6
+ showCursor: "\u001B[?25h",
7
+ };
8
+ const codes = {
9
+ reset: 0,
10
+ bold: 1,
11
+ dim: 2,
12
+ cyan: 36,
13
+ magenta: 35,
14
+ yellow: 33,
15
+ white: 97,
16
+ gray: 90,
17
+ cyanBackground: 46,
18
+ black: 30,
19
+ };
20
+ function style(code, value) {
21
+ return `\u001B[${code}m${value}\u001B[0m`;
22
+ }
23
+ export const color = {
24
+ bold: (value) => style(codes.bold, value),
25
+ dim: (value) => style(codes.dim, value),
26
+ cyan: (value) => style(codes.cyan, value),
27
+ magenta: (value) => style(codes.magenta, value),
28
+ yellow: (value) => style(codes.yellow, value),
29
+ white: (value) => style(codes.white, value),
30
+ gray: (value) => style(codes.gray, value),
31
+ selected: (value) => `\u001B[${codes.cyanBackground};${codes.black};${codes.bold}m${value}\u001B[0m`,
32
+ };
33
+ export function stripAnsi(value) {
34
+ return value.replace(/\u001B\[[0-?]*[ -/]*[@-~]/g, "");
35
+ }
36
+ export function visibleLength(value) {
37
+ return [...stripAnsi(value)].length;
38
+ }
39
+ //# sourceMappingURL=ansi.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"ansi.js","sourceRoot":"","sources":["../../src/ui/ansi.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG;IACrB,eAAe,EAAE,eAAe;IAChC,UAAU,EAAE,eAAe;IAC3B,KAAK,EAAE,mBAAmB;IAC1B,UAAU,EAAE,aAAa;IACzB,UAAU,EAAE,aAAa;CACjB,CAAC;AAEX,MAAM,KAAK,GAAG;IACZ,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,GAAG,EAAE,CAAC;IACN,IAAI,EAAE,EAAE;IACR,OAAO,EAAE,EAAE;IACX,MAAM,EAAE,EAAE;IACV,KAAK,EAAE,EAAE;IACT,IAAI,EAAE,EAAE;IACR,cAAc,EAAE,EAAE;IAClB,KAAK,EAAE,EAAE;CACD,CAAC;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are function box(lines: readonly string[]): string;
2
+ //# sourceMappingURL=box.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"box.d.ts","sourceRoot":"","sources":["../../src/ui/box.ts"],"names":[],"mappings":"AAIA,wBAAgB,GAAG,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,GAAG,MAAM,CASpD"}
package/dist/ui/box.js ADDED
@@ -0,0 +1,13 @@
1
+ function visibleLength(value) {
2
+ return value.replace(/\u001B\[[0-?]*[ -/]*[@-~]/g, "").length;
3
+ }
4
+ export function box(lines) {
5
+ const contentWidth = Math.max(...lines.map(visibleLength));
6
+ const horizontal = "─".repeat(contentWidth + 2);
7
+ const body = lines.map((line) => {
8
+ const padding = " ".repeat(contentWidth - visibleLength(line));
9
+ return `│ ${line}${padding} │`;
10
+ });
11
+ return [`┌${horizontal}┐`, ...body, `└${horizontal}┘`].join("\n");
12
+ }
13
+ //# sourceMappingURL=box.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"box.js","sourceRoot":"","sources":["../../src/ui/box.ts"],"names":[],"mappings":"AAAA,SAAS,aAAa,CAAC,KAAa;IAClC,OAAO,KAAK,CAAC,OAAO,CAAC,4BAA4B,EAAE,EAAE,CAAC,CAAC,MAAM,CAAC;AAChE,CAAC;AAED,MAAM,UAAU,GAAG,CAAC,KAAwB;IAC1C,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC;IAC3D,MAAM,UAAU,GAAG,GAAG,CAAC,MAAM,CAAC,YAAY,GAAG,CAAC,CAAC,CAAC;IAChD,MAAM,IAAI,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE;QAC9B,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,CAAC,YAAY,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;QAC/D,OAAO,KAAK,IAAI,GAAG,OAAO,IAAI,CAAC;IACjC,CAAC,CAAC,CAAC;IAEH,OAAO,CAAC,IAAI,UAAU,GAAG,EAAE,GAAG,IAAI,EAAE,IAAI,UAAU,GAAG,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AACpE,CAAC"}
@@ -0,0 +1,5 @@
1
+ export declare const accent: (value: string) => string;
2
+ export declare const dim: (value: string) => string;
3
+ export declare const label: (value: string) => string;
4
+ export declare const heading: (value: string) => string;
5
+ //# sourceMappingURL=format.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/ui/format.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,MAAM,GAAI,OAAO,MAAM,KAAG,MAA0B,CAAC;AAClE,eAAO,MAAM,GAAG,GAAI,OAAO,MAAM,KAAG,MAAyB,CAAC;AAC9D,eAAO,MAAM,KAAK,GAAI,OAAO,MAAM,KAAG,MAA0B,CAAC;AACjE,eAAO,MAAM,OAAO,GAAI,OAAO,MAAM,KAAG,MAAqC,CAAC"}
@@ -0,0 +1,9 @@
1
+ const useColor = process.stdout.isTTY && process.env.NO_COLOR === undefined;
2
+ function color(code, value) {
3
+ return useColor ? `\u001B[${code}m${value}\u001B[0m` : value;
4
+ }
5
+ export const accent = (value) => color(36, value);
6
+ export const dim = (value) => color(2, value);
7
+ export const label = (value) => color(33, value);
8
+ export const heading = (value) => accent(value.toUpperCase());
9
+ //# sourceMappingURL=format.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/ui/format.ts"],"names":[],"mappings":"AAAA,MAAM,QAAQ,GAAG,OAAO,CAAC,MAAM,CAAC,KAAK,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,SAAS,CAAC;AAE5E,SAAS,KAAK,CAAC,IAAY,EAAE,KAAa;IACxC,OAAO,QAAQ,CAAC,CAAC,CAAC,UAAU,IAAI,IAAI,KAAK,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC;AAC/D,CAAC;AAED,MAAM,CAAC,MAAM,MAAM,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;AAClE,MAAM,CAAC,MAAM,GAAG,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC;AAC9D,MAAM,CAAC,MAAM,KAAK,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,KAAK,CAAC,EAAE,EAAE,KAAK,CAAC,CAAC;AACjE,MAAM,CAAC,MAAM,OAAO,GAAG,CAAC,KAAa,EAAU,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,WAAW,EAAE,CAAC,CAAC"}
@@ -0,0 +1,17 @@
1
+ export interface MenuRow {
2
+ readonly label: string;
3
+ readonly description: string;
4
+ }
5
+ export interface FrameOptions {
6
+ readonly brand?: string;
7
+ readonly title: string;
8
+ readonly subtitle?: string;
9
+ readonly body?: readonly string[];
10
+ readonly menu?: readonly MenuRow[];
11
+ readonly selectedIndex?: number;
12
+ readonly notice?: string;
13
+ readonly footer?: string;
14
+ }
15
+ export declare function renderFrame(options: FrameOptions, width: number): readonly string[];
16
+ export declare function centerInTerminal(lines: readonly string[], columns: number, rows: number): string;
17
+ //# sourceMappingURL=frame.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frame.d.ts","sourceRoot":"","sources":["../../src/ui/frame.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,WAAW,EAAE,MAAM,CAAC;CAC9B;AAED,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,MAAM,EAAE,CAAC;IAClC,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,OAAO,EAAE,CAAC;IACnC,QAAQ,CAAC,aAAa,CAAC,EAAE,MAAM,CAAC;IAChC,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC;CAC1B;AAqBD,wBAAgB,WAAW,CAAC,OAAO,EAAE,YAAY,EAAE,KAAK,EAAE,MAAM,GAAG,SAAS,MAAM,EAAE,CA8CnF;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,SAAS,MAAM,EAAE,EACxB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM,GACX,MAAM,CAMR"}
@@ -0,0 +1,60 @@
1
+ import { color, visibleLength } from "./ansi.js";
2
+ function pad(value, width) {
3
+ return `${value}${" ".repeat(Math.max(0, width - visibleLength(value)))}`;
4
+ }
5
+ function center(value, width) {
6
+ const remaining = Math.max(0, width - visibleLength(value));
7
+ const left = Math.floor(remaining / 2);
8
+ return `${" ".repeat(left)}${value}${" ".repeat(remaining - left)}`;
9
+ }
10
+ function fit(value, width) {
11
+ if (visibleLength(value) <= width) {
12
+ return value;
13
+ }
14
+ const plain = [...value];
15
+ return `${plain.slice(0, Math.max(0, width - 1)).join("")}…`;
16
+ }
17
+ export function renderFrame(options, width) {
18
+ const innerWidth = Math.max(42, width - 2);
19
+ const top = color.cyan(`╭${"─".repeat(innerWidth)}╮`);
20
+ const bottom = color.magenta(`╰${"─".repeat(innerWidth)}╯`);
21
+ const border = (content = "") => `${color.cyan("│")}${pad(fit(content, innerWidth), innerWidth)}${color.magenta("│")}`;
22
+ const divider = border(color.gray(` ${"─".repeat(Math.max(0, innerWidth - 4))} `));
23
+ const lines = [top];
24
+ lines.push(border(` ${color.bold(color.cyan("◆"))} ${color.bold(options.brand ?? "ALIMBERDI")} ${color.gray("/ terminal profile")}`));
25
+ lines.push(border());
26
+ lines.push(border(center(color.bold(color.white(options.title.toUpperCase())), innerWidth)));
27
+ if (options.subtitle !== undefined) {
28
+ lines.push(border(center(color.magenta(options.subtitle), innerWidth)));
29
+ }
30
+ lines.push(border());
31
+ lines.push(divider);
32
+ lines.push(border());
33
+ for (const bodyLine of options.body ?? []) {
34
+ lines.push(border(` ${bodyLine}`));
35
+ }
36
+ if ((options.body?.length ?? 0) > 0 && (options.menu?.length ?? 0) > 0) {
37
+ lines.push(border());
38
+ }
39
+ options.menu?.forEach((item, index) => {
40
+ const label = item.label.padEnd(12);
41
+ const content = ` ${index === options.selectedIndex ? "›" : " "} ${label} ${item.description}`;
42
+ lines.push(border(index === options.selectedIndex ? color.selected(content) : content));
43
+ });
44
+ if (options.notice !== undefined) {
45
+ lines.push(border());
46
+ lines.push(border(center(color.yellow(options.notice), innerWidth)));
47
+ }
48
+ lines.push(border());
49
+ lines.push(divider);
50
+ lines.push(border(center(color.gray(options.footer ?? "↑↓ navigate enter select esc back q quit"), innerWidth)));
51
+ lines.push(bottom);
52
+ return lines;
53
+ }
54
+ export function centerInTerminal(lines, columns, rows) {
55
+ const contentWidth = Math.max(...lines.map(visibleLength));
56
+ const left = " ".repeat(Math.max(0, Math.floor((columns - contentWidth) / 2)));
57
+ const top = "\n".repeat(Math.max(0, Math.floor((rows - lines.length) / 2)));
58
+ return `${top}${lines.map((line) => `${left}${line}`).join("\n")}`;
59
+ }
60
+ //# sourceMappingURL=frame.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"frame.js","sourceRoot":"","sources":["../../src/ui/frame.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,aAAa,EAAE,MAAM,WAAW,CAAC;AAkBjD,SAAS,GAAG,CAAC,KAAa,EAAE,KAAa;IACvC,OAAO,GAAG,KAAK,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,KAAK,GAAG,aAAa,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,CAAC;AAC5E,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AC,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,MAAM,IAAI,gDAAgD,CAAC,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IACvH,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;IAEnB,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,UAAU,gBAAgB,CAC9B,KAAwB,EACxB,OAAe,EACf,IAAY;IAEZ,MAAM,YAAY,GAAG,IAAI,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,CAAC;IAC3D,MAAM,IAAI,GAAG,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,OAAO,GAAG,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAC/E,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,IAAI,CAAC,KAAK,CAAC,CAAC,IAAI,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC;IAE5E,OAAO,GAAG,GAAG,GAAG,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,GAAG,IAAI,GAAG,IAAI,EAAE,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC;AACrE,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,44 @@
1
1
  {
2
2
  "name": "alimberdi",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "Adilkhan Alimberdi's interactive personal CLI.",
5
+ "type": "module",
6
+ "bin": {
7
+ "alimberdi": "dist/cli.js"
8
+ },
9
+ "files": [
10
+ "dist"
11
+ ],
12
+ "scripts": {
13
+ "build": "tsc -p tsconfig.build.json",
14
+ "dev": "tsx src/cli.ts",
15
+ "start": "node dist/cli.js",
16
+ "test": "tsx --test src/app/run-cli.test.ts src/ui/frame.test.ts",
17
+ "check": "tsc -p tsconfig.json --noEmit",
18
+ "prepack": "npm run build"
19
+ },
20
+ "keywords": [
21
+ "alimberdi",
22
+ "cli",
23
+ "portfolio",
24
+ "terminal"
25
+ ],
26
+ "author": "Adilkhan Alimberdi",
27
+ "license": "MIT",
28
+ "engines": {
29
+ "node": ">=22"
30
+ },
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+https://github.com/adilkhanalimberdi/alimberdi-cli.git"
34
+ },
35
+ "homepage": "https://github.com/adilkhanalimberdi/alimberdi-cli#readme",
36
+ "bugs": {
37
+ "url": "https://github.com/adilkhanalimberdi/alimberdi-cli/issues"
38
+ },
39
+ "devDependencies": {
40
+ "@types/node": "^22.15.0",
41
+ "tsx": "^4.19.0",
42
+ "typescript": "^5.8.0"
43
+ }
44
+ }