about-system 0.0.17 → 0.0.18

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,328 @@
1
+ #!/usr/bin/env node
2
+ import d from "os";
3
+ import o from "fs";
4
+ import a from "path";
5
+ import { fileURLToPath as k } from "url";
6
+ import { getSystemInfo as v } from "./system-info-api.js";
7
+ const I = k(import.meta.url), h = a.join(d.homedir(), ".config", "systeminfo-settings.json"), b = a.join(d.tmpdir(), "systeminfo-cache.json"), _ = {
8
+ display_order: [
9
+ ["user", "hostname", "os", "device", "kernel", "cpu", "gpu"],
10
+ ["disk_used", "ram_used", "top_process", "uptime", "temperature", "battery", "load_average"],
11
+ ["ip", "iplocal", "city", "domain", "isp"],
12
+ ["shell", "pacman", "services_running", "containers"]
13
+ ],
14
+ colors: {
15
+ user: "red",
16
+ hostname: "orange",
17
+ disk_used: "purple",
18
+ ram_used: "yellow",
19
+ top_process: "magenta",
20
+ uptime: "cyan",
21
+ ip: "green",
22
+ iplocal: "yellow",
23
+ city: "green",
24
+ domain: "gray",
25
+ isp: "lightblue",
26
+ os: "gray",
27
+ cpu: "orange",
28
+ gpu: "yellow",
29
+ device: "yellow",
30
+ kernel: "green",
31
+ shell: "orange",
32
+ pacman: "multicolor",
33
+ ports: "multicolor",
34
+ containers: "green",
35
+ memory_available: "blue",
36
+ swap_used: "purple",
37
+ load_average: "red",
38
+ users_logged_in: "cyan",
39
+ network_interfaces: "yellow",
40
+ mount_points: "gray",
41
+ services_running: "green",
42
+ temperature: "red",
43
+ battery: "green",
44
+ screen_resolution: "blue"
45
+ },
46
+ display: {
47
+ show_emojis: !0,
48
+ single_line: !1,
49
+ line_wrap_length: process?.stdout?.columns || 100
50
+ },
51
+ network: {
52
+ show_offline_message: !0
53
+ },
54
+ advanced: {
55
+ debug: !1
56
+ }
57
+ }, S = {
58
+ reset: "\x1B[0m",
59
+ red: "\x1B[38;5;196m",
60
+ orange: "\x1B[38;5;208m",
61
+ yellow: "\x1B[38;5;226m",
62
+ green: "\x1B[38;5;46m",
63
+ blue: "\x1B[38;5;39m",
64
+ cyan: "\x1B[38;5;51m",
65
+ purple: "\x1B[38;5;171m",
66
+ magenta: "\x1B[38;5;213m",
67
+ gray: "\x1B[38;5;250m",
68
+ lightblue: "\x1B[38;5;220m"
69
+ }, g = {
70
+ user: "👤 ",
71
+ hostname: "🏠 ",
72
+ ip: "🌎 ",
73
+ iplocal: "🌐 ",
74
+ city: "📍 ",
75
+ domain: "🔗 ",
76
+ isp: "👮 ",
77
+ os: "⚡ ",
78
+ cpu: "📈 ",
79
+ gpu: "🎮 ",
80
+ device: "💻 ",
81
+ kernel: "🔧 ",
82
+ shell: "🐚 ",
83
+ pacman: "🚀 ",
84
+ disk_used: "📁 ",
85
+ ram_used: "💾 ",
86
+ top_process: "🔝 ",
87
+ uptime: "⏱️ ",
88
+ ports: "🔌 ",
89
+ containers: "📦",
90
+ memory_available: "🧠 ",
91
+ swap_used: "🔄 ",
92
+ load_average: "⚖️ ",
93
+ users_logged_in: "👥 ",
94
+ network_interfaces: "🌐 ",
95
+ mount_points: "📂 ",
96
+ services_running: "⚙️ ",
97
+ temperature: "🌡️ ",
98
+ battery_charging: "🔌 ",
99
+ battery: "🔋 ",
100
+ screen_resolution: "🖥️ "
101
+ }, y = d.platform() === "win32";
102
+ function C() {
103
+ try {
104
+ if (o.existsSync(h)) {
105
+ const e = JSON.parse(o.readFileSync(h, "utf8"));
106
+ return { ..._, ...e };
107
+ }
108
+ } catch {
109
+ }
110
+ return _;
111
+ }
112
+ function w(e) {
113
+ try {
114
+ const s = a.dirname(h);
115
+ return o.existsSync(s) || o.mkdirSync(s, { recursive: !0 }), o.writeFileSync(h, JSON.stringify(e, null, 2)), !0;
116
+ } catch {
117
+ return !1;
118
+ }
119
+ }
120
+ function j(e, s, t) {
121
+ if (!s || s.trim() === "") return "";
122
+ const u = S[t.colors[e]] || S.reset, i = t.display.show_emojis && g[e] || "";
123
+ if (e === "battery" && t.display.show_emojis) {
124
+ const n = s.includes("+") ? g.battery_charging : g.battery;
125
+ return `${u}${n}${s}`;
126
+ }
127
+ if (e === "ports" && t.colors[e] === "multicolor" && s) {
128
+ let c = ` ${t.display.show_emojis ? g.ports : ""}`;
129
+ const r = s.split(" "), l = [31, 32, 33, 34, 35, 36];
130
+ return r.forEach((f, m) => {
131
+ const p = l[m % l.length];
132
+ c += `\x1B[${p}m${f}\x1B[0m `;
133
+ }), c.trim();
134
+ }
135
+ if (e === "pacman" && t.colors[e] === "multicolor" && s) {
136
+ const n = t.display.show_emojis ? g.pacman : "";
137
+ return `${u}${n}${s}`;
138
+ }
139
+ return `${u}${i}${s}`;
140
+ }
141
+ function x(e) {
142
+ return e.replace(/\x1b\[[0-9;]*m/g, "");
143
+ }
144
+ async function $(e = null) {
145
+ const s = C(), t = e || s.display_order, u = await v();
146
+ if (s.display.single_line) {
147
+ const r = [];
148
+ for (const l of t)
149
+ for (const f of l) {
150
+ const m = u[f], p = j(f, m, s);
151
+ p && p.trim() && r.push(p);
152
+ }
153
+ r.length > 0 && console.log(r.join(" ") + S.reset);
154
+ return;
155
+ }
156
+ const i = [];
157
+ let n = "";
158
+ const c = s.display.line_wrap_length;
159
+ for (const r of t)
160
+ for (const l of r) {
161
+ const f = u[l], m = j(l, f, s);
162
+ if (m && m.trim()) {
163
+ const p = x(m).length, F = x(n).length;
164
+ n && F + p + 1 > c ? (i.push(n), n = m) : n = n ? `${n} ${m}` : m;
165
+ }
166
+ }
167
+ n && i.push(n), i.length > 0 ? i.forEach((r) => {
168
+ console.log(r + S.reset);
169
+ }) : s.advanced.debug && console.log("No system information could be displayed");
170
+ }
171
+ function L(e) {
172
+ const s = C();
173
+ if (e.includes("--settings-init"))
174
+ return w(_) ? console.log("Settings initialized with defaults") : console.log("Failed to initialize settings"), !0;
175
+ if (e.includes("--settings-show"))
176
+ return console.log("Current settings:"), console.log(JSON.stringify(s, null, 2)), !0;
177
+ if (e.includes("--settings-reset"))
178
+ return w(_) ? console.log("Settings reset to defaults") : console.log("Failed to reset settings"), !0;
179
+ if (e.includes("--refresh")) {
180
+ try {
181
+ o.existsSync(b) && (o.unlinkSync(b), console.log("Cache cleared"));
182
+ } catch (u) {
183
+ console.error("Error clearing cache:", u.message);
184
+ }
185
+ return !0;
186
+ }
187
+ const t = e.indexOf("--set");
188
+ if (t !== -1 && e[t + 1] && e[t + 2]) {
189
+ const u = e[t + 1], i = e[t + 2];
190
+ try {
191
+ const n = i.startsWith("{") || i.startsWith("[") ? JSON.parse(i) : i, c = u.split(".");
192
+ let r = s;
193
+ for (let l = 0; l < c.length - 1; l++)
194
+ r[c[l]] || (r[c[l]] = {}), r = r[c[l]];
195
+ r[c[c.length - 1]] = n, w(s) ? console.log(`Setting ${u} = ${i}`) : console.log("Failed to save settings");
196
+ } catch (n) {
197
+ console.error("Error setting value:", n.message);
198
+ }
199
+ return !0;
200
+ }
201
+ return !1;
202
+ }
203
+ function B() {
204
+ const e = d.homedir();
205
+ let s, t;
206
+ y ? (s = a.join(e, "AppData", "Local"), t = a.join(s, "systeminfo.js")) : (s = a.join(e, ".config"), t = a.join(s, "systeminfo.js"));
207
+ const u = a.resolve(I);
208
+ try {
209
+ if (o.existsSync(s) || o.mkdirSync(s, { recursive: !0 }), o.copyFileSync(u, t), y || o.chmodSync(t, "755"), y) {
210
+ console.log("Windows installation:"), console.log("1. Script copied to:", t), console.log("2. To add to PowerShell profile, run:"), console.log(` Add-Content $PROFILE "node '${t}'"`), console.log("3. To add to Command Prompt, create a batch file in your startup folder");
211
+ const i = a.join(s, "systeminfo-startup.bat");
212
+ o.writeFileSync(i, `@echo off
213
+ node "${t}"
214
+ `), console.log("4. Batch file created:", i);
215
+ } else {
216
+ try {
217
+ const f = a.join(e, ".hushlogin");
218
+ o.writeFileSync(f, "");
219
+ } catch {
220
+ }
221
+ const i = a.join(e, ".bashrc"), n = `node ${t}`;
222
+ o.existsSync(i) ? o.readFileSync(i, "utf8").includes("systeminfo.js") || o.appendFileSync(i, `
223
+ ${n}
224
+ `) : o.writeFileSync(i, `${n}
225
+ `);
226
+ const c = a.join(e, ".zshrc");
227
+ o.existsSync(c) && (o.readFileSync(c, "utf8").includes("systeminfo.js") || o.appendFileSync(c, `
228
+ ${n}
229
+ `));
230
+ const r = a.join(e, ".config", "fish", "config.fish");
231
+ o.existsSync(r) && (o.readFileSync(r, "utf8").includes("systeminfo.js") || o.appendFileSync(r, `
232
+ set -U fish_greeting ""
233
+ ${n}
234
+ `));
235
+ const l = a.join(e, ".config", "nushell", "config.nu");
236
+ o.existsSync(l) && (o.readFileSync(l, "utf8").includes("systeminfo.js") || o.appendFileSync(l, `
237
+ $env.config.show_banner = false
238
+ ${n}
239
+ `));
240
+ }
241
+ console.log("Shell greeting installation completed!");
242
+ } catch (i) {
243
+ console.error("Error installing shell greeting:", i.message), process.exit(1);
244
+ }
245
+ }
246
+ function O(e) {
247
+ for (const s of e)
248
+ if (!s.startsWith("--") && s.includes(","))
249
+ return s.split(",").map((t) => t.trim()).filter((t) => t.length > 0);
250
+ for (const s of e)
251
+ if (!s.startsWith("--") && !s.includes("=") && s.length > 0)
252
+ return [s.trim()];
253
+ return null;
254
+ }
255
+ async function E() {
256
+ console.log(`
257
+ System Info Script - TypeScript Version
258
+
259
+ Usage:
260
+ about-system [options]
261
+ about-system <part1,part2,...> # CLI mode: show specific parts only
262
+
263
+ Options:
264
+ --help, -h Show this help message
265
+ --install Install as shell greeting
266
+ --settings-init Initialize settings file with defaults
267
+ --settings-show Display current settings
268
+ --settings-reset Reset settings to defaults
269
+ --refresh Clear the cache file
270
+ --set <key> <value> Set a configuration value (use dot notation)
271
+ --json Output as JSON
272
+
273
+ Examples:
274
+ about-system # Show all info (default)
275
+ about-system cpu,os # Show only CPU and OS info
276
+ about-system user,hostname,ip # Show user, hostname, and IP
277
+ about-system disk_used # Show only disk usage
278
+ about-system --install
279
+ about-system --set display.show_emojis false
280
+ about-system --set colors.user blue
281
+ about-system --json
282
+
283
+ Settings file: ${h}
284
+ Cache file: ${b}
285
+
286
+ Platform: ${y ? "Windows" : d.platform() === "darwin" ? "macOS" : d.platform() === "linux" ? "Linux" : "Unknown"}
287
+
288
+ Available display blocks:
289
+ Basic: user, hostname, uptime, shell, os, kernel, device
290
+ Resources: disk_used, ram_used, memory_available, swap_used, top_process
291
+ Network: ip, iplocal, city, domain, isp, network_interfaces
292
+ Hardware: cpu, gpu, temperature, battery, screen_resolution
293
+ System: load_average, users_logged_in, mount_points, services_running
294
+ Tools: pacman, ports, containers
295
+ `);
296
+ }
297
+ async function P() {
298
+ const e = process.argv.slice(2);
299
+ if (L(e))
300
+ return;
301
+ if (e.includes("--help") || e.includes("-h")) {
302
+ await E();
303
+ return;
304
+ }
305
+ if (e.includes("--install")) {
306
+ B();
307
+ return;
308
+ }
309
+ if (e.includes("--json")) {
310
+ const t = await v();
311
+ console.log(JSON.stringify(t, null, 2));
312
+ return;
313
+ }
314
+ const s = O(e);
315
+ if (s) {
316
+ await $([s]);
317
+ return;
318
+ }
319
+ await $();
320
+ }
321
+ P().catch((e) => {
322
+ console.error("Error:", e.message), process.exit(1);
323
+ });
324
+ export {
325
+ $ as displaySystemInfo,
326
+ B as installShellGreeting
327
+ };
328
+ //# sourceMappingURL=about-system-cli.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"about-system-cli.js","sources":["../src/about-system-cli.ts"],"sourcesContent":["#!/usr/bin/env node\nimport os from 'os';\nimport fs from 'fs';\nimport path from 'path';\nimport { fileURLToPath } from 'url';\nimport { getSystemInfo } from './system-info-api.js';\nimport type { SystemInfo, SystemInfoOptions } from './systeminfo-types.js';\n\nconst __filename = fileURLToPath(import.meta.url);\n\n// Settings configuration\nconst SETTINGS_FILE = path.join(os.homedir(), '.config', 'systeminfo-settings.json');\nconst CACHE_FILE = path.join(os.tmpdir(), 'systeminfo-cache.json');\n\n// Default settings\nconst DEFAULT_SETTINGS = {\n display_order: [\n ['user', 'hostname', 'os', 'device', 'kernel', 'cpu', 'gpu'],\n ['disk_used', 'ram_used', 'top_process', 'uptime', 'temperature', 'battery', 'load_average'],\n ['ip', 'iplocal', 'city', 'domain', 'isp'],\n ['shell', 'pacman', 'services_running', 'containers'],\n ],\n colors: {\n user: 'red',\n hostname: 'orange',\n disk_used: 'purple',\n ram_used: 'yellow',\n top_process: 'magenta',\n uptime: 'cyan',\n ip: 'green',\n iplocal: 'yellow',\n city: 'green',\n domain: 'gray',\n isp: 'lightblue',\n os: 'gray',\n cpu: 'orange',\n gpu: 'yellow',\n device: 'yellow',\n kernel: 'green',\n shell: 'orange',\n pacman: 'multicolor',\n ports: 'multicolor',\n containers: 'green',\n memory_available: 'blue',\n swap_used: 'purple',\n load_average: 'red',\n users_logged_in: 'cyan',\n network_interfaces: 'yellow',\n mount_points: 'gray',\n services_running: 'green',\n temperature: 'red',\n battery: 'green',\n screen_resolution: 'blue',\n },\n display: {\n show_emojis: true,\n single_line: false,\n line_wrap_length: process?.stdout?.columns || 100,\n },\n network: {\n show_offline_message: true,\n },\n advanced: {\n debug: false,\n },\n};\n\n// Color codes\nconst colors = {\n reset: '\\x1b[0m',\n red: '\\x1b[38;5;196m',\n orange: '\\x1b[38;5;208m',\n yellow: '\\x1b[38;5;226m',\n green: '\\x1b[38;5;46m',\n blue: '\\x1b[38;5;39m',\n cyan: '\\x1b[38;5;51m',\n purple: '\\x1b[38;5;171m',\n magenta: '\\x1b[38;5;213m',\n gray: '\\x1b[38;5;250m',\n lightblue: '\\x1b[38;5;220m',\n};\n\n// Emoji mappings\nconst emojis: Record<string, string> = {\n user: '👤 ',\n hostname: '🏠 ',\n ip: '🌎 ',\n iplocal: '🌐 ',\n city: '📍 ',\n domain: '🔗 ',\n isp: '👮 ',\n os: '⚡ ',\n cpu: '📈 ',\n gpu: '🎮 ',\n device: '💻 ',\n kernel: '🔧 ',\n shell: '🐚 ',\n pacman: '🚀 ',\n disk_used: '📁 ',\n ram_used: '💾 ',\n top_process: '🔝 ',\n uptime: '⏱️ ',\n ports: '🔌 ',\n containers: '📦',\n memory_available: '🧠 ',\n swap_used: '🔄 ',\n load_average: '⚖️ ',\n users_logged_in: '👥 ',\n network_interfaces: '🌐 ',\n mount_points: '📂 ',\n services_running: '⚙️ ',\n temperature: '🌡️ ',\n battery_charging: '🔌 ',\n battery: '🔋 ',\n screen_resolution: '🖥️ ',\n};\n\n// Platform detection\nconst IS_WINDOWS = os.platform() === 'win32';\n\ninterface Settings {\n display_order: string[][];\n colors: Record<string, string>;\n display: {\n show_emojis: boolean;\n single_line: boolean;\n line_wrap_length: number;\n };\n network: {\n show_offline_message: boolean;\n };\n advanced: {\n debug: boolean;\n };\n}\n\nfunction loadSettings(): Settings {\n try {\n if (fs.existsSync(SETTINGS_FILE)) {\n const settings = JSON.parse(fs.readFileSync(SETTINGS_FILE, 'utf8'));\n return { ...DEFAULT_SETTINGS, ...settings };\n }\n } catch {}\n return DEFAULT_SETTINGS;\n}\n\nfunction saveSettings(settings: Settings): boolean {\n try {\n const configDir = path.dirname(SETTINGS_FILE);\n if (!fs.existsSync(configDir)) {\n fs.mkdirSync(configDir, { recursive: true });\n }\n fs.writeFileSync(SETTINGS_FILE, JSON.stringify(settings, null, 2));\n return true;\n } catch {\n return false;\n }\n}\n\nfunction formatValue(key: string, value: string, settings: Settings): string {\n if (!value || value.trim() === '') return '';\n\n const color = colors[settings.colors[key] as keyof typeof colors] || colors.reset;\n const emoji = settings.display.show_emojis ? emojis[key] || '' : '';\n\n // Special handling for battery emoji\n if (key === 'battery' && settings.display.show_emojis) {\n const batteryEmoji = value.includes('+') ? emojis.battery_charging : emojis.battery;\n return `${color}${batteryEmoji}${value}`;\n }\n\n // Multicolor handling for ports\n if (key === 'ports' && settings.colors[key] === 'multicolor' && value) {\n const emoji = settings.display.show_emojis ? emojis.ports : '';\n let output = ` ${emoji}`;\n const ports = value.split(' ');\n const colorCodes = [31, 32, 33, 34, 35, 36];\n ports.forEach((port, index) => {\n const colorCode = colorCodes[index % colorCodes.length];\n output += `\\x1b[${colorCode}m${port}\\x1b[0m `;\n });\n return output.trim();\n }\n\n // Multicolor handling for pacman\n if (key === 'pacman' && settings.colors[key] === 'multicolor' && value) {\n const emoji = settings.display.show_emojis ? emojis.pacman : '';\n return `${color}${emoji}${value}`;\n }\n\n return `${color}${emoji}${value}`;\n}\n\nfunction removeAnsiCodes(str: string): string {\n return str.replace(/\\x1b\\[[0-9;]*m/g, '');\n}\n\nasync function displaySystemInfo(customDisplayOrder: string[][] | null = null): Promise<void> {\n const settings = loadSettings();\n const displayOrder = customDisplayOrder || settings.display_order;\n\n // Get system info\n const info = await getSystemInfo();\n\n // Single line mode\n if (settings.display.single_line) {\n const allItems: string[] = [];\n\n for (const group of displayOrder) {\n for (const key of group) {\n const value = info[key as keyof SystemInfo] as string;\n const formatted = formatValue(key, value, settings);\n if (formatted && formatted.trim()) {\n allItems.push(formatted);\n }\n }\n }\n\n if (allItems.length > 0) {\n console.log(allItems.join(' ') + colors.reset);\n }\n return;\n }\n\n // Multi-line mode with intelligent wrapping\n const lines: string[] = [];\n let currentLine = '';\n const maxLineLength = settings.display.line_wrap_length;\n\n for (const group of displayOrder) {\n for (const key of group) {\n const value = info[key as keyof SystemInfo] as string;\n const formatted = formatValue(key, value, settings);\n\n if (formatted && formatted.trim()) {\n const formattedLength = removeAnsiCodes(formatted).length;\n const currentLineLength = removeAnsiCodes(currentLine).length;\n\n if (currentLine && currentLineLength + formattedLength + 1 > maxLineLength) {\n lines.push(currentLine);\n currentLine = formatted;\n } else {\n currentLine = currentLine ? `${currentLine} ${formatted}` : formatted;\n }\n }\n }\n }\n\n if (currentLine) {\n lines.push(currentLine);\n }\n\n // Output\n if (lines.length > 0) {\n lines.forEach((line) => {\n console.log(line + colors.reset);\n });\n } else if (settings.advanced.debug) {\n console.log('No system information could be displayed');\n }\n}\n\nfunction handleSettingsCommand(args: string[]): boolean {\n const settings = loadSettings();\n\n if (args.includes('--settings-init')) {\n if (saveSettings(DEFAULT_SETTINGS)) {\n console.log('Settings initialized with defaults');\n } else {\n console.log('Failed to initialize settings');\n }\n return true;\n }\n\n if (args.includes('--settings-show')) {\n console.log('Current settings:');\n console.log(JSON.stringify(settings, null, 2));\n return true;\n }\n\n if (args.includes('--settings-reset')) {\n if (saveSettings(DEFAULT_SETTINGS)) {\n console.log('Settings reset to defaults');\n } else {\n console.log('Failed to reset settings');\n }\n return true;\n }\n\n if (args.includes('--refresh')) {\n try {\n if (fs.existsSync(CACHE_FILE)) {\n fs.unlinkSync(CACHE_FILE);\n console.log('Cache cleared');\n }\n } catch (error) {\n console.error('Error clearing cache:', (error as Error).message);\n }\n return true;\n }\n\n const setIndex = args.indexOf('--set');\n if (setIndex !== -1 && args[setIndex + 1] && args[setIndex + 2]) {\n const key = args[setIndex + 1];\n const value = args[setIndex + 2];\n\n try {\n const parsedValue = value.startsWith('{') || value.startsWith('[') ? JSON.parse(value) : value;\n\n const keys = key.split('.');\n let current: any = settings;\n for (let i = 0; i < keys.length - 1; i++) {\n if (!current[keys[i]]) current[keys[i]] = {};\n current = current[keys[i]];\n }\n current[keys[keys.length - 1]] = parsedValue;\n\n if (saveSettings(settings)) {\n console.log(`Setting ${key} = ${value}`);\n } else {\n console.log('Failed to save settings');\n }\n } catch (error) {\n console.error('Error setting value:', (error as Error).message);\n }\n return true;\n }\n\n return false;\n}\n\nfunction installShellGreeting(): void {\n const homeDir = os.homedir();\n\n let configDir: string, scriptPath: string;\n if (IS_WINDOWS) {\n configDir = path.join(homeDir, 'AppData', 'Local');\n scriptPath = path.join(configDir, 'systeminfo.js');\n } else {\n configDir = path.join(homeDir, '.config');\n scriptPath = path.join(configDir, 'systeminfo.js');\n }\n\n const currentScript = path.resolve(__filename);\n\n try {\n if (!fs.existsSync(configDir)) {\n fs.mkdirSync(configDir, { recursive: true });\n }\n\n fs.copyFileSync(currentScript, scriptPath);\n if (!IS_WINDOWS) {\n fs.chmodSync(scriptPath, '755');\n }\n\n if (IS_WINDOWS) {\n console.log('Windows installation:');\n console.log('1. Script copied to:', scriptPath);\n console.log('2. To add to PowerShell profile, run:');\n console.log(` Add-Content $PROFILE \"node '${scriptPath}'\"`);\n console.log('3. To add to Command Prompt, create a batch file in your startup folder');\n\n const startupBat = path.join(configDir, 'systeminfo-startup.bat');\n fs.writeFileSync(startupBat, `@echo off\\nnode \"${scriptPath}\"\\n`);\n console.log('4. Batch file created:', startupBat);\n } else {\n try {\n const hushLoginPath = path.join(homeDir, '.hushlogin');\n fs.writeFileSync(hushLoginPath, '');\n } catch {}\n\n const bashrcPath = path.join(homeDir, '.bashrc');\n const bashLine = `node ${scriptPath}`;\n\n if (fs.existsSync(bashrcPath)) {\n const bashrc = fs.readFileSync(bashrcPath, 'utf8');\n if (!bashrc.includes('systeminfo.js')) {\n fs.appendFileSync(bashrcPath, `\\n${bashLine}\\n`);\n }\n } else {\n fs.writeFileSync(bashrcPath, `${bashLine}\\n`);\n }\n\n const zshrcPath = path.join(homeDir, '.zshrc');\n if (fs.existsSync(zshrcPath)) {\n const zshrc = fs.readFileSync(zshrcPath, 'utf8');\n if (!zshrc.includes('systeminfo.js')) {\n fs.appendFileSync(zshrcPath, `\\n${bashLine}\\n`);\n }\n }\n\n const fishConfigPath = path.join(homeDir, '.config', 'fish', 'config.fish');\n if (fs.existsSync(fishConfigPath)) {\n const fishConfig = fs.readFileSync(fishConfigPath, 'utf8');\n if (!fishConfig.includes('systeminfo.js')) {\n fs.appendFileSync(fishConfigPath, `\\nset -U fish_greeting \"\"\\n${bashLine}\\n`);\n }\n }\n\n const nushellConfigPath = path.join(homeDir, '.config', 'nushell', 'config.nu');\n if (fs.existsSync(nushellConfigPath)) {\n const nushellConfig = fs.readFileSync(nushellConfigPath, 'utf8');\n if (!nushellConfig.includes('systeminfo.js')) {\n fs.appendFileSync(nushellConfigPath, `\\n$env.config.show_banner = false\\n${bashLine}\\n`);\n }\n }\n }\n\n console.log('Shell greeting installation completed!');\n } catch (error) {\n console.error('Error installing shell greeting:', (error as Error).message);\n process.exit(1);\n }\n}\n\nfunction parseCLIMode(args: string[]): string[] | null {\n for (const arg of args) {\n if (!arg.startsWith('--') && arg.includes(',')) {\n return arg\n .split(',')\n .map((part) => part.trim())\n .filter((part) => part.length > 0);\n }\n }\n\n for (const arg of args) {\n if (!arg.startsWith('--') && !arg.includes('=') && arg.length > 0) {\n return [arg.trim()];\n }\n }\n\n return null;\n}\n\nasync function showHelp(): Promise<void> {\n console.log(`\nSystem Info Script - TypeScript Version\n\nUsage:\n about-system [options]\n about-system <part1,part2,...> # CLI mode: show specific parts only\n\nOptions:\n --help, -h Show this help message\n --install Install as shell greeting\n --settings-init Initialize settings file with defaults\n --settings-show Display current settings\n --settings-reset Reset settings to defaults\n --refresh Clear the cache file\n --set <key> <value> Set a configuration value (use dot notation)\n --json Output as JSON\n\nExamples:\n about-system # Show all info (default)\n about-system cpu,os # Show only CPU and OS info\n about-system user,hostname,ip # Show user, hostname, and IP\n about-system disk_used # Show only disk usage\n about-system --install\n about-system --set display.show_emojis false\n about-system --set colors.user blue\n about-system --json\n\nSettings file: ${SETTINGS_FILE}\nCache file: ${CACHE_FILE}\n\nPlatform: ${IS_WINDOWS ? 'Windows' : os.platform() === 'darwin' ? 'macOS' : os.platform() === 'linux' ? 'Linux' : 'Unknown'}\n\nAvailable display blocks:\n Basic: user, hostname, uptime, shell, os, kernel, device\n Resources: disk_used, ram_used, memory_available, swap_used, top_process\n Network: ip, iplocal, city, domain, isp, network_interfaces\n Hardware: cpu, gpu, temperature, battery, screen_resolution\n System: load_average, users_logged_in, mount_points, services_running\n Tools: pacman, ports, containers\n`);\n}\n\nasync function main(): Promise<void> {\n const args = process.argv.slice(2);\n\n if (handleSettingsCommand(args)) {\n return;\n }\n\n if (args.includes('--help') || args.includes('-h')) {\n await showHelp();\n return;\n }\n\n if (args.includes('--install')) {\n installShellGreeting();\n return;\n }\n\n if (args.includes('--json')) {\n const info = await getSystemInfo();\n console.log(JSON.stringify(info, null, 2));\n return;\n }\n\n const cliParts = parseCLIMode(args);\n if (cliParts) {\n const customDisplayOrder = [cliParts];\n await displaySystemInfo(customDisplayOrder);\n return;\n }\n\n await displaySystemInfo();\n}\n\nmain().catch((error) => {\n console.error('Error:', error.message);\n process.exit(1);\n});\n\nexport { displaySystemInfo, installShellGreeting };\n"],"names":["__filename","fileURLToPath","SETTINGS_FILE","path","os","CACHE_FILE","DEFAULT_SETTINGS","colors","emojis","IS_WINDOWS","loadSettings","fs","settings","saveSettings","configDir","formatValue","key","value","color","emoji","batteryEmoji","output","ports","colorCodes","port","index","colorCode","removeAnsiCodes","str","displaySystemInfo","customDisplayOrder","displayOrder","info","getSystemInfo","allItems","group","formatted","lines","currentLine","maxLineLength","formattedLength","currentLineLength","line","handleSettingsCommand","args","error","setIndex","parsedValue","keys","current","i","installShellGreeting","homeDir","scriptPath","currentScript","startupBat","hushLoginPath","bashrcPath","bashLine","zshrcPath","fishConfigPath","nushellConfigPath","parseCLIMode","arg","part","showHelp","main","cliParts"],"mappings":";;;;;;AAQA,MAAMA,IAAaC,EAAc,YAAY,GAAG,GAG1CC,IAAgBC,EAAK,KAAKC,EAAG,QAAA,GAAW,WAAW,0BAA0B,GAC7EC,IAAaF,EAAK,KAAKC,EAAG,OAAA,GAAU,uBAAuB,GAG3DE,IAAmB;AAAA,EACvB,eAAe;AAAA,IACb,CAAC,QAAQ,YAAY,MAAM,UAAU,UAAU,OAAO,KAAK;AAAA,IAC3D,CAAC,aAAa,YAAY,eAAe,UAAU,eAAe,WAAW,cAAc;AAAA,IAC3F,CAAC,MAAM,WAAW,QAAQ,UAAU,KAAK;AAAA,IACzC,CAAC,SAAS,UAAU,oBAAoB,YAAY;AAAA,EAAA;AAAA,EAEtD,QAAQ;AAAA,IACN,MAAM;AAAA,IACN,UAAU;AAAA,IACV,WAAW;AAAA,IACX,UAAU;AAAA,IACV,aAAa;AAAA,IACb,QAAQ;AAAA,IACR,IAAI;AAAA,IACJ,SAAS;AAAA,IACT,MAAM;AAAA,IACN,QAAQ;AAAA,IACR,KAAK;AAAA,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AAGF,MAAIA,EAAK,SAAS,QAAQ,KAAKA,EAAK,SAAS,IAAI,GAAG;AAClD,UAAMqB,EAAA;AACN;AAAA,EACF;AAEA,MAAIrB,EAAK,SAAS,WAAW,GAAG;AAC9B,IAAAO,EAAA;AACA;AAAA,EACF;AAEA,MAAIP,EAAK,SAAS,QAAQ,GAAG;AAC3B,UAAMZ,IAAO,MAAMC,EAAA;AACnB,YAAQ,IAAI,KAAK,UAAUD,GAAM,MAAM,CAAC,CAAC;AACzC;AAAA,EACF;AAEA,QAAMmC,IAAWL,EAAalB,CAAI;AAClC,MAAIuB,GAAU;AAEZ,UAAMtC,EADqB,CAACsC,CAAQ,CACM;AAC1C;AAAA,EACF;AAEA,QAAMtC,EAAA;AACR;AAEAqC,IAAO,MAAM,CAACrB,MAAU;AACtB,UAAQ,MAAM,UAAUA,EAAM,OAAO,GACrC,QAAQ,KAAK,CAAC;AAChB,CAAC;"}
@@ -0,0 +1,58 @@
1
+ import { DisplaySystemInfoFunction } from './systeminfo-types.js';
2
+ import { GetSystemInfoFunction } from './systeminfo-types.js';
3
+ import { Platform } from './systeminfo-types.js';
4
+ import { PlatformAvailability } from './systeminfo-types.js';
5
+ import { SystemInfo } from './systeminfo-types.js';
6
+ import { SystemInfoOptions } from './systeminfo-types.js';
7
+
8
+ /**
9
+ * Cache storage structure
10
+ * @interface Cache
11
+ */
12
+ declare interface Cache {
13
+ [key: string]: CacheEntry;
14
+ }
15
+
16
+ /**
17
+ * Represents a cached value with timestamp
18
+ * @interface CacheEntry
19
+ */
20
+ declare interface CacheEntry {
21
+ /** The cached value */
22
+ value: any;
23
+ /** Unix timestamp when the value was cached */
24
+ timestamp: number;
25
+ }
26
+
27
+ export { DisplaySystemInfoFunction }
28
+
29
+ /**
30
+ * Get all system information as a clean JSON object
31
+ * @param options Configuration options
32
+ * @returns Promise resolving to SystemInfo object
33
+ */
34
+ export declare function getSystemInfo(options?: SystemInfoOptions): Promise<SystemInfo>;
35
+
36
+ export { GetSystemInfoFunction }
37
+
38
+ /**
39
+ * Loads cache from disk
40
+ * @returns {Cache} Cached data or empty object if cache doesn't exist or is corrupted
41
+ */
42
+ export declare function loadCache(): Cache;
43
+
44
+ export { Platform }
45
+
46
+ export { PlatformAvailability }
47
+
48
+ /**
49
+ * Saves cache to disk
50
+ * @param {Cache} cache - Cache object to save
51
+ */
52
+ export declare function saveCache(cache: Cache): void;
53
+
54
+ export { SystemInfo }
55
+
56
+ export { SystemInfoOptions }
57
+
58
+ export { }
package/dist/index.js ADDED
@@ -0,0 +1,7 @@
1
+ import { getSystemInfo as o, loadCache as t, saveCache as c } from "./system-info-api.js";
2
+ export {
3
+ o as getSystemInfo,
4
+ t as loadCache,
5
+ c as saveCache
6
+ };
7
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}