@indah_sekar/os-t 1.0.0 → 1.0.1
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.
- package/README.md +2 -2
- package/bin/cli.js +23 -24
- package/package.json +3 -2
- package/src/data/commands.js +678 -792
- package/src/data/commands.json +114 -114
package/README.md
CHANGED
|
@@ -7,7 +7,7 @@ Available as a **web app** and a **CLI tool**.
|
|
|
7
7
|
## Install (CLI)
|
|
8
8
|
|
|
9
9
|
```bash
|
|
10
|
-
npm
|
|
10
|
+
npm i -g @indah_sekar/os-t
|
|
11
11
|
```
|
|
12
12
|
|
|
13
13
|
## CLI Usage
|
|
@@ -57,7 +57,7 @@ npm run preview
|
|
|
57
57
|
## Programmatic Usage (import as module)
|
|
58
58
|
|
|
59
59
|
```js
|
|
60
|
-
import commands from "os-t";
|
|
60
|
+
import commands from "@indah-sekar/os-t";
|
|
61
61
|
|
|
62
62
|
// commands.windows, commands.linux, commands.macos
|
|
63
63
|
```
|
package/bin/cli.js
CHANGED
|
@@ -24,7 +24,7 @@ function printHelp() {
|
|
|
24
24
|
OS Troubleshooter - Quick troubleshooting commands for Windows, Linux & macOS
|
|
25
25
|
|
|
26
26
|
Usage:
|
|
27
|
-
os-
|
|
27
|
+
os-t [options] [command-name]
|
|
28
28
|
|
|
29
29
|
Options:
|
|
30
30
|
--help, -h Show this help message
|
|
@@ -35,13 +35,13 @@ function printHelp() {
|
|
|
35
35
|
--copy Copy command to clipboard (requires xclip/xsel/pbcopy)
|
|
36
36
|
|
|
37
37
|
Examples:
|
|
38
|
-
os-
|
|
39
|
-
os-
|
|
40
|
-
os-
|
|
41
|
-
os-
|
|
42
|
-
os-
|
|
43
|
-
os-
|
|
44
|
-
os-
|
|
38
|
+
os-t --list
|
|
39
|
+
os-t --os linux --list
|
|
40
|
+
os-t "Flush DNS Cache"
|
|
41
|
+
os-t --os windows "System File Checker"
|
|
42
|
+
os-t --search ping
|
|
43
|
+
os-t --category Network --os linux
|
|
44
|
+
os-t --copy "Flush DNS Cache"
|
|
45
45
|
`);
|
|
46
46
|
}
|
|
47
47
|
|
|
@@ -57,6 +57,7 @@ function listCommands(osFilter, categoryFilter, searchQuery) {
|
|
|
57
57
|
continue;
|
|
58
58
|
}
|
|
59
59
|
const categories = commands[os];
|
|
60
|
+
let osHeaderPrinted = false;
|
|
60
61
|
for (const cat of categories) {
|
|
61
62
|
if (
|
|
62
63
|
categoryFilter &&
|
|
@@ -75,18 +76,17 @@ function listCommands(osFilter, categoryFilter, searchQuery) {
|
|
|
75
76
|
);
|
|
76
77
|
}
|
|
77
78
|
if (cmds.length === 0) continue;
|
|
78
|
-
|
|
79
|
-
|
|
79
|
+
if (!osHeaderPrinted) {
|
|
80
|
+
console.log(`\n ${os}`);
|
|
81
|
+
osHeaderPrinted = true;
|
|
82
|
+
}
|
|
80
83
|
for (const cmd of cmds) {
|
|
81
|
-
console.log(` ${cmd.
|
|
82
|
-
console.log(` ${cmd.description}`);
|
|
83
|
-
console.log(` $ ${cmd.command}`);
|
|
84
|
-
console.log();
|
|
84
|
+
console.log(` ${cmd.command.padEnd(40)}${cmd.description}`);
|
|
85
85
|
total++;
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
|
-
console.log(
|
|
89
|
+
console.log(`\n Total: ${total} command(s)`);
|
|
90
90
|
}
|
|
91
91
|
|
|
92
92
|
function findCommand(query) {
|
|
@@ -141,17 +141,16 @@ function prepareCommand(cmd, os) {
|
|
|
141
141
|
}
|
|
142
142
|
|
|
143
143
|
function printResults(results) {
|
|
144
|
+
let currentOs = null;
|
|
144
145
|
for (const r of results) {
|
|
145
146
|
const finalCmd = prepareCommand(r.command, r.os);
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
console.log(`
|
|
151
|
-
console.log(` $ ${finalCmd}`);
|
|
152
|
-
console.log();
|
|
147
|
+
if (r.os !== currentOs) {
|
|
148
|
+
console.log(`\n ${r.os}`);
|
|
149
|
+
currentOs = r.os;
|
|
150
|
+
}
|
|
151
|
+
console.log(` ${finalCmd.padEnd(40)}${r.description}`);
|
|
153
152
|
}
|
|
154
|
-
console.log(
|
|
153
|
+
console.log(`\n Found: ${results.length} command(s)`);
|
|
155
154
|
}
|
|
156
155
|
|
|
157
156
|
function main() {
|
|
@@ -204,7 +203,7 @@ function main() {
|
|
|
204
203
|
if (results.length === 0) {
|
|
205
204
|
console.log(`\n No commands found matching "${finalQuery}"`);
|
|
206
205
|
console.log(
|
|
207
|
-
" Try: os-
|
|
206
|
+
" Try: os-t --list to see all available commands\n",
|
|
208
207
|
);
|
|
209
208
|
return;
|
|
210
209
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@indah_sekar/os-t",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Quick troubleshooting commands for Windows, Linux & macOS. CLI tool + web app.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"troubleshooting",
|
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
},
|
|
31
31
|
"main": "./src/data/commands.json",
|
|
32
32
|
"bin": {
|
|
33
|
-
"os-
|
|
33
|
+
"os-t": "bin/cli.js"
|
|
34
34
|
},
|
|
35
35
|
"files": [
|
|
36
36
|
"bin/",
|
|
@@ -45,6 +45,7 @@
|
|
|
45
45
|
"preview": "vite preview"
|
|
46
46
|
},
|
|
47
47
|
"dependencies": {
|
|
48
|
+
"@indah_sekar/os-t": "^1.0.0",
|
|
48
49
|
"react": "^19.2.7",
|
|
49
50
|
"react-dom": "^19.2.7"
|
|
50
51
|
},
|